fix(data): deprecation notices on renamed aliases + clear no-client message (#879)#229
Open
LukasWodka wants to merge 1 commit into
Open
fix(data): deprecation notices on renamed aliases + clear no-client message (#879)#229LukasWodka wants to merge 1 commit into
LukasWodka wants to merge 1 commit into
Conversation
…essage (#879) Two remaining acceptance items for the RFC-0001 data-verb rename (backend#879); the rename + active-client binding already shipped via cli#128. - Deprecation notices: data's PersistentPreRunE warns once on stderr when a command is invoked via a deprecated alias — push→"data ingest", rm→"data delete", bare dataset→"data". Detection uses cobra's reliable Command.CalledAs() on the executed command (no reflection); the verb notices point at the full canonical form so they nudge the group rename too. The already-migrated `dataset <canonical-verb>` case is intentionally unwarned (documented + pinned in the table test). - Clear no-client message: when the cluster-wide scan finds NO tracebloc client (one-machine-one-client, §7.10 — machine not provisioned), discoverRelease now returns a "run the installer / point at the right cluster with --context" hint instead of the bare namespace error. Still wraps ErrNoParentRelease (exit 4); the scanErr, >1 "pick one", and active-client-elsewhere paths are untouched. Tests: alias-path table test (every alias + canonical + the accepted gap); no-client exit-4 + scan-unavailable + multi-client regression. build/vet/gofmt clean; full suite green. Refs tracebloc/backend#879. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 11, 2026
Open
Open
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.
What
The two remaining acceptance items for the RFC-0001 data-verb rename (backend#879). The rename (
dataset→data,push→ingest,rm→delete+ aliases) and active-client binding already shipped via cli#128 — this closes the gap.1 — Deprecation notices on the renamed aliases
data'sPersistentPreRunEwarns once on stderr when a command is invoked via a deprecated alias:push→ usedata ingest·rm→ usedata delete· baredataset→ usedataDetection reads cobra's exported
Command.CalledAs()on the executed command (no reflection into cobra internals). The verb notices point at the full canonical form, so they nudge the group rename too. The already-migrateddataset <canonical-verb>case (e.g.dataset ingest) is intentionally not warned — cobra doesn't expose an ancestor's invoked-as name publicly, and warning the verb already steers todata <verb>. That accepted gap is documented and pinned in the table test.2 — Clear "no tracebloc client on this machine" message
Under §7.10 (one machine = one client), when the cluster-wide scan finds no tracebloc client (the machine isn't provisioned),
discoverReleasenow returns:instead of the bare
no tracebloc client found in namespace X. It still wrapsErrNoParentRelease(exit 4); thescanErr(RBAC), the>1"pick one", and the active-client-runs-elsewhere paths are untouched.Tests
data_deprecation_test.go— table test over every alias/canonical path + the accepted gap; asserts stderr text + count + no stdout leak.clustertarget_test.go— no-client exit-4 + installer message, scan-unavailable keeps original error, multi-client "pick one" regression.go build ./.../go vet/gofmtclean; full suite green.Refs tracebloc/backend#879.
🤖 Generated with Claude Code
Note
Low Risk
CLI-only UX (stderr deprecation notices and error text); exit codes and
errors.Iscontracts are preserved and covered by new table/regression tests.Overview
Closes #879 with two user-facing changes on the
datacommand surface and cluster discovery.Deprecation warnings for legacy spellings (
dataset,push,rm):data'sPersistentPreRunEprints a one-line notice on stderr when the executed command was invoked via an alias (CalledAs()), steering users todata,data ingest, ordata delete. Canonical invocations stay silent;dataset <canonical-verb>is an intentional no-warning gap, pinned in tests.Clearer “no client” error when a cluster-wide scan succeeds but finds zero tracebloc clients:
discoverReleasenow returns §7.10 guidance (run the installer or fix--context/--namespace) instead of a bare namespace miss, while still wrappingErrNoParentRelease(exit 4). RBAC/scan failures keep the original per-namespace error; multi-client “pick one” behavior is unchanged.Testability:
resolveClusterTargetroutes kubeconfig load and clientset creation throughloadClusterFn/newClientsetFnso discovery and exit-code behavior can be exercised with fakes.Reviewed by Cursor Bugbot for commit 46d62e4. Bugbot is set up for automated code reviews on this repo. Configure here.