Uh oh!
There was an error while loading. Please reload this page.
ci: goimports -local gate + Dependabot config (gomod weekly, actions monthly) - #304
Conversation
LukasWodka
commented
Jul 14, 2026
👋 Heads-up — Code review queue is at 42 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka
commented
Jul 14, 2026
@BugBot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 876f1bc. Configure here.
LukasWodka
commented
Jul 14, 2026
@BugBot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 876f1bc. Configure here.
saadqbal
left a comment
There was a problem hiding this comment.
👍 Solid — goimports gate logic is correct, make fmt actually runs goimports -local -w so the remediation hint is accurate, and the version pin (v0.48.0) matches between Makefile and build.yml. Dependabot grouping (k8s / golang-x lockstep) is the right call. All green. (Stacked on #302 — land that first.)
saadqbal
commented
Jul 14, 2026
88626ef to
7fe0519Compare…monthly) goimports -local github.com/tracebloc/cli now blocks in both loops: build.yml's lint job (pinned goimports@v0.48.0, same x/tools version as the deadcode pin) and the Makefile's fmt-check target, with make fmt extended to auto-fix. .golangci.yml already declared this grouping via local-prefixes but nothing enforced it — 4 files had drifted (data.go, data_test.go, ingestion_run_test.go, resources_set_test.go), fixed here with import-grouping-only diffs. .github/dependabot.yml extends the org's backend-only Dependabot pilot: gomod weekly (k8s.io/* + sigs.k8s.io/* grouped, golang.org/x/* grouped), github-actions monthly. Unlike backend's security-only config, the CLI takes real version updates — customers install this binary, so staying current is security posture (see #276). Org-wide rollout decision flagged to Asad on the PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Regroups imports into the layout goimports -local github.com/tracebloc/cli emits (stdlib / third-party / tracebloc-local). gofmt and goimports only sort within existing blank-line groups, so the manual groups passed fmt-check as-is but were not the canonical single-block output; Bugbot and our precheck both flagged the divergence. Verified idempotent under the pinned goimports v0.48.0 and green on make fmt-check + go build ./... Rebased onto ci/279 (post-#303 data.go split): data.go's import block is already canonical from the #303 split, so its canonicalization here is a no-op and dropped — this commit now regroups data_test.go only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7825106 to
6f34128CompareUh oh!
There was an error while loading. Please reload this page.
…monthly) (#304) * ci: goimports -local gate + Dependabot config (gomod weekly, actions monthly) goimports -local github.com/tracebloc/cli now blocks in both loops: build.yml's lint job (pinned goimports@v0.48.0, same x/tools version as the deadcode pin) and the Makefile's fmt-check target, with make fmt extended to auto-fix. .golangci.yml already declared this grouping via local-prefixes but nothing enforced it — 4 files had drifted (data.go, data_test.go, ingestion_run_test.go, resources_set_test.go), fixed here with import-grouping-only diffs. .github/dependabot.yml extends the org's backend-only Dependabot pilot: gomod weekly (k8s.io/* + sigs.k8s.io/* grouped, golang.org/x/* grouped), github-actions monthly. Unlike backend's security-only config, the CLI takes real version updates — customers install this binary, so staying current is security posture (see #276). Org-wide rollout decision flagged to Asad on the PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: canonicalize import grouping in data_test.go for the goimports gate Regroups imports into the layout goimports -local github.com/tracebloc/cli emits (stdlib / third-party / tracebloc-local). gofmt and goimports only sort within existing blank-line groups, so the manual groups passed fmt-check as-is but were not the canonical single-block output; Bugbot and our precheck both flagged the divergence. Verified idempotent under the pinned goimports v0.48.0 and green on make fmt-check + go build ./... Rebased onto ci/279 (post-#303 data.go split): data.go's import block is already canonical from the #303 split, so its canonicalization here is a no-op and dropped — this commit now regroups data_test.go only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…monthly) (#304) * ci: goimports -local gate + Dependabot config (gomod weekly, actions monthly) goimports -local github.com/tracebloc/cli now blocks in both loops: build.yml's lint job (pinned goimports@v0.48.0, same x/tools version as the deadcode pin) and the Makefile's fmt-check target, with make fmt extended to auto-fix. .golangci.yml already declared this grouping via local-prefixes but nothing enforced it — 4 files had drifted (data.go, data_test.go, ingestion_run_test.go, resources_set_test.go), fixed here with import-grouping-only diffs. .github/dependabot.yml extends the org's backend-only Dependabot pilot: gomod weekly (k8s.io/* + sigs.k8s.io/* grouped, golang.org/x/* grouped), github-actions monthly. Unlike backend's security-only config, the CLI takes real version updates — customers install this binary, so staying current is security posture (see #276). Org-wide rollout decision flagged to Asad on the PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: canonicalize import grouping in data_test.go for the goimports gate Regroups imports into the layout goimports -local github.com/tracebloc/cli emits (stdlib / third-party / tracebloc-local). gofmt and goimports only sort within existing blank-line groups, so the manual groups passed fmt-check as-is but were not the canonical single-block output; Bugbot and our precheck both flagged the divergence. Verified idempotent under the pinned goimports v0.48.0 and green on make fmt-check + go build ./... Rebased onto ci/279 (post-#303 data.go split): data.go's import block is already canonical from the #303 split, so its canonicalization here is a no-op and dropped — this commit now regroups data_test.go only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…findings (#302) * ci: re-enable staticcheck (pinned standalone) + fix the 5 non-ST1005 findings Pinned staticcheck@2025.1.1 joins the standalone lint set in both the Makefile lint target and build.yml's lint job (-checks all,-ST1005), mirroring the errcheck/ineffassign pin pattern. The golangci-lint OOM story that originally disabled it is stale for the standalone binary: a full run is ~12s wall locally. Findings fixed (the full non-ST1005 set): - ST1008: runSet (resources_set_test) returns (string, error), error last - ST1003: CheckMaskIdColumn -> CheckMaskIDColumn (+ call sites/comments) - ST1003: errors_as -> errorsAs, io_eof_or_similar -> ioEOFOrSimilar - ST1020: CoreFloorText doc comment starts with the function name ST1005 stays excluded: it flags ~58 customer-visible error strings that need a wording review, not a mechanical sweep — separate follow-up. Rebased onto develop: union-merged the lint job with develop's govulncheck job (#278), coverage-floor step (#301) and deadcode advisory gate; kept the audit comment #286 added above CheckMaskID*Column. The 'going back to the action' comment in build.yml is KEPT (not deleted) — #6 is still open on develop, so golangci-lint-action stays disabled and that rationale still holds. Detached the four data_ingest_*.go header comments (#303 split) plus exitcodes.go's (#284, which develop merged after this branch was cut) from the package clause so the newly-enabled staticcheck gate is ST1000-clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: goimports -local gate + Dependabot config (gomod weekly, actions monthly) (#304) * ci: goimports -local gate + Dependabot config (gomod weekly, actions monthly) goimports -local github.com/tracebloc/cli now blocks in both loops: build.yml's lint job (pinned goimports@v0.48.0, same x/tools version as the deadcode pin) and the Makefile's fmt-check target, with make fmt extended to auto-fix. .golangci.yml already declared this grouping via local-prefixes but nothing enforced it — 4 files had drifted (data.go, data_test.go, ingestion_run_test.go, resources_set_test.go), fixed here with import-grouping-only diffs. .github/dependabot.yml extends the org's backend-only Dependabot pilot: gomod weekly (k8s.io/* + sigs.k8s.io/* grouped, golang.org/x/* grouped), github-actions monthly. Unlike backend's security-only config, the CLI takes real version updates — customers install this binary, so staying current is security posture (see #276). Org-wide rollout decision flagged to Asad on the PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: canonicalize import grouping in data_test.go for the goimports gate Regroups imports into the layout goimports -local github.com/tracebloc/cli emits (stdlib / third-party / tracebloc-local). gofmt and goimports only sort within existing blank-line groups, so the manual groups passed fmt-check as-is but were not the canonical single-block output; Bugbot and our precheck both flagged the divergence. Verified idempotent under the pinned goimports v0.48.0 and green on make fmt-check + go build ./... Rebased onto ci/279 (post-#303 data.go split): data.go's import block is already canonical from the #303 split, so its canonicalization here is a no-op and dropped — this commit now regroups data_test.go only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * ci: flip deadcode gate to blocking; delete the 3 dead #127 leftovers (#313) * ci: goimports -local gate + Dependabot config (gomod weekly, actions monthly) goimports -local github.com/tracebloc/cli now blocks in both loops: build.yml's lint job (pinned goimports@v0.48.0, same x/tools version as the deadcode pin) and the Makefile's fmt-check target, with make fmt extended to auto-fix. .golangci.yml already declared this grouping via local-prefixes but nothing enforced it — 4 files had drifted (data.go, data_test.go, ingestion_run_test.go, resources_set_test.go), fixed here with import-grouping-only diffs. .github/dependabot.yml extends the org's backend-only Dependabot pilot: gomod weekly (k8s.io/* + sigs.k8s.io/* grouped, golang.org/x/* grouped), github-actions monthly. Unlike backend's security-only config, the CLI takes real version updates — customers install this binary, so staying current is security posture (see #276). Org-wide rollout decision flagged to Asad on the PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: canonicalize import grouping in data_test.go for the goimports gate Regroups imports into the layout goimports -local github.com/tracebloc/cli emits (stdlib / third-party / tracebloc-local). gofmt and goimports only sort within existing blank-line groups, so the manual groups passed fmt-check as-is but were not the canonical single-block output; Bugbot and our precheck both flagged the divergence. Verified idempotent under the pinned goimports v0.48.0 and green on make fmt-check + go build ./... Rebased onto ci/279 (post-#303 data.go split): data.go's import block is already canonical from the #303 split, so its canonicalization here is a no-op and dropped — this commit now regroups data_test.go only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: flip deadcode gate to blocking; delete the 3 dead #127 leftovers The deadcode CI step loses continue-on-error (and the Makefile target its '|| true'): both now run scripts/deadcode-check.sh, which fails on any function unreachable from ./cmd/tracebloc that isn't declared in scripts/deadcode-allowlist.txt. The tool itself always exits 0, so the old advisory step never could have blocked — the gate keys on output. Deleted (verified still dead with the pinned deadcode@v0.48.0): - config.clearAll + its three dedicated tests (TestClearAll, TestClearAll_HomeError, TestClear) — logout uses Save, nothing else ever called it - push.allCategoryIDs — moved verbatim into category_registry_test.go (the registry-pinning tests legitimately iterate every id; the shipped binary shouldn't carry the helper) - submit.isSubmitError — moved into client_test.go as the test-local assertion helper it always was (orphaned 'errors' import dropped) Allowlisted with reasons (the 4 legit findings): Status.String + JobOutcome.String (fmt-reflection Stringers) and ReadLabelValues + inferColumnType (di#349 test-only parity harnesses). Stale allowlist entries warn without failing; line numbers are stripped so edits that shift code don't red the gate. Coverage floors still clear after the test deletions (cli 82.9% >= 68, submit 80.3% >= 72). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…nudge (Bugbot #392) When the installer prefers ~/bin because it is ALREADY on $PATH, the binary is usable immediately and in the user's shells (they configured ~/bin), so the persist step must not rewrite their rc or tell them to open a new terminal — that undercut the B2 goal. Flag that selection (PREFIX_PRESELECTED_ON_PATH) and skip persist for it, same clean no-message outcome as an on-PATH /usr/local/bin. The ~/.local/bin fallback (created mid-session, needs the rc line for non-login shells, #304) is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(install): prefer ~/bin when already on PATH, for same-terminal use (RFC 0001 B2) When /usr/local/bin is not writable, the installer fell straight to ~/.local/bin, which is often not on the current shell PATH — so tracebloc was not resolvable until a new terminal or an rc reload. Now, before that fallback, prefer ~/bin when it already exists on $PATH and is writable: the binary is usable in this shell and every new one with no rc edit at all. Restricted to the conventional ~/bin (never a language-specific dir like ~/.cargo/bin that merely happens to be on PATH); the ~/.local/bin fallback + rc persistence are unchanged. POSIX sh; shellcheck --severity=warning + dash -n clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(install): ~/bin already on PATH => no rc edit, no "new terminal" nudge (Bugbot #392) When the installer prefers ~/bin because it is ALREADY on $PATH, the binary is usable immediately and in the user's shells (they configured ~/bin), so the persist step must not rewrite their rc or tell them to open a new terminal — that undercut the B2 goal. Flag that selection (PREFIX_PRESELECTED_ON_PATH) and skip persist for it, same clean no-message outcome as an on-PATH /usr/local/bin. The ~/.local/bin fallback (created mid-session, needs the rc line for non-login shells, #304) is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(install): ~/bin still persists to rc (session-only PATH), but message says "ready now" (Bugbot #392 r2) My earlier skip-persist for ~/bin broke a SESSION-ONLY $PATH entry (direnv, a one-off export): those are not in the rc, so new terminals lost tracebloc with no guidance. Revert to always persisting a $HOME prefix (idempotent — a no-op when the rc already has it), so new terminals are covered. To still honour B2 (do not nag "open a new terminal" for a dir usable NOW), the message branches on whether $PREFIX is on the current $PATH: "ready to use now" (+ note the rc was updated for new terminals) instead of "open a new terminal". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(install): guard HOME=/ for ~/bin, and say ready-now on rc-write failure too (Bugbot #392 r3) 1) "${HOME%/}/bin" collapses to /bin when HOME is "/" or empty, so a root process could drop the CLI into /bin — require a real, non-root $HOME before preferring ~/bin. 2) The on_path "ready now" acknowledgement was applied to the added/present messages but not the rc-write-failure branch; a ~/bin (usable now) whose rc could not be written still nagged "open a new terminal". Add it there too. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * install.sh: tolerate trailing-slash PATH entries when detecting ~/bin The PATH membership checks matched only ":$dir:" and missed a trailing-slash entry like "$HOME/bin/". A user with "~/bin/" on PATH would be wrongly classified as not-on-PATH: the installer would skip the usable ~/bin prefix and fall back to ~/.local/bin, and would nag "open a new terminal" for a dir that is in fact already on PATH (Bugbot #392). Add a "|*":$dir/:"*" alternative to all three checks (home_bin detection, persist decision, on_path message). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

Summary
WS-A.3 of epic tracebloc/backend#1106, two parts:
goimports -local github.com/tracebloc/clinow blocks in both loops: build.yml's lint job (pinnedgoimports@v0.48.0— same x/tools version as the deadcode pin) and the Makefile'sfmt-checktarget.make fmtis extended to auto-fix..golangci.ymlalready declared this grouping (local-prefixes) but nothing enforced it since the action was disabled. Rangoimports -lto verify the ticket: exactly 4 drifted files (internal/cli/data.go,data_test.go,ingestion_run_test.go,resources_set_test.go) — fixed here, import-grouping-only diffs, no code change..github/dependabot.yml:gomodweekly withk8s.io/*+sigs.k8s.io/*grouped andgolang.org/x/*grouped (the k8s constellation only upgrades cleanly in lockstep — one PR each, not a dozen singletons);github-actionsmonthly. Labels mirror the backend pilot (work-type:tech-debtexists on this repo;dependenciesis Dependabot's built-in default).Org decision flag — @saadqbal
This extends the backend-only Dependabot pilot to a second repo, and deliberately diverges from it: backend runs security-only updates (
open-pull-requests-limit: 0), while this config takes real version updates — the CLI ships as a customer-installed binary, so staying current on k8s.io/* and x/* is security posture, not just hygiene (#276 was six reachable vulns riding a stale x/net + toolchain). If you'd rather keep the pilot uniform (security-only everywhere) until the org-wide rollout decision, say so and I'll flip this config to match. Also: this effectively front-runs the "roll out to the other 16 repos after a week of acceptable noise" checkpoint for one repo.Stacking note
Stacked on #302 (staticcheck, WS-A.2) — merge #302 first; this PR then shows only its own diff. Shared-file edits (build.yml lint job, Makefile) are surgical — expected trivial rebase vs sibling WS-A PRs touching the same files, merge order flexible.
Test plan (ran locally on this branch)
goimports -local github.com/tracebloc/cli -l .— 0 files after fix (was the 4 above)make fmt-check(gofmt -s + new goimports gate) — greengo build ./...andgo test -race ./internal/cli/...— greenFixes#280
🤖 Generated with Claude Code
Note
Low Risk
Tooling and dependency-automation only; test diffs are import formatting with no logic changes.
Overview
Adds Dependabot (
.github/dependabot.yml): weekly grouped Go module updates (k8s.io/*/sigs.k8s.io/*andgolang.org/x/*) and monthly GitHub Actions pins, withwork-type:tech-debtanddependencieslabels.Enforces import grouping that matches
.golangci.ymllocal-prefixes:goimports -local github.com/tracebloc/cliruns in CI (build.ymllint job, pinnedv0.48.0) and locally viamake fmt/make fmt-check, alongside existinggofmt -s.GOIMPORTS_VERSIONis added to the Makefile in lockstep with CI.Four CLI test files are reformatted import-order only (stdlib → third-party →
github.com/tracebloc/cli/...); no behavior changes.Reviewed by Cursor Bugbot for commit 6f34128. Bugbot is set up for automated code reviews on this repo. Configure here.