fix: jq-free one-client guard (2nd Bugbot finding on #284)#286
Merged
Conversation
…#284) Second Bugbot finding on the develop→main promotion (#284). The one-client-per-machine guard in install_client_helm enumerated client-chart releases with `helm list -A -o json | jq`, falling back — when jq is absent — to reading values for only the minted TB_NAMESPACE. Post-#838 TB_NAMESPACE is the client slug, not the historical fixed `tracebloc` namespace, so on a jq-less host the fallback missed an existing `tracebloc` release and forked a SECOND helm release under the slug — double-booking the host, the exact fork the guard exists to prevent. jq is not a guaranteed prerequisite (preflight never checks or installs it; it is used nowhere else in the installer). Replace the jq path + single-namespace fallback with one jq-free enumeration across ALL namespaces: `helm list -A` + awk on the NAME/NAMESPACE columns, matching client-<ver> in the CHART column — the same jq-free parse _chart_version already uses. Removes the jq dependency and the fallback divergence that caused the bug. - install-client-helm.sh: jq-free `helm list -A | awk` enumeration. - manifest.sha256: regenerated for the changed script (the R8 bootstrap verifies each fetched sub-script against it). - install-client-helm.bats: the 3 guard tests now mock tabular `helm list` output (was JSON for the jq path); new regression test proves the different-namespace reconcile works with jq reported absent (fails on the old fallback, passes here). shellcheck clean; gen-manifest.sh --check passes; bats green (the one pre-existing _extract_yaml '' failure is a local macOS bash 3.2 quirk, green in CI, unrelated). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aptracebloc
approved these changes
Jul 1, 2026
saadqbal
added a commit
that referenced
this pull request
Jul 1, 2026
…sion reorder (#284) Promotes #279 (installer reorder: sign-in + provision before Helm), #281 (R8 verified bootstrap + sign-installer-manifest release job), #285 (stale-bootstrap CLI install fix), #286 (jq-free one-client guard). Brings the R8 install.sh + the sign-installer-manifest job to main ahead of the signed installer release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Resolves the second Cursor Bugbot finding on the client promotion PR (#284,
develop → main) — "Namespace reuse needs jq".The bug
#279's duplicate-release guard (
install_client_helm) enumeratesclient-*releases withhelm list -A -o json | jq. The jq-lesseliffallback only reads values for the mintedTB_NAMESPACE. Post-#838 that's the client slug, not the historical fixedtraceblocnamespace — so on a host without jq, an existing release undertraceblocis missed and a second Helm release forks under the slug, double-booking the host (exactly what the guard exists to prevent). jq is not a guaranteed prerequisite: preflight never checks or installs it, and it's used nowhere else in the installer.Fix
Replace the jq path + single-namespace fallback with one jq-free enumeration across all namespaces —
helm list -A+ awk on the NAME/NAMESPACE columns, matchingclient-<ver>in CHART (the same jq-free parse_chart_versionalready uses). Removes the jq dependency and the fallback divergence that caused the bug.scripts/lib/install-client-helm.sh— jq-freehelm list -A | awkenumeration.scripts/manifest.sha256— regenerated (the R8 bootstrap verifies each fetched sub-script against it).scripts/tests/install-client-helm.bats— the 3 guard tests now mock tabularhelm listoutput (was JSON); new regression test proves the different-namespace reconcile works with jq reported absent (fails on the old fallback, passes here).shellcheck clean;
gen-manifest.sh --checkpasses; bats green (the lone pre-existing_extract_yaml ''failure is a local macOS bash 3.2 quirk, green in CI, unrelated).Lands on
develop; the promotion PR #284 head picks it up on the next sync and Bugbot re-reviews.🤖 Generated with Claude Code
Note
Medium Risk
Changes installer behavior on re-install/upgrade paths where a wrong guard could fork duplicate Helm releases or block legitimate upgrades; scope is limited to enumeration logic in install-client-helm.sh with regression tests.
Overview
Fixes the one-client-per-machine check in
install_client_helmso it always discovers existingclient-*Helm releases across all namespaces without relying on jq.The guard no longer uses
helm list -A -o json | jqor the jq-less fallback that only read values in the mintedTB_NAMESPACE. On hosts without jq, that fallback could miss a release still intraceblocand install a second release under the client slug. Enumeration is nowhelm list -A+ awk on NAME/NAMESPACE for rows whose CHART matchesclient-<ver>(same jq-free style as_chart_version).scripts/manifest.sha256is updated for the changed installer script. Bats guard tests mock tabularhelm listoutput instead of JSON, and a new test asserts same-client / different-namespace reconcile whenhas jqis false.Reviewed by Cursor Bugbot for commit cab5e59. Bugbot is set up for automated code reviews on this repo. Configure here.