Skip to content

DX - 9363 - fix(flags)!: remove --ignore from auth:tokens:remove and -n from config:set:region#2628

Open
cs-raj wants to merge 3 commits into
v2-devfrom
fix/DX-9363
Open

DX - 9363 - fix(flags)!: remove --ignore from auth:tokens:remove and -n from config:set:region#2628
cs-raj wants to merge 3 commits into
v2-devfrom
fix/DX-9363

Conversation

@cs-raj

@cs-raj cs-raj commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Two breaking changes in the cli repo as part of the v2 short-flag normalization effort.

Rule: Keep a short flag only if its meaning is identical across all commands and plugins. Everything else goes long-flag only.


Changes

contentstack-authsrc/commands/auth/tokens/remove.ts

Removed the --ignore flag entirely.

--ignore (previously -i) allowed auth:tokens:remove to exit silently when the specified token did not exist — effectively making deletion idempotent. This was the only command in the entire codebase with this pattern.

Removed in v2 as a deliberate breaking change:

  • The flag had no cross-plugin equivalent, making -i a command-specific short flag with no consistent meaning.
  • Silent no-op deletion is unexpected behaviour for a destructive command.
  • No tests reference the flag. No other package references it (verified by grep).

Before:

$ csdx auth:tokens:remove -a mytoken --ignore   # silent success even if token missing

After:

$ csdx auth:tokens:remove -a mytoken            # errors if token not found

Static flags after change: only alias: flags.string({ char: 'a', ... }).


contentstack-configsrc/commands/config/set/region.ts

Removed -n short flag from --name.

-n is the universal short flag for --stack-name across bootstrap, clone, seed, and export-to-csv. In config:set:region, --name means the region name — a completely different semantic. Keeping -n here would make the same short flag mean two different things depending on which command the user runs.

The long flag --name is unchanged — no behavioral regression.


Testing

  • No tests reference --ignore, -i, or -n in these two commands. Verified by grep.
  • Long flag --name in config:set:region is unchanged.
  • auth:tokens:remove run logic simplified: --ignore guard removed, if (token || ignore)if (token).

Files Changed

packages/contentstack-auth/src/commands/auth/tokens/remove.ts
packages/contentstack-config/src/commands/config/set/region.ts

@cs-raj cs-raj requested a review from a team as a code owner July 1, 2026 11:19
@cs-raj cs-raj requested review from Copilot and harshitha-cstk and removed request for a team and harshitha-cstk July 1, 2026 11:19
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 47 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 47
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the v2 short-flag normalization effort by removing command-specific short flags (and one long flag entirely) that have inconsistent semantics across the CLI monorepo.

Changes:

  • Removed the --ignore (previously -i) flag from auth:tokens:remove, making “missing token” no longer silently succeed.
  • Removed the -n short flag from config:set:region --name to avoid conflicting meaning with the universal -n used for stack name elsewhere.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/contentstack-auth/src/commands/auth/tokens/remove.ts Removes the --ignore/-i flag and simplifies the token-removal decision logic.
packages/contentstack-config/src/commands/config/set/region.ts Removes the -n short flag from --name to align with cross-command short-flag semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to 35
if (token) {
log.debug('Token found.', {...this.contextDetails, hasToken: !!token });
configHandler.delete(`tokens.${alias}`);
log.debug('Token removed from configuration.', {...this.contextDetails, alias });
return cliux.success(`CLI_AUTH_TOKENS_REMOVE_SUCCESS`);
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 47 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 47
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants