Skip to content

Close the Composer download gaps left after #430 - #433

Merged
andrew merged 3 commits into
git-pkgs:mainfrom
pinguinfuss:issue-432-composer-dist-gaps
Oct 12, 2026
Merged

andrew merged 3 commits into
git-pkgs:mainfrom
pinguinfuss:issue-432-composer-dist-gaps

Conversation

@pinguinfuss

Copy link
Copy Markdown
Contributor

Fixes #432.

GitLab archives are now cached per commit (archive-<sha>.zip), and branch downloads fetch the commit from the lock file. The old shared archive.zip entry gets dropped.

Archives cached under the wrong commit before #430 are fetched again when their stored upstream URL doesn't match. For that, a refetch now also updates upstream_url in the database.

Branch names with a slash are escaped in dist URLs, so dev-feature/x works.

Tested with a lock file pinning A while the branch moves to B, on GitHub and GitLab, with and without cache. I also ran the built proxy on SQLite and Postgres against old cache data from before #430.

…e commit the lock file pins, and branch names with a slash are escaped in dist URLs so the download route matches them.
…it's URL are now discarded and fetched again, and a refetched artifact records the URL it actually came from.
… proxies cached under the shared archive.zip name is dropped. A test now moves the branch from A to B and checks that A keeps coming from the cache.
andrew pushed a commit that referenced this pull request Oct 12, 2026
* Reject package requests whose decoded path contains '?' or '#', in one middleware in front of every ecosystem mount. Handlers build the upstream URL from the decoded path, so busybox.apk%3F/foo-9.9-r0.apk fetched busybox but cached it as foo; PyPI could be poisoned the same way, and the other ecosystems stored files under mangled names past the denylist and cooldown.

* Let Composer archive downloads through the '?'/'#' guard: they resolve the upstream URL from metadata, and with #433 a branch like dev-fix/#42 is requested as dev-fix%2F%2342. Adversarial review finding F1.

@andrew andrew 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.

The commit-specific GitLab cache keys, stale archive replacement, and escaped branch versions address the linked issue. No changes requested.

@andrew
andrew merged commit dcf90cf into git-pkgs:main Oct 12, 2026
6 checks passed
@pinguinfuss
pinguinfuss deleted the issue-432-composer-dist-gaps branch October 12, 2026 08:20
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.

Composer downloads: gaps left after #430

2 participants