Expose and select published artifacts - #75
Open
andrew wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the registries data model to expose all published artifacts for a package version (not just a representative file), and updates the fetch resolver to optionally select an exact artifact by filename or integrity—enabling precise archive resolution (notably for PyPI).
Changes:
- Introduces
core.Artifactand addsArtifacts []Artifacttocore.Version, exposing it viaregistries.Artifact. - Updates the PyPI registry client to retain all release files as artifacts (and switches PyPI file size handling to
int64). - Adds
ResolveWithOptionsplus artifact selection logic in the resolver, with new tests covering selection behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| registries.go | Exposes the new Artifact type alias in the public package surface. |
| internal/core/types.go | Adds the Artifact type and Version.Artifacts field to the shared core model. |
| internal/pypi/pypi.go | Populates Version.Artifacts from PyPI release files; updates file size type to int64. |
| internal/pypi/pypi_test.go | Extends PyPI version tests to validate published artifact retention and fields. |
| fetch/resolver.go | Adds ResolveWithOptions and artifact selection/matching logic, plus a new error for no-match cases. |
| fetch/resolver_test.go | Adds resolver tests for selecting (and failing to select) a published artifact by integrity. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
24
to
27
| Integrity string // sha256-..., sha512-... | ||
| Status VersionStatus // "", "yanked", "deprecated", "retracted" | ||
| Artifacts []Artifact | ||
| Metadata map[string]any |
Comment on lines
+230
to
+233
| if options.Integrity != "" && info.Integrity != "" && | ||
| !integrityMatches(info.Integrity, options.Integrity) { | ||
| return nil, ErrNoMatchingArtifact | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes every published artifact on a version and adds exact artifact selection by filename or integrity. PyPI now retains all files for a release while preserving the existing representative version fields.
This supplies exact archive resolution for git-pkgs/git-pkgs#294.