Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for summary, metadata, and alternatives. #52

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

blkt
Copy link
Contributor

@blkt blkt commented Nov 8, 2024

This change adds support for the following v2 API endpoints

  • /v2/summary, which returns an aggregate view of the dependency
  • /v2/pkg, which returns more detailed information about a package
  • /v2/alternatives, which returns packages which can be used in place of the given one

Note: this also contains a very minor breaking change that will impact existing users; we changed the client constructor ruotines from returning a pointer-to-struct to returning an interface, which unfortunately requires users to accomodate their code. Despite being a breaking change, we won't bump the major version because we consider this sdk unstable at the moment.

@blkt blkt self-assigned this Nov 8, 2024
Copy link

Minder Vulnerability Report ✅

Minder analyzed this PR and found it does not add any new vulnerable dependencies.

Vulnerability scan of 6649aef9:

  • 🐞 vulnerable packages: 0
  • 🛠 fixes available for: 0

Copy link

@stacklok-cloud-staging stacklok-cloud-staging bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependency Information

Minder analyzed the dependencies introduced in this pull request and detected that some dependencies do not meet your security profile.

📦 Dependency: github.com/google/uuid

Trusty Score: 0

Scoring details
Component Score
Provenance_type verified_provenance_match
Provenance 0
Trust-summary 5.4
User activity 8.9
Repository activity 5.9
From activity
Package activity 7.4
Proof of Origin (Provenance)

This package can be linked back to its source code using a historical provenance map.

We were able to correlate a significant number of git tags and tagged releases in this package’s source code to versions of the published package. This mapping creates a strong link from the package back to its source code repository, verifying proof of origin.

Published package versions 13
Number of git tags or releases 28
Versions matched to tags or releases 12

@blkt blkt force-pushed the feat/add-v2-summary-endpoints branch 4 times, most recently from bdaca47 to 65cbdd9 Compare November 14, 2024 13:27
@blkt blkt marked this pull request as ready for review November 14, 2024 13:29

return true, nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to the reviewer: below this line there are the relevant changes, while all of the above was just moved from a different package.

internal/client/client.go Outdated Show resolved Hide resolved
@blkt blkt force-pushed the feat/add-v2-summary-endpoints branch from 65cbdd9 to bdbcf9a Compare November 14, 2024 18:20
@blkt blkt changed the title Add support for /v2/summary and /v2/pkg. Add support for summary, metadata, and alternatives. Nov 14, 2024
@blkt blkt force-pushed the feat/add-v2-summary-endpoints branch from bdbcf9a to 0ae8d59 Compare November 14, 2024 18:25
This change adds support for the following v2 API endpoints
* `/v2/summary`, which returns an aggregate view of the dependency
* `/v2/pkg`, which returns more detailed information about a package
* `/v2/alternatives`, which returns packages which can be used in
  place of the given one

Note: this also contains a very minor breaking change that will impact
existing users; we changed the client constructor ruotines from
returning a pointer-to-struct to returning an interface, which
unfortunately requires users to accomodate their code. Despite being a
breaking change, we won't bump the major version because we consider
this sdk unstable at the moment.
@blkt blkt force-pushed the feat/add-v2-summary-endpoints branch from 0ae8d59 to 4b7d51d Compare November 15, 2024 15:04
@blkt blkt merged commit fd7f9d6 into main Nov 15, 2024
2 checks passed
@blkt blkt deleted the feat/add-v2-summary-endpoints branch November 15, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants