fix(DX-10057): remove dead --branch flag from auth:tokens:add - #2676
Open
cs-raj wants to merge 1 commit into
Open
fix(DX-10057): remove dead --branch flag from auth:tokens:add#2676cs-raj wants to merge 1 commit into
cs-raj wants to merge 1 commit into
Conversation
The --branch flag was defined in the flags schema but never read in
run() and never persisted in configHandler.set(). Token objects were
always saved as { token, apiKey, type } or { token, apiKey, environment,
type } — branch was never included. The feature was planned but never
completed.
Removed:
- --branch flag definition in auth/tokens/add.ts
- Two it.skip tests that only existed to test branch-on-token behaviour
- --branch args from the one active test that passed them (test was
asserting on errorStub which was never called, making it vacuous)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Summary
--branchhidden flag fromauth:tokens:add— it was defined in the flag schema but never read inrun()and never persisted inconfigHandler.set(). Token objects were always saved as{ token, apiKey, type }or{ token, apiKey, environment, type }—branchwas never included. The feature was planned but never completed.it.skiptests that only existed to cover branch-on-token behaviour.--branchargs from the one active test that was passing them vacuously (assert was inside a catch block that never fired, since oclif accepted the flag without error).Root cause
The
--branchflag appears to be an early design for branch-scoped token storage that was never finished. There are zero reads ofaddTokenFlags.branchanywhere in the command, and no branch field in anyconfigHandler.setcall.Test plan
npx mocha --require ts-node/register --require tsconfig-paths/register test/unit/commands/tokens-add.test.tsinpackages/contentstack-auth— 5 passing, 2 pre-existing failures (unrelatednock.cleanAllissue present onv2-devbefore this change)csdx auth:tokens:add --branch mainnow errors withUnexpected argument: --branchRelated
Part of DX-10057 deprecated flags/aliases cleanup (cli-plugins PR: contentstack/cli-plugins#325)
🤖 Generated with Claude Code