Skip to content

fix(fallback): skip links and specials when repacking a tag archive - #459

Merged
ORESoftware merged 1 commit into
mainfrom
fix/repack-skips-non-file-tag-archive-entries
Sep 18, 2026
Merged

ORESoftware merged 1 commit into
mainfrom
fix/repack-skips-non-file-tag-archive-entries

Conversation

@ORESoftware

Copy link
Copy Markdown
Contributor

Follow-up to #379 / #458. A repository that merely carries a symlink was unresolvable from github.com while the registry origin is down.

zed pack walks the working tree and takes regular files only, so links and specials never appear in a published artifact. The tag-archive repack instead failed closed on the first such entry:

error: ... no GitHub/R2/GHCR fallback succeeded for flags-2-env/flags-2-env@0.3.0
  ... /archive/refs/tags/v0.3.0.tar.gz: GitHub tag archive entry
      `flags-2-env-flags-2-env-73713d2/clients/bun/publish.sh` has unsupported type Symlink

flags-2-env/flags-2-env v0.3.0 is a live dependency of ORESoftware/ores-compose, and publishing that same tag omits the link entirely — so refusing it made the repack disagree with publish, which is exactly what the repack exists to reproduce.

Change

Skip non-regular entries instead of failing. That matches publish, and it is what keeps a repacked tag byte-identical to the published artifact. Path-traversal rejection, the size cap and the entry-count cap are unchanged, and the store still verifies the digest against the pin.

The test that asserted the old behaviour is rewritten to assert the new one: a fixture carrying a symlink repacks successfully, and the link is absent from the result.

Evidence

  • cargo test --locked --lib: 619 passed.
  • zed pack on the flags-2-env v0.3.0 tag tree: 360 files, 143 excluded by publish rules, sha256 b4e88e4f… — the digest a repack must reproduce.
  • End-to-end, registry pointed at http://127.0.0.1:9: the ores-compose graph now gets past flags-2-env. The remaining failure is a genuine repository defect elsewhere in that graph (ORESoftware/ores-interfaces declares a target rooted at generated/public, which .gitignore excludes, so zed pack fails there too — tracked separately).

🤖 Generated with Claude Code

`zed pack` walks the working tree and takes regular files only, so a link
or special file in the source tree is simply absent from the published
artifact. The tag-archive repack instead failed closed on the first such
entry, which made any repository that merely carries a symlink
unresolvable from github.com while the registry origin is down.

flags-2-env/flags-2-env v0.3.0 is the live case: its tree contains
`clients/bun/publish.sh` as a symlink, so installing it from GitHub failed
with "unsupported type Symlink" even though publishing that same tag omits
the link entirely.

Skipping matches publish exactly, which is what keeps a repacked tag
byte-identical to the published artifact. Path traversal, size and entry
count limits are unchanged, and the store still verifies the digest.

cargo test --locked --lib: 619 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ORESoftware
ORESoftware merged commit abf0266 into main Sep 18, 2026
14 of 21 checks passed
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.

1 participant