Skip to content

🤖 feat(cli): add transcend policy deactivate subcommand#264

Merged
Utsav-Patel merged 5 commits into
mainfrom
utsav/link-7227-implement-transcend-policy-deactivate-subcommand
Jul 7, 2026
Merged

🤖 feat(cli): add transcend policy deactivate subcommand#264
Utsav-Patel merged 5 commits into
mainfrom
utsav/link-7227-implement-transcend-policy-deactivate-subcommand

Conversation

@Utsav-Patel

@Utsav-Patel Utsav-Patel commented Jul 6, 2026

Copy link
Copy Markdown
Member

Related Issues

Public Changelog

  • Added: transcend policy deactivate --bundle-name <name> to take a policy bundle's currently active version offline, completing the publish/activate/list/versions/deactivate lifecycle tooling.
  • Updated: transcend policy * CLI flags are now kebab-case (e.g. --bundle-name, --transcend-url, --policy-bundle-id, --dry-run) instead of camelCase. Single-word flags (--auth, --json, --version, --dir, --limit, --offset, --after, --description) are unchanged.

Internal Changelog

  • Added: transcend policy deactivate subcommand — resolves --bundle-name to the parent bundle UUID, POSTs v1/policy-engine/policy-bundles/{id}/deactivate, rewrites monolith 409 (no active version) to reference the user-supplied name, and fails CLI-side on unknown bundles. Pairs with transcend-io/main#45480.
  • Updated: Renamed camelCase CLI flags to kebab-case across the policy command group (activate, deactivate, versions, list, publish); scoped to policy only — other command groups are unaffected.
Implementation details

Key files

  • packages/cli/src/commands/policy/deactivate/{command,impl,readme}.ts — new deactivate subcommand
  • packages/cli/src/commands/policy/deactivate/tests/impl.test.ts — mocked-client unit tests (happy path, JSON, unknown bundle, 409 rewrite, non-409 surfacing)
  • packages/cli/src/commands/policy/{activate,deactivate,versions,list,publish}/{command,impl,readme}.ts — kebab-case flag renames
  • packages/cli/src/commands/policy/types.tsDeactivatePolicyBundleResponse ({ bundle, version })
  • packages/cli/src/commands/policy/routes.ts — registers deactivate in the policy command group
  • packages/cli/README.md — regenerated command docs (policy sections only)

Notes

  • Reuses buildPolicyEngineClient, resolveBundleIdByName, formatPolicyBundleVersionSummary, printResult, and formatPolicyEngineRequestError from commands/policy/helpers/.
  • Required AD scope: ActivatePolicyEngineBundles (same as activate).
  • No --policy-bundle-id or --dry-run flags on deactivate (per ticket).
  • stricli has no per-command case-style toggle, so flag keys are defined as kebab-case strings in each command.ts; stricli displays and accepts --kebab-case and rejects --camelCase with a "did you mean" suggestion.
  • Impl functions keep camelCase local variable names via destructuring renaming, so internal logic and shared helpers are unchanged.
  • kebab-case is scoped to the policy command group; a global scanner.caseStyle: "allow-kebab-for-camel" toggle was intentionally avoided to limit blast radius.

Mirror the `activate` subcommand layout to take a policy bundle's active
version offline by bundle name. Resolves `--bundle-name` to the parent
bundle UUID internally, then POSTs
`v1/policy-engine/policy-bundles/{id}/deactivate` (no body). Rewrites the
monolith 409 (no active version) to reference the user-supplied bundle
name, and fails CLI-side on unknown bundle names before hitting the API.
@Utsav-Patel Utsav-Patel self-assigned this Jul 6, 2026
@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

LINK-7227

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@transcend-io/airgap.js-types

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/airgap.js-types@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/airgap.js-types@264.tgz

@transcend-io/cli

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/cli@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/cli@264.tgz

@transcend-io/internationalization

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/internationalization@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/internationalization@264.tgz

@transcend-io/privacy-types

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/privacy-types@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/privacy-types@264.tgz

@transcend-io/sdk

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/sdk@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/sdk@264.tgz

@transcend-io/type-utils

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/type-utils@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/type-utils@264.tgz

@transcend-io/utils

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/utils@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/utils@264.tgz

@transcend-io/mcp

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp@264.tgz

@transcend-io/mcp-server-admin

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-admin@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-admin@264.tgz

@transcend-io/mcp-server-assessment

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-assessment@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-assessment@264.tgz

@transcend-io/mcp-server-base

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-base@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-base@264.tgz

@transcend-io/mcp-server-consent

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-consent@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-consent@264.tgz

@transcend-io/mcp-server-discovery

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-discovery@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-discovery@264.tgz

@transcend-io/mcp-server-docs

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-docs@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-docs@264.tgz

@transcend-io/mcp-server-dsr

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-dsr@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-dsr@264.tgz

@transcend-io/mcp-server-inventory

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-inventory@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-inventory@264.tgz

@transcend-io/mcp-server-preferences

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-preferences@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-preferences@264.tgz

@transcend-io/mcp-server-workflows

pnpm add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-workflows@264
yarn add https://pkg.pr.new/transcend-io/tools/@transcend-io/mcp-server-workflows@264.tgz

commit: b115d66

Rename the camelCase CLI flags across the policy command group to
kebab-case (e.g. --bundleName -> --bundle-name, --transcendUrl ->
--transcend-url, --policyBundleId -> --policy-bundle-id, --dryRun ->
--dry-run). Single-word flags (--auth, --json, --version, --dir, --limit,
--offset, --after, --description, --pkg, --input, --bundle) are unchanged.

stricli has no per-command case-style toggle, so this is done by defining
the flag keys as kebab-case strings in each policy command.ts. stricli
then displays and accepts --kebab-case (and rejects --camelCase input with
a "did you mean" suggestion). Scoped to the policy command group only --
no global app config change, so request/consent/inventory/admin/migration
commands are unaffected.

Impl functions keep camelCase local variable names via destructuring
renaming, so internal logic and the shared helpers are unchanged. README
command docs regenerated.

@MadDataScience MadDataScience 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.

I'm guessing flagName isn't an option here, but just wanted to check

Comment thread packages/cli/src/commands/policy/activate/command.ts
@Utsav-Patel Utsav-Patel added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit 321c04a Jul 7, 2026
4 checks passed
@Utsav-Patel Utsav-Patel deleted the utsav/link-7227-implement-transcend-policy-deactivate-subcommand branch July 7, 2026 20:16
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