Add verified artifact acquisition - #1
Open
andrew wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new acquire package that defines the acquisition boundary for resolving, fetching, verifying, and storing package artifacts, enabling verified/staged artifact ingestion into caller-managed storage.
Changes:
- Introduces
acquire.Serviceand related interfaces (Resolver,Fetcher,Store,Stage) to coordinate resolution, download, integrity verification, and staged commits. - Adds comprehensive unit tests covering cache hits/misses, offline mode, size limits, integrity mismatch handling, and failure cleanup behavior.
- Adds the
github.com/git-pkgs/integritydependency for streaming digest computation and SRI verification.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| go.mod | Adds github.com/git-pkgs/integrity dependency used by acquisition verification. |
| go.sum | Adds checksums for the new integrity dependency. |
| acquire/acquire.go | Implements artifact acquisition flow (cache/open, resolve+fetch, size limit, verification, staged commit). |
| acquire/acquire_test.go | Adds unit tests for acquisition behavior and error/cleanup paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+411
to
+418
| func digestAlgorithms(expected integrity.SRI) []integrity.Algorithm { | ||
| algorithms := make([]integrity.Algorithm, 0, len(expected)+1) | ||
| algorithms = append(algorithms, integrity.SHA256) | ||
| for _, item := range expected { | ||
| algorithms = append(algorithms, item.Algorithm()) | ||
| } | ||
| return algorithms | ||
| } |
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.
Adds an
acquirepackage for fetching package artifacts into caller-provided storage. It supports exact artifact resolution, cache and offline reads, size limits, integrity verification, and staged writes.This supplies the acquisition boundary needed by git-pkgs/git-pkgs#294.