Skip to content

Refresh MRT admin schema; add env clone, bundle delete, org member/cert commands#405

Merged
clavery merged 3 commits into
mainfrom
feature/mrt-clone
May 7, 2026
Merged

Refresh MRT admin schema; add env clone, bundle delete, org member/cert commands#405
clavery merged 3 commits into
mainfrom
feature/mrt-clone

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented May 6, 2026

Summary

  • Refresh packages/b2c-tooling-sdk/specs/mrt-api-v1.json from cloud-soak.mrt-soak.com and regenerate types. New endpoints: target clone, organization certificates, organization members, bundle delete + bulk-delete.
  • Add SDK operations: cloneEnv, deleteBundle/bulkDeleteBundles, full organization-member and certificate modules.
  • Add CLI commands:
    • b2c mrt env clone — clone a target from a source target, optionally cloning redirects, env vars, and B2C target info; supports --certificate-id/--external-hostname for custom domains and --wait to poll until ready.
    • b2c mrt bundle delete <id...> — single DELETE for one ID, bulk-delete for many; reports rejected bundles.
    • b2c mrt org member list|add|get|update|remove.
    • b2c mrt org cert list|get|create|delete|restart-validation.
  • Docs and the b2c-mrt skill updated. Changesets included for @salesforce/b2c-cli, @salesforce/b2c-tooling-sdk (minor) and @salesforce/b2c-agent-plugins (patch).

Out of scope (note for follow-up): the new schema also exposes bundle delete and org cert types that could power richer monitoring/renewal workflows; this PR wraps each endpoint 1:1 only.

Test plan

  • pnpm run typecheck:agent clean
  • pnpm -r run test:agent — 4,099 tests passing (SDK 1722, CLI 1211, DX-MCP 650, mrt-utilities 516)
  • pnpm run lint:agent clean
  • ./cli mrt --help, ./cli mrt env clone --help, ./cli mrt org cert --help, ./cli mrt org member --help all show new commands and topics
  • End-to-end on a real instance: b2c mrt env clone qa-copy --from staging --project <p> --clone-redirects --clone-env-vars --wait, then b2c mrt env get qa-copy and b2c mrt env redirect list qa-copy
  • End-to-end: b2c mrt bundle delete <id> (single) and b2c mrt bundle delete <id> <id> <id> (bulk)
  • End-to-end: b2c mrt org cert create shop.example.com --org <org>, capture the validation record, run b2c mrt org cert get to confirm it persists

Notes

  • The OpenAPI spec mistypes the POST /target/{slug}/clone/ response as APITargetV2Clone (the request body schema). The API actually returns target-shaped data; cloneEnv casts through unknown rather than re-fetching to avoid a wasted round-trip.
  • addOrgMember/updateOrgMember re-fetch via getOrgMember so callers get a complete record (the POST/PATCH response schemas omit email/first_name/last_name).

clavery added 2 commits May 6, 2026 17:37
…s, org certs

- Update OpenAPI spec from cloud-soak.mrt-soak.com (target clone, certificates,
  org members, bundle delete + bulk-delete endpoints) and regenerate types.
- SDK: add cloneEnv, deleteBundle/bulkDeleteBundles, organization-member
  operations, certificate operations.
- CLI: b2c mrt env clone, b2c mrt bundle delete, b2c mrt org member
  list/add/get/update/remove, b2c mrt org cert list/get/create/delete/restart-validation.
- Docs and b2c-mrt skill updated; changesets included.
@clavery clavery marked this pull request as ready for review May 6, 2026 22:47
…from

Drop the redundant --from flag on b2c mrt env clone. Every MrtCommand already
has a base --environment / -e flag (with MRT_ENVIRONMENT and dw.json
mrtEnvironment fallbacks) that selects the working environment; using it as
the source for clone keeps the behavior consistent with the rest of the env
commands. The positional argument is the new slug. Also reject identical
source and destination slugs.
@clavery clavery merged commit b1600fa into main May 7, 2026
6 checks passed
@clavery clavery deleted the feature/mrt-clone branch May 7, 2026 21:03
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.

1 participant