Skip to content

fix(flags): normalize short flag consistency across cli-cm-regex-validate, tsgen, migration, and apps-cli#261

Open
cs-raj wants to merge 1 commit into
v2-devfrom
fix/DX-9363
Open

fix(flags): normalize short flag consistency across cli-cm-regex-validate, tsgen, migration, and apps-cli#261
cs-raj wants to merge 1 commit into
v2-devfrom
fix/DX-9363

Conversation

@cs-raj

@cs-raj cs-raj commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Audits and normalizes single-character (-x) short flags across four CLI plugins based on the v2 consistency rule:

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

Universal short flags kept everywhere: -a (--alias), -k (--stack-api-key), -y (--yes).


Changes by Package

contentstack-cli-cm-regex-validatesrc/commands/cm/stacks/validate-regex.ts

Flag Short Removed Long Flag (unchanged)
--contentType -c ✅ kept
--filePath -f ✅ kept
--globalField -g ✅ kept

Examples updated to use long flags.


contentstack-cli-tsgensrc/commands/tsgen.ts + integration tests

Flag Short Removed Long Flag (unchanged)
--output -o ✅ kept
--prefix -p ✅ kept
--doc -d ✅ kept (--no-doc still works)

Examples updated to use long flags.

Integration test file updated — all 8 test cases replaced -o--output; test case 2 replaced -p--prefix. --no-doc was already long-form.


contentstack-migrationsrc/commands/cm/stacks/migration.ts

Removed char: 'k' from the deprecated --api-key flag only. The canonical --stack-api-key retains -k.

Both flags previously shared -k, creating ambiguity. Since --api-key is hidden and pending removal, stripping its short flag cleanly resolves the collision.


contentstack-apps-clisrc/commands/app/install.ts + reinstall.ts

Added the missing char: "k" to --stack-api-key in both commands. These were the only two commands in the entire codebase where --stack-api-key lacked the universal -k short flag.


Flags NOT Touched

  • contentstack-external-migrate/src/commands/migrate/convert.ts — excluded intentionally. In this file, -a maps to --affix, not --alias. That inconsistency is tracked separately.

Testing

  • No unit tests reference the removed short flags (-c, -f, -g, -d). Verified by grep.
  • All 8 tsgen integration test cases updated from -o/-p to --output/--prefix.
  • Long flags unchanged — no behavioral regression.

Files Changed

packages/contentstack-apps-cli/src/commands/app/install.ts
packages/contentstack-apps-cli/src/commands/app/reinstall.ts
packages/contentstack-cli-cm-regex-validate/src/commands/cm/stacks/validate-regex.ts
packages/contentstack-cli-tsgen/src/commands/tsgen.ts
packages/contentstack-cli-tsgen/tests/integration/tsgen.integration.test.ts
packages/contentstack-migration/src/commands/cm/stacks/migration.ts

@cs-raj cs-raj requested a review from a team as a code owner June 30, 2026 12:06
@github-actions

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 133 25 ✅ Passed
🟡 Medium Severity 0 1 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

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 1 90 / 365 days ⚠️ Warning
🔵 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: 133
  • Medium without fixes: 1
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

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.

4 participants