Repository navigation
fix(aur): tell users how to fix a duplicate architecture - #7141
Conversation
`ErrMultipleArchivesSameArch` rejects configs that used to produce output,
for instance `archives: [{formats: [tar.gz, zip]}]` with an `aurs` entry
that has no `ids`, but it did not say what to do about it. brew and cask
already point at `ids` in the same situation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 95ddccd8-7a86-4668-a31f-5a70cfee068e
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7141 +/- ##
=======================================
Coverage 91.56% 91.56%
=======================================
Files 191 191
Lines 15903 15903
=======================================
Hits 14562 14562
Misses 1341 1341 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
caarlos0
left a comment
There was a problem hiding this comment.
Verdict: one blocking problem
(Posted as a comment: GitHub does not permit a change request on your own pull request.)
The one goal of this change is to make the fix discoverable. For the configuration that the description names as the cause (archives: [{formats: [tar.gz, zip]}] with no ids), the new advice does not work. See the comment on internal/pipe/aur/aur.go:37.
The change itself is correct and safe in all other respects:
- The rejection is still the correct behavior. The old PKGBUILD emitted two
source_x86_64=lines, and the artifact order is not deterministic, thus the shipped format was random. - Nothing else in the repository, the documentation, or the golden testdata asserts the old string.
golangci-lintreports 0 issues. The message does not start with a capital letter and does not end with punctuation, thus ST1005 is satisfied.
Missing coverage (no single line)
The scenario in the description — one archives entry, two formats, one shared artifact ID — has no test in the repository. TestRunPipeRejectsDuplicateArchitectures covers only artifacts with different IDs. A test for that scenario would have shown that the new advice is inert.
Verification gaps
- The claim that the pre-#7100 PKGBUILD was valid bash is confirmed by a template trace (
tmpl.go:65-67), not by a build of the old tree. TestRunPipeMultipleConfigurationsfails locally because of asafe.bareRepository=explicitgit setting. That failure is environmental. Withsafe.bareRepository=all,go test ./internal/pipe/aur/...passes.
This review was produced by an automated reviewer (GitHub Copilot CLI).
`ids` alone cannot fix the config the previous message pointed at. The archive pipe stamps every format of a single `archives` entry with the same `ExtraID`, so `artifact.ByIDs` cannot separate two archives built from `formats: [tar.gz, zip]`. A user following the hint would add `ids` and hit the identical error. Name both causes in the message, and cover the single-id/multi-format case in the test, including the row that shows `ids` does not help. Assert the sentinel instead of the literal text, matching brew and cask, so a wording change no longer requires a test change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f203943f-d716-454d-b790-1476f68f6221 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Deploying goreleaser with
|
| Latest commit: |
af2ccf9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9faaf551.goreleaser.pages.dev |
| Branch Preview URL: | https://fix-aur-duplicate-arch-hint.goreleaser.pages.dev |
Tell users how to fix an AUR entry that gets two archives for the same architecture.
ErrMultipleArchivesSameArch(added in #7100) rejects configs that previously produced output. It is reachable with a plainarchives: [{formats: [tar.gz, zip]}]plus anaursentry withoutids: both linux/amd64 archives pass theByTypes(UploadableArchive, UploadableBinary)filter.The old PKGBUILD emitted two
source_x86_64=lines. That is valid bash — the last one wins — but the archive pipe builds formats concurrently, so which format shipped was not deterministic. Rejecting the config is still the right call; this only makes the fix discoverable.idsalone is not enough, though. The archive pipe stamps every format of a singlearchivesentry with the sameExtraID(archive.go:259), soartifact.ByIDscannot separate them — a user who follows a bare "use ids" hint addsidsand hits the identical error. The message therefore names both causes:TestRunPipeRejectsDuplicateArchitecturesgains two rows —single id, multiple formatsandsingle id, multiple formats, filtered by ids— the second of which records thatidsdoes not disambiguate that case. The assertion also moves from the literal string torequire.ErrorIson the sentinel, matching brew and cask, so future wording changes no longer require a test change.Follow-up to #7100. Part of a series of fixes found reviewing
v2.18.1..main.