Skip to content

Composer downloads: gaps left after #430 #432

Closed

Description

@pinguinfuss

#430 stopped the proxy from caching a branch's current head under an older commit's file name. Three gaps are left:

  • Wrong archives already in the cache. Archives cached under the wrong commit before Fetch the pinned commit for Composer branch downloads #430 are still served, because a cache hit doesn't look at the stored upstream URL. A one-off cleanup or a check on cache hit would fix it.
  • GitLab. GitLab dists look like …/repository/archive.zip?sha=<commit>, so every commit of a version is cached as archive.zip. A lock file can get a different commit than it pins, and older commits get a 404. The cache file name needs to include the commit.
  • Branch names with a slash. proxyDistURL doesn't escape the version, so dev-feature/x produces a URL the download route can't match. Escaping the version should be enough.

Activity

  1. andrew commented on Oct 11, 2026

    @andrew
    Contributor

    Assigned to you @pinguinfuss, hope you don't mind?

  2. andrew commented on Oct 11, 2026

    @andrew
    Contributor

    For GitLab, include the commit in the cache key and use the commit from the lock file in the upstream sha parameter. Changing the cache key alone still leaves older commits returning 404.

    For example, a lock file pins A, then the branch moves to B. Test that both commits return the right archive, with and without cached downloads. This applies to new lock files too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions