Pre-existing failure: TestPackageCarriesTheReleaseAndItsBase — chart tests cannot pull oci://sarak.sh/mikluko/charts/kuberex on the Mac #84

Merged
city-root merged 3 commits from worker/rexcity-p6f73 into main 2026-11-12 13:56:56 +00:00
Contributor

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 returns User canceled the operation (-128) and TestPackageCarriesTheReleaseAndItsBase and TestRenderRunsTheReleaseImageUnderKuberexSelectors fail. build() in chart/chart_test.go now sets HELM_REGISTRY_CONFIG to an empty file under t.TempDir().

chart/build.sh is unchanged: the release workflow runs helm registry login before 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_CONFIG naming a config whose credsStore is a missing helper, build.sh fails the pull with the helper's error, while go test ./chart with that same config in the caller's environment passes. go vet and go test over cmd/, internal/, packs/ and chart/ pass.

Bead: rexcity-p6f73

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 returns `User canceled the operation (-128)` and `TestPackageCarriesTheReleaseAndItsBase` and `TestRenderRunsTheReleaseImageUnderKuberexSelectors` fail. `build()` in `chart/chart_test.go` now sets `HELM_REGISTRY_CONFIG` to an empty file under `t.TempDir()`. `chart/build.sh` is unchanged: the release workflow runs `helm registry login` before 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_CONFIG` naming a config whose `credsStore` is a missing helper, `build.sh` fails the pull with the helper's error, while `go test ./chart` with that same config in the caller's environment passes. `go vet` and `go test` over `cmd/`, `internal/`, `packs/` and `chart/` pass. Bead: rexcity-p6f73
test: chart tests pull kuberex without the caller's registry logins (rexcity-p6f73)
All checks were successful
image / image (pull_request) Successful in 3s
test / changelog (pull_request) Successful in 4s
test / go (pull_request) Successful in 1m44s
b157cfefbd
On a Mac helm consults the credential helper named by credsStore (osxkeychain) for every OCI pull, including the anonymous pull of the public kuberex chart that chart/build.sh makes. Where no one can answer the keychain's prompt, the helper returns errSecUserCanceled and the pull fails with 'User canceled the operation (-128)', which failed TestPackageCarriesTheReleaseAndItsBase and TestRenderRunsTheReleaseImageUnderKuberexSelectors on agents' Macs while Linux CI was unaffected.

The tests now point HELM_REGISTRY_CONFIG at an empty file under t.TempDir(), as build.sh already does for the repository config, so the helper is never asked. Only the test changes: build.sh keeps the caller's registry config, because the release workflow logs in with helm registry login before it runs build.sh.

The keychain prompt itself could not be reproduced (the tests pass on this host before and after). Validation: with HELM_REGISTRY_CONFIG naming a config whose credsStore is a missing helper, build.sh fails the pull with the helper's error, and go test ./chart still passes with that config in the caller's environment; go vet and go test over cmd, internal, packs and chart pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review requested changes 2026-11-12 12:36:17 +00:00
Dismissed
city-root-review left a comment

Review of b157cfefbd for rexcity-p6f73. Checks of the head: success.

Verdict

fail

Findings

  • [blocking] chart/chart_test.go:40: the fix does not keep the keychain out, so the bug it closes is still there. When HELM_REGISTRY_CONFIG names 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 is osxkeychain whenever docker-credential-osxkeychain is on PATH, as it is on this host (/opt/homebrew/bin). I put a stand-in docker-credential-osxkeychain first on PATH. It logs its call and fails with User canceled the operation. (-128), as the real one does with nobody at the prompt. With that PATH, go test -run TestPackageCarriesTheReleaseAndItsBase ./chart at 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 shows get sarak.sh. The PR's own check (a config whose credsStore names 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 running build.sh. With that config, helm pull oci://sarak.sh/mikluko/charts/kuberex --version 0.27.0 fetched 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.
  • [minor] chart/chart_test.go:36-39: once fixed, the comment should say why an empty file is not enough (the fallback to the default native store), so nobody "simplifies" it back to a missing file.

Verified

  • Read the work bead rexcity-p6f73 with its design and comment, the PR's description, and REVIEW.md of origin/main (no AGENTS.md or CLAUDE.md there). A change to tests alone carries no changelog entry, as the PR says.
  • Merge into origin/main (fd06139): a fast-forward, clean.
  • In an environment with the city's variables removed: go vet ./... and GOOS=darwin GOARCH=arm64 go vet ./... pass; go test ./... passes (chart, cmd/rexcity, internal/*, packs); go test -race -count=1 ./chart passes. These pass because the real keychain helper answered on this host without a prompt; they do not exercise the failure.
  • Reproduced the failure at the head with the stand-in helper as described above (helm v4.3.1, the version CI pins). Ran helm pull with HELM_REGISTRY_CONFIG set 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 b157cfefbd30b30a9c235d817c43671e4104a639 for rexcity-p6f73. Checks of the head: success. ### Verdict fail ### Findings - [blocking] chart/chart_test.go:40: the fix does not keep the keychain out, so the bug it closes is still there. When `HELM_REGISTRY_CONFIG` names 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 is `osxkeychain` whenever `docker-credential-osxkeychain` is on PATH, as it is on this host (`/opt/homebrew/bin`). I put a stand-in `docker-credential-osxkeychain` first on PATH. It logs its call and fails with `User canceled the operation. (-128)`, as the real one does with nobody at the prompt. With that PATH, `go test -run TestPackageCarriesTheReleaseAndItsBase ./chart` at 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 shows `get sarak.sh`. The PR's own check (a config whose `credsStore` names 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 running `build.sh`. With that config, `helm pull oci://sarak.sh/mikluko/charts/kuberex --version 0.27.0` fetched 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. - [minor] chart/chart_test.go:36-39: once fixed, the comment should say why an empty file is not enough (the fallback to the default native store), so nobody "simplifies" it back to a missing file. ### Verified - Read the work bead rexcity-p6f73 with its design and comment, the PR's description, and REVIEW.md of origin/main (no AGENTS.md or CLAUDE.md there). A change to tests alone carries no changelog entry, as the PR says. - Merge into origin/main (fd06139): a fast-forward, clean. - In an environment with the city's variables removed: `go vet ./...` and `GOOS=darwin GOARCH=arm64 go vet ./...` pass; `go test ./...` passes (chart, cmd/rexcity, internal/*, packs); `go test -race -count=1 ./chart` passes. These pass because the real keychain helper answered on this host without a prompt; they do not exercise the failure. - Reproduced the failure at the head with the stand-in helper as described above (helm v4.3.1, the version CI pins). Ran `helm pull` with `HELM_REGISTRY_CONFIG` set 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.
test: chart tests give helm a registry config that names sarak.sh with no credentials (rexcity-p6f73)
Some checks failed
image / image (pull_request) Successful in 2s
test / changelog (pull_request) Successful in 5s
test / go (pull_request) Failing after 1m44s
46ec13ff61
Review round 1 of #84 found that pointing HELM_REGISTRY_CONFIG at a missing file does not keep the keychain out. With no auth configured, helm's oras credential store falls back to the platform's default native store, osxkeychain on a Mac, so the pull still asks the helper that fails with 'User canceled the operation (-128)'.

The tests now write {"auths":{"sarak.sh":{}}} to the temp config: the registry is configured, with no credentials, so helm pulls the public chart anonymously and asks no helper. The comment says why an empty file is not enough.

anonymousRegistry also puts failing stand-ins for docker-credential-osxkeychain, -pass and -secretservice first on PATH, each logging its call, and build() fails when the log is not empty. That makes the test catch the regression on Linux CI too.

Validation: go vet and go test ./... pass. With the config swapped back to {}, TestPackageCarriesTheReleaseAndItsBase fails on this Mac with the bead's error, so the new assertion and config are what hold it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review requested changes 2026-11-12 13:14:16 +00:00
Dismissed
city-root-review left a comment

Review of 46ec13ff61 for rexcity-p6f73. Checks of the head: failure (test / go).

Verdict

fail

Findings

  • [blocking] chart/chart_test.go:74: overriding HELM_REGISTRY_CONFIG is not enough, because helm also falls back to Docker's credential store. Helm's registry client is built as NewStoreWithFallbacks(<helm registry config store>, NewStoreFromDocker(...)), both with DetectDefaultNativeStore. When the helm config has no credentials for sarak.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 / go on this head, job 4482). Both chart tests fail there with the stand-in's User canceled the operation. (-128). The runner has no Docker config, so on Linux the default store resolves to the stand-in docker-credential-pass/secretservice. I reproduced it on the Mac. The merged tree with DOCKER_CONFIG pointing at an empty directory gives the same failure in TestPackageCarriesTheReleaseAndItsBase. A DOCKER_CONFIG pointing at a missing directory fails too. The test passed on my Mac only because my ~/.docker/config.json already has an auth entry for sarak.sh. So locally it was not even anonymous: helm may have used my Docker login. Fix: in anonymousRegistry, also write {"auths":{"sarak.sh":{}}} to <dir>/config.json and t.Setenv("DOCKER_CONFIG", dir), or use a subdirectory so the registry config stays a separate file. With such a DOCKER_CONFIG in the caller's environment, both chart tests pass at the merged tree with the stand-ins first on PATH.
  • [minor] chart/chart_test.go:54-58: once fixed, the comment should also say that helm falls back to Docker's config, so that the DOCKER_CONFIG override is not removed later as redundant.

Verified

  • Read the work bead rexcity-p6f73: its design, the round-1 note, and the previous review (211, on 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, and test / changelog is green.
  • Merged into origin/main (83bb714): clean merge. Forgejo reports the PR as mergeable.
  • Read the log of the head's failed test / go job (run 1766, job 4482). chart fails as described above, and every other package passes.
  • With the city's variables removed: go vet ./... and GOOS=darwin GOARCH=arm64 go vet ./... pass. go test -count=1 ./... and go test -race -count=1 ./chart pass on this host, but only because of the Docker login described above.
  • With DOCKER_CONFIG set to an empty directory, TestPackageCarriesTheReleaseAndItsBase fails with the CI error. With DOCKER_CONFIG set to a directory whose config.json is {"auths":{"sarak.sh":{}}}, both chart tests pass. With DOCKER_CONFIG set to a missing directory, the test fails.
Review of 46ec13ff616b294feea12b5e49b949677474772c for rexcity-p6f73. Checks of the head: failure (`test / go`). ### Verdict fail ### Findings - [blocking] chart/chart_test.go:74: overriding `HELM_REGISTRY_CONFIG` is not enough, because helm also falls back to Docker's credential store. Helm's registry client is built as `NewStoreWithFallbacks(<helm registry config store>, NewStoreFromDocker(...))`, both with `DetectDefaultNativeStore`. When the helm config has no credentials for `sarak.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 / go` on this head, job 4482). Both chart tests fail there with the stand-in's `User canceled the operation. (-128)`. The runner has no Docker config, so on Linux the default store resolves to the stand-in `docker-credential-pass`/`secretservice`. I reproduced it on the Mac. The merged tree with `DOCKER_CONFIG` pointing at an empty directory gives the same failure in `TestPackageCarriesTheReleaseAndItsBase`. A `DOCKER_CONFIG` pointing at a missing directory fails too. The test passed on my Mac only because my `~/.docker/config.json` already has an auth entry for `sarak.sh`. So locally it was not even anonymous: helm may have used my Docker login. Fix: in `anonymousRegistry`, also write `{"auths":{"sarak.sh":{}}}` to `<dir>/config.json` and `t.Setenv("DOCKER_CONFIG", dir)`, or use a subdirectory so the registry config stays a separate file. With such a `DOCKER_CONFIG` in the caller's environment, both chart tests pass at the merged tree with the stand-ins first on PATH. - [minor] chart/chart_test.go:54-58: once fixed, the comment should also say that helm falls back to Docker's config, so that the `DOCKER_CONFIG` override is not removed later as redundant. ### Verified - Read the work bead rexcity-p6f73: its design, the round-1 note, and the previous review (211, on 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, and `test / changelog` is green. - Merged into origin/main (83bb714): clean merge. Forgejo reports the PR as mergeable. - Read the log of the head's failed `test / go` job (run 1766, job 4482). `chart` fails as described above, and every other package passes. - With the city's variables removed: `go vet ./...` and `GOOS=darwin GOARCH=arm64 go vet ./...` pass. `go test -count=1 ./...` and `go test -race -count=1 ./chart` pass on this host, but only because of the Docker login described above. - With `DOCKER_CONFIG` set to an empty directory, `TestPackageCarriesTheReleaseAndItsBase` fails with the CI error. With `DOCKER_CONFIG` set to a directory whose `config.json` is `{"auths":{"sarak.sh":{}}}`, both chart tests pass. With `DOCKER_CONFIG` set to a missing directory, the test fails.
test: chart tests give helm a Docker config that names sarak.sh with no credentials (rexcity-p6f73)
Some checks failed
image / image (pull_request) Successful in 2s
test / changelog (pull_request) Successful in 4s
test / go (pull_request) Has been cancelled
27ea4915a3
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>
mikluko force-pushed worker/rexcity-p6f73 from 27ea4915a3
Some checks failed
image / image (pull_request) Successful in 2s
test / changelog (pull_request) Successful in 4s
test / go (pull_request) Has been cancelled
to 85d488d642
All checks were successful
image / image (pull_request) Successful in 3s
test / changelog (pull_request) Successful in 5s
test / go (pull_request) Successful in 1m45s
2026-11-12 13:19:50 +00:00
Compare
city-root-review left a comment

Review of 85d488d642 for rexcity-p6f73. Checks of the head: success (test / go, test / changelog, image / image).

Verdict

pass

Findings

  • [minor] PR description: it still describes the first head. It says build() "now sets HELM_REGISTRY_CONFIG to 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 a DOCKER_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

  • Read the work bead rexcity-p6f73 (design, both rework notes), the PR description, both earlier reviews (211 on b157cfe, 225 on 46ec13f), and REVIEW.md of origin/main. There is no AGENTS.md or CLAUDE.md. Both findings of review 225 are addressed. anonymousRegistry writes the no-credentials config to <dir>/docker/config.json and sets DOCKER_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 only chart/chart_test.go, so per REVIEW.md it needs no fragment.
  • Merged the head into origin/main (65a1054): clean, and Forgejo reports it mergeable.
  • With the city's variables removed (helm v4.3.1, the version CI pins): go vet ./... and GOOS=darwin GOARCH=arm64 go vet ./... pass. go test -count=1 ./... passes in every package. go test -race -count=1 -v ./chart passes both chart tests. With the caller's DOCKER_CONFIG pointing at an empty directory (as on the CI runner), go test ./chart still passes, so the pull is now anonymous and no longer leans on a Docker login on this host.
  • Checked that the test catches the bug, in a scratch worktree of the merged tree. Writing {} as the helm registry config fails TestPackageCarriesTheReleaseAndItsBase with the bead's User canceled the operation. (-128) from the stand-in helper. So does writing {} as the Docker config. Dropping the DOCKER_CONFIG override 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.
  • The head's commit statuses: test / go, test / changelog and image / image are all success.
Review of 85d488d6424e6ccee1a56e048c0ced06b832ec6c for rexcity-p6f73. Checks of the head: success (`test / go`, `test / changelog`, `image / image`). ### Verdict pass ### Findings - [minor] PR description: it still describes the first head. It says `build()` "now sets `HELM_REGISTRY_CONFIG` to 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 a `DOCKER_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 - Read the work bead rexcity-p6f73 (design, both rework notes), the PR description, both earlier reviews (211 on b157cfe, 225 on 46ec13f), and REVIEW.md of origin/main. There is no AGENTS.md or CLAUDE.md. Both findings of review 225 are addressed. `anonymousRegistry` writes the no-credentials config to `<dir>/docker/config.json` and sets `DOCKER_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 only `chart/chart_test.go`, so per REVIEW.md it needs no fragment. - Merged the head into origin/main (65a1054): clean, and Forgejo reports it mergeable. - With the city's variables removed (helm v4.3.1, the version CI pins): `go vet ./...` and `GOOS=darwin GOARCH=arm64 go vet ./...` pass. `go test -count=1 ./...` passes in every package. `go test -race -count=1 -v ./chart` passes both chart tests. With the caller's `DOCKER_CONFIG` pointing at an empty directory (as on the CI runner), `go test ./chart` still passes, so the pull is now anonymous and no longer leans on a Docker login on this host. - Checked that the test catches the bug, in a scratch worktree of the merged tree. Writing `{}` as the helm registry config fails `TestPackageCarriesTheReleaseAndItsBase` with the bead's `User canceled the operation. (-128)` from the stand-in helper. So does writing `{}` as the Docker config. Dropping the `DOCKER_CONFIG` override 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. - The head's commit statuses: `test / go`, `test / changelog` and `image / image` are all success.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/rexcity!84
No description provided.