Repository navigation
fix(cli): require --repo-name for Pacman packages in subdirectories - #101
Merged
Merged
Conversation
The --repo-name check globbed only the input root, while generation scans the input recursively, so a Pacman package in a subdirectory was published under a fallback database name. Validation now runs the recursive scanner once and uses the result for the Debian --codename check and the Pacman --repo-name check. State the ADR-0018 known gap (a content change without a version or revision bump is not republished) in the --skip-published-identities help and in README.md, as the ADR requires. Fixes #96 Fixes #99
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Author
Cross-review: Ready
Revert testIn a scratch worktree at At the head the same tests pass, and |
bketelsen
approved these changes
Nov 13, 2026
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.
Summary
Fixes #96
Fixes #99
#96.
validateConfigrequired--repo-nameonly whenfilepath.Glob(inputDir/*.pkg.tar.*)matched, so it saw only the input root. Generation scans the input recursively, so a Pacman package in a subdirectory was published under a fallback database name (--origin, elsecustom). That contradictsdocs/specs/generators.md("--repo-nameis required for Pacman repositories"). NowvalidateConfigruns the recursive scanner one time (scannedPackageTypes) and uses the result for both the Debian--codenamecheck and the Pacman--repo-namecheck. The old code ran this scan already for the Debian check, so the change adds no scan.#99. ADR-0018 says that the known gap (a content change without a version or revision bump keeps its identity and is not republished) is stated in the flag help, the action input description and
README.md. The action input already stated it. This PR adds it to the--skip-published-identitieshelp, toREADME.mdand to the help listing indocs/guides/usage.md.Tests (new file
internal/cli/generate_reponame_test.go):TestGeneratePacmanRequiresRepoName: a Pacman package in the input root, insub/and ina/b/is refused without--repo-name, and no output directory is written. Thesubdirectoryandnested subdirectorycases fail onmain(error = <nil>).TestGenerateSkipPublishedIdentitiesHelpStatesKnownGappins the gap in the flag help. It fails onmain.Checks
make check: formats, then runs the verify gate (tidy, vet, gofmt, lint at the mise pin, docs integrity, unit tests). Green locally.make ci: no Docker on the authoring host, so CI runs it.Risk tier
Rationale: matched risk path:
internal/cli/generate.go(L1, "update verification: the digest-conflict gate and the signature-verified skip of published sysexts"). Why the change is safe:--skip-published-identitiesand the input-type detection invalidateConfig.--codenamecheck uses the same recursive scan as before, with the same error type, error message and order. Only the helper's name and return type change.mainaccepted silently. It cannot accept a configuration thatmainrefused, except a file whose name contains.pkg.tar.but that the scanner does not detect as Pacman. Generation does not publish such a file as a Pacman package, so the check now matches what generation publishes.Docs housekeeping
docs/specs/generators.mdnow says that the recursive scan decides when--repo-nameis required.README.mdstays at 440 words (the limit is 1000).Verification
node scripts/check-docs.mjsgreen (inmake check)docs/specs/generators.mdupdated with the code