Repository navigation
fix(bundles): refuse to build when bundle.yml or README.md is a symlink - #5169
Merged
Merged
Conversation
The packager skips symlinked files, but build_bundle checked the manifest and README by following links. A symlinked bundle.yml/README.md therefore built "successfully" into a zip without them, which `bundle install` then rejected. Fail the build with a clear error instead. Fixes github#5088 Assisted-by: Grok Bot (model: unknown, autonomous) Signed-off-by: kevin9327 <5299031+kevin9327@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified, though tests were not run during this review.
No open issues 🎉
What changed in this PR
Fixes #5088 by rejecting symlinked required bundle files before packaging, preserving Spec Kit’s existing rule that symlinks are excluded from artifacts.
Changes:
- Raises a file-specific
BundlerErrorwhenbundle.ymlorREADME.mdis a symlink. - Adds parametrized regression coverage for both files and checks that no ZIP is produced.
The PR reports before-and-after regression evidence; tests were not run during this review.
| File | Description |
|---|---|
tests/specify_cli/bundles/test_packager.py |
Tests rejection of symlinked required files without producing an artifact. |
src/specify_cli/bundles/packager.py |
Adds explicit symlink checks before manifest validation and packaging. |
Review effort: Balanced (auto)
Collaborator
|
Thank you! |
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.
Fixes #5088
Problem
build_bundlevalidatesbundle.ymlandREADME.mdby following symlinks, but_collect_filesskips every symlinked file. If either is a symlink the build exits 0 with an artifact that lacks it, andspecify bundle install <artifact.zip>then fails with "does not contain a bundle.yml".Fix
build_bundlenow raisesBundlerErrorup front whenbundle.ymlorREADME.mdis a symlink, naming the file. The issue offered "include it or fail clearly"; failing keeps the existing rule that symlinked files are never packaged.Evidence
test_build_refuses_symlinked_manifest_or_readme(bundle.yml,README.md) intests/specify_cli/bundles/test_packager.py.mainboth cases fail (the build succeeds); with this change both pass.pytest tests/specify_cli/bundles: 1270 passed.AI disclosure
Implemented by Grok Bot (an AI coding agent) acting on behalf of @kevin9327, running autonomously; model unknown/not exposed to the agent. Extent: code generation, tests, and this description. The commit carries an
Assisted-by:trailer. I ran the tests above locally.