refactor: only unpack git repos once
Metadata
Current evaluation
Merged post-approval and CI. Refactors git inspection to unpack repos once via a new CacheDir field. Other inspectors use the git-checkout-pack annotation to access the unpacked repo, eliminating duplicate work and resolving #276.
Suggested action: —
No scores available.
Issue body
With this change, the git.upload-pack inspector becomes in charge of doing all git-related verifications (whether the fetch is shallow, single ref only, etc) and unpacks & checks out the wanted ref into a session-local directory that persists after the inspector is done.
Other git-related inspectors can then use the new 'git-checkout-pack' annotation to directly inspect the contents of the repository, without duplicating the work and without having to worry about whether the repo is shallow, etc.
This requires the introduction of a new "CacheDir" field in artefacts, so that the inspector has a place to put files that a) persists after that inspector is done and b) gets removed when the session's resources are cleaned-up.
Fixes #276
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged post-approval and CI. Refactors git inspection to unpack repos once via a new CacheDir field. Other inspectors use the git-checkout-pack annotation to access the unpacked repo, eliminating duplicate work and resolving #276. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #221 create a cache for the unpacked git repositories | fetch-service | open | Feature request to cache unpacked git repositories to avoid redundant unpacking by inspectors. Created 720 days ago, last activity 389 days ago, no maintainer triage. | |
| #141 inspectors/git: deduplicate wanted refs | fetch-service | merged | Merged to deduplicate wanted refs in the git inspector, preventing request rejections when clients request the same ref multiple times. Approved by two reviewers, passed CI, and updated two files. |