Pre-existing failure: TestPackageCarriesTheReleaseAndItsBase — chart tests cannot pull oci://sarak.sh/mikluko/charts/kuberex on the Mac #84
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/rexcity!84
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/rexcity-p6f73"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The chart tests no longer depend on the caller's helm registry logins. On a Mac helm asks the credential helper in
credsStore(osxkeychain) for every OCI pull, even the anonymous pull of the public kuberex chart; with no one at the keychain prompt the helper returnsUser canceled the operation (-128)andTestPackageCarriesTheReleaseAndItsBaseandTestRenderRunsTheReleaseImageUnderKuberexSelectorsfail.build()inchart/chart_test.gonow setsHELM_REGISTRY_CONFIGto an empty file undert.TempDir().chart/build.shis unchanged: the release workflow runshelm registry loginbefore it, so it keeps the caller's registry config. No changelog entry: a change to tests alone carries none (REVIEW.md).Verification: I could not reproduce the keychain prompt itself; the tests pass on this host before and after. I confirmed the mechanism instead: with
HELM_REGISTRY_CONFIGnaming a config whosecredsStoreis a missing helper,build.shfails the pull with the helper's error, whilego test ./chartwith that same config in the caller's environment passes.go vetandgo testovercmd/,internal/,packs/andchart/pass.Bead: rexcity-p6f73
Review of
b157cfefbdfor rexcity-p6f73. Checks of the head: success.Verdict
fail
Findings
HELM_REGISTRY_CONFIGnames a file that does not exist (or holds{}or{"auths":{}}), helm's oras credential store finds no auth configured and falls back to the platform's default native store. On a Mac that isosxkeychainwheneverdocker-credential-osxkeychainis on PATH, as it is on this host (/opt/homebrew/bin). I put a stand-indocker-credential-osxkeychainfirst on PATH. It logs its call and fails withUser canceled the operation. (-128), as the real one does with nobody at the prompt. With that PATH,go test -run TestPackageCarriesTheReleaseAndItsBase ./chartat this head fails with the bead's error (could not download oci://sarak.sh/mikluko/charts/kuberex ... exit status 1), and the helper's log showsget sarak.sh. The PR's own check (a config whosecredsStorenames a missing helper, in the caller's environment) could not catch this: overriding that config is all the change does, and the fallback runs either way. Fix: write a registry config that counts as configured but holds no credentials for the registry, for example{"auths":{"sarak.sh":{}}}, to the temp file before runningbuild.sh. With that config,helm pull oci://sarak.sh/mikluko/charts/kuberex --version 0.27.0fetched the chart anonymously and the stand-in helper was never called. A test that puts such a failing stand-in helper first on PATH would prove the fix on Linux CI as well.Verified
fd06139): a fast-forward, clean.go vet ./...andGOOS=darwin GOARCH=arm64 go vet ./...pass;go test ./...passes (chart, cmd/rexcity, internal/*, packs);go test -race -count=1 ./chartpasses. These pass because the real keychain helper answered on this host without a prompt; they do not exercise the failure.helm pullwithHELM_REGISTRY_CONFIGset to a missing file,{},{"auths":{}}and{"auths":{"sarak.sh":{}}}: the first three each called the helper once and failed, and the last called it zero times and fetched the manifest.Review of
46ec13ff61for rexcity-p6f73. Checks of the head: failure (test / go).Verdict
fail
Findings
HELM_REGISTRY_CONFIGis not enough, because helm also falls back to Docker's credential store. Helm's registry client is built asNewStoreWithFallbacks(<helm registry config store>, NewStoreFromDocker(...)), both withDetectDefaultNativeStore. When the helm config has no credentials forsarak.sh, helm asks the Docker store next ($DOCKER_CONFIG/config.json, else~/.docker/config.json). When that config is missing or has no auth configured, helm uses the platform's default native helper, which is now the test's own failing stand-in. Run 1766 shows this (test / goon this head, job 4482). Both chart tests fail there with the stand-in'sUser canceled the operation. (-128). The runner has no Docker config, so on Linux the default store resolves to the stand-indocker-credential-pass/secretservice. I reproduced it on the Mac. The merged tree withDOCKER_CONFIGpointing at an empty directory gives the same failure inTestPackageCarriesTheReleaseAndItsBase. ADOCKER_CONFIGpointing at a missing directory fails too. The test passed on my Mac only because my~/.docker/config.jsonalready has an auth entry forsarak.sh. So locally it was not even anonymous: helm may have used my Docker login. Fix: inanonymousRegistry, also write{"auths":{"sarak.sh":{}}}to<dir>/config.jsonandt.Setenv("DOCKER_CONFIG", dir), or use a subdirectory so the registry config stays a separate file. With such aDOCKER_CONFIGin the caller's environment, both chart tests pass at the merged tree with the stand-ins first on PATH.DOCKER_CONFIGoverride is not removed later as redundant.Verified
b157cfe). The new head answers its findings: it writes a config that names the registry, adds stand-in helpers that fail like the keychain, asserts that no helper was asked, and comments on why. Also read the PR description and REVIEW.md, README.md of origin/main (there is no AGENTS.md or CLAUDE.md). The change touches only tests, so it needs no changelog fragment, andtest / changelogis green.83bb714): clean merge. Forgejo reports the PR as mergeable.test / gojob (run 1766, job 4482).chartfails as described above, and every other package passes.go vet ./...andGOOS=darwin GOARCH=arm64 go vet ./...pass.go test -count=1 ./...andgo test -race -count=1 ./chartpass on this host, but only because of the Docker login described above.DOCKER_CONFIGset to an empty directory,TestPackageCarriesTheReleaseAndItsBasefails with the CI error. WithDOCKER_CONFIGset to a directory whoseconfig.jsonis{"auths":{"sarak.sh":{}}}, both chart tests pass. WithDOCKER_CONFIGset to a missing directory, the test fails.Review 225 of the pull request: overriding HELM_REGISTRY_CONFIG is not enough, because helm's registry client falls back to Docker's credential store (DOCKER_CONFIG/config.json, else ~/.docker/config.json) when its own config has no credentials for the registry. With no Docker config either, it uses the platform's default native helper, which in the test is the stand-in that fails as the keychain does. That is why test / go failed on the runner, and why the test passed on a Mac only through the caller's own Docker login for sarak.sh. anonymousRegistry now also writes {"auths":{"sarak.sh":{}}} to a config.json in a directory of its own and sets DOCKER_CONFIG to it. The comment says why both overrides are needed, so neither is removed as redundant (the review's minor finding). Validation: go vet and go test ./... pass; go test ./chart passes with HOME set to an empty directory and CI=1, which has no Docker login, as the runner. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>27ea4915a385d488d642Review of
85d488d642for rexcity-p6f73. Checks of the head: success (test / go,test / changelog,image / image).Verdict
pass
Findings
build()"now setsHELM_REGISTRY_CONFIGto an empty file", and its verification paragraph rests on the check that review 211 showed could not catch the bug. The branch now writes{"auths":{"sarak.sh":{}}}to both a helm registry config and aDOCKER_CONFIG, and puts failing stand-in credential helpers first on PATH. Please update the description before merge so the merged history describes the real fix. Nothing in the code needs to change.Verified
b157cfe, 225 on46ec13f), and REVIEW.md of origin/main. There is no AGENTS.md or CLAUDE.md. Both findings of review 225 are addressed.anonymousRegistrywrites the no-credentials config to<dir>/docker/config.jsonand setsDOCKER_CONFIG, kept apart from the helm registry config, and the comment at chart/chart_test.go:49-70 says why neither override may be dropped or "simplified" back to an empty file. The diff touches onlychart/chart_test.go, so per REVIEW.md it needs no fragment.65a1054): clean, and Forgejo reports it mergeable.go vet ./...andGOOS=darwin GOARCH=arm64 go vet ./...pass.go test -count=1 ./...passes in every package.go test -race -count=1 -v ./chartpasses both chart tests. With the caller'sDOCKER_CONFIGpointing at an empty directory (as on the CI runner),go test ./chartstill passes, so the pull is now anonymous and no longer leans on a Docker login on this host.{}as the helm registry config failsTestPackageCarriesTheReleaseAndItsBasewith the bead'sUser canceled the operation. (-128)from the stand-in helper. So does writing{}as the Docker config. Dropping theDOCKER_CONFIGoverride fails it once the caller's Docker config is empty, as on CI. With every override in place the stand-in helpers are never called, and the helper-log assertion holds.test / go,test / changelogandimage / imageare all success.