Skip to content

Expose and select published artifacts - #75

Open
andrew wants to merge 1 commit into
mainfrom
artifact-selection
Open

Expose and select published artifacts#75
andrew wants to merge 1 commit into
mainfrom
artifact-selection

Conversation

@andrew

@andrew andrew commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.Artifact and adds Artifacts []Artifact to core.Version, exposing it via registries.Artifact.
  • Updates the PyPI registry client to retain all release files as artifacts (and switches PyPI file size handling to int64).
  • Adds ResolveWithOptions plus 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 thread internal/core/types.go
Comment on lines 24 to 27
Integrity string // sha256-..., sha512-...
Status VersionStatus // "", "yanked", "deprecated", "retracted"
Artifacts []Artifact
Metadata map[string]any
Comment thread fetch/resolver.go
Comment on lines +230 to +233
if options.Integrity != "" && info.Integrity != "" &&
!integrityMatches(info.Integrity, options.Integrity) {
return nil, ErrNoMatchingArtifact
}
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