Repository navigation
Re-land SCAPI backend for mrt env access-control (W-24145908) and redirect (W-24145907) - #736
Merged
Merged
Conversation
vvemireddy-sf
force-pushed
the
feature/scapi-mrt-env
branch
from
October 2, 2026 20:01
6ccea28 to
4ba569f
Compare
…722) Expand the `mrt env access-control` command family from list-only to full CRUD (list/create/get/delete), making each command backend-aware between the legacy MRT Cloud API and the SCAPI Storefront Environments API. - SDK: add the 4 access-control-header paths/schemas to the storefront environments spec, regenerate the client types, add the 4 *Scapi ops and their normalizers, and add backend-aware *WithBackend wrappers (auto fallback, fail-loud on explicit scapi). - CLI: rewrite list backend-aware; add create/get/delete commands. - Tests: SDK (MSW) + CLI (sinon) covering legacy, SCAPI, and the backend routing matrix. - Docs, tooling-index, and changeset updated.
* Add SCAPI backend + get/update to mrt env redirect (W-24145907) Make the `mrt env redirect` command family backend-aware between the legacy MRT Cloud API and the SCAPI Storefront Environments API, and add two new subcommands (`get`, `update`) so all six redirect operations are reachable over SCAPI. - SDK: add the redirect paths/schemas to the storefront environments spec, regenerate the client types, export the new types, and add the 6 *Scapi operations + normalizers and the 6 backend-aware *WithBackend wrappers (auto fallback, fail-loud on explicit scapi). Update mrt-command.ts for the new supported family. - CLI: rewrite list/create/delete/clone backend-aware; add get/update. The neutral `identifier` positional maps to the source path on legacy and the redirect ID (UUID) on SCAPI. update is a partial update; clone rejects a same-source clone. - Tests: SDK (MSW) + CLI (sinon) covering legacy, SCAPI, and the backend routing matrix. - Docs, tooling-index, and changeset updated. * docs: add redirect and access-control families to the SCAPI-supported commands list * Add --source/--destination aliases for redirect create --from/--to (W-24145907)
vvemireddy-sf
force-pushed
the
reland-scapi-ach-redirects
branch
from
October 2, 2026 20:03
7c76658 to
369d161
Compare
kieran-sf
approved these changes
Oct 2, 2026
vvemireddy-sf
added a commit
that referenced
this pull request
Oct 8, 2026
…onflicts (W-24461621) main reverted the SCAPI redirect + access-control work (#735) that this branch independently re-landed (#736). Resolution keeps the feature branch's re-landed versions for every file the revert touched (commands, SDK operations, specs, generated client, tests, docs, skills) — main contributed no other change to those files. The two re-land changesets (mrt-access-control-scapi, mrt-redirect-scapi) are restored; changesets consumed by main's release (#728) stay deleted. data/tooling/index.json was regenerated from the merged tree to retain main's entries alongside the re-landed MRT content. Verified: both packages typecheck clean; 388 SDK + 140 CLI MRT tests pass; lint clean (0 errors).
vvemireddy-sf
added a commit
that referenced
this pull request
Oct 13, 2026
* Revert "Add SCAPI backend + get/update to mrt env redirect (W-24145907) (#729)" This reverts commit 515c206. * Revert "Add SCAPI backend + full CRUD to mrt env access-control (W-24145908) (#722)" This reverts commit aa1c66f. * Re-land SCAPI backend for mrt env access-control (W-24145908) and redirect (W-24145907) (#736) * Add SCAPI backend + full CRUD to mrt env access-control (W-24145908) (#722) Expand the `mrt env access-control` command family from list-only to full CRUD (list/create/get/delete), making each command backend-aware between the legacy MRT Cloud API and the SCAPI Storefront Environments API. - SDK: add the 4 access-control-header paths/schemas to the storefront environments spec, regenerate the client types, add the 4 *Scapi ops and their normalizers, and add backend-aware *WithBackend wrappers (auto fallback, fail-loud on explicit scapi). - CLI: rewrite list backend-aware; add create/get/delete commands. - Tests: SDK (MSW) + CLI (sinon) covering legacy, SCAPI, and the backend routing matrix. - Docs, tooling-index, and changeset updated. * Add SCAPI backend + get/update to mrt env redirect (W-24145907) (#729) * Add SCAPI backend + get/update to mrt env redirect (W-24145907) Make the `mrt env redirect` command family backend-aware between the legacy MRT Cloud API and the SCAPI Storefront Environments API, and add two new subcommands (`get`, `update`) so all six redirect operations are reachable over SCAPI. - SDK: add the redirect paths/schemas to the storefront environments spec, regenerate the client types, export the new types, and add the 6 *Scapi operations + normalizers and the 6 backend-aware *WithBackend wrappers (auto fallback, fail-loud on explicit scapi). Update mrt-command.ts for the new supported family. - CLI: rewrite list/create/delete/clone backend-aware; add get/update. The neutral `identifier` positional maps to the source path on legacy and the redirect ID (UUID) on SCAPI. update is a partial update; clone rejects a same-source clone. - Tests: SDK (MSW) + CLI (sinon) covering legacy, SCAPI, and the backend routing matrix. - Docs, tooling-index, and changeset updated. * docs: add redirect and access-control families to the SCAPI-supported commands list * Add --source/--destination aliases for redirect create --from/--to (W-24145907) * Add SCAPI backend to mrt project (storefronts) commands (W-24145902) (#732) * Add SCAPI backend to mrt project (storefronts) commands (W-24145902) Make the `mrt project` family (list/create/get/update/delete) backend-aware over `--mrt-backend`. A project maps to a SCAPI storefront: the storefront ID is the project slug and the organization is fixed by --tenant-id. - New SDK client for the Storefront Storefronts API (/storefront/storefronts/v1, scopes sfcc.storefront.storefronts[.rw]). - Backend-aware project operations in operations/mrt/project.ts: 5 SCAPI primitives + 5 *WithBackend wrappers routing legacy <-> SCAPI with safe auto fallback and a normalized MrtProjectView. - 5 CLI commands rewritten backend-aware; backend-specific flag validation (legacy create needs --organization; SCAPI create needs >=1 --site, --type defaults to storefront_next; SCAPI update cannot rename and --site fully replaces the assigned-sites set). SCAPI create/delete return 202 (async). - mrt project member / notification stay legacy-only and reject --mrt-backend scapi. - Unit + MSW tests for the legacy/SCAPI/routing matrix; docs and changeset. * Address review feedback on MRT SCAPI backend commands (W-24145902) - access-control delete: add confirmation prompt + --force/-f flag - redirect list: keep fromPath/toUrl column aliases; warn when --search is combined with the SCAPI backend (gateway does not accept it yet) - redirect delete --json: emit identifier + backward-compatible fromPath - redirect clone --json: synthesize {from,to,count} on SCAPI's empty 201 * review changes * Fix legacy redirect clone crash on empty response body (W-24145902) * Add SCAPI backend to mrt env lifecycle commands (W-24145903) (#743) * Add SCAPI backend to mrt env lifecycle commands (W-24145903) * Address PR #743 review: drop redundant jsonEnabled guard, rename clone flags type - invalidate.ts: remove the redundant if (!this.jsonEnabled()) guard around the success/note log calls; MrtCommand.log() already no-ops under --json. - env.ts / index.ts: rename interface ScapiCloneEnvironmentFlags -> CloneEnvironmentFlagsScapi to match the Scapi-suffix convention for functions/types in operations/mrt. * Address PR #743 review: SCAPI clone --wait, serialized error cause, SCAPI invalidate ack, preserve-proxy-user-agent - clone: implement --wait on the SCAPI backend via waitForEnvironmentScapi (polls building -> ready/build_failed with injectable sleep/now); drop the "not supported yet" warning and the legacy-only note on the flag. - base-command: serializeErrorCause() preserves object/Error causes in the --json error envelope instead of stringifying to "[object Object]". - invalidate: SCAPI returns an empty 202 (raw === null), so emit a stable structured ack under --json; legacy response is returned verbatim (unchanged). - env update: add --preserve-proxy-user-agent (legacy-only), wire SDK updateEnv + updateEnvironmentWithBackend, add preserve_proxy_user_agent to the legacy MRT spec and regenerate the client. - Tests updated/added across SDK and CLI. * Address PR #753 review feedback for SCAPI MRT env (W-24145903) - redirect list: remap fromPath/toUrl aliases to source/destination before selectColumns() instead of duplicate column defs - env create/clone/update, project create: remove premature command-level SCAPI gates; each SDK backend branch validates its own inputs; add shared mrtBackendOnlyFlags() mechanism - mrt-command: declare backend-specific flags per command; one consistent check after backend resolution (error on explicit, warn on auto) - env get: printEnvView carries and prints legacy-only fields - docs/cli/mrt.md: add mrt env lifecycle commands to SCAPI-supported list, add set-primary section, regenerate tooling index; add skill entries - changesets: trim each to a one-line user benefit; fold redirect ACH review-fixes changeset into the redirect/access-control changesets * Fix legacy project_type test literal to valid ProjectTypeEnum value The merge of main regenerated the MRT OpenAPI client, tightening project_type from a loose string to ProjectTypeEnum. The pre-existing normalizeLegacyProject test used 'sfra', which no longer typechecks under 'tsc --noEmit -p test' (CI pretest). Use 'SSR' instead.
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
Re-lands the two SCAPI MRT
envfeatures onto thefeature/scapi-mrt-envintegration branch (they are being reverted frommainin the companion revert PR #735). This PR's diff is exactly the ACH + redirect changes.mrt env access-control(list/create/get/delete), scopessfcc.storefront.environments[.rw].get/updateformrt env redirect, including the--source/--destinationaliases onredirect create.Incorporates #734. The feature branch is based on
mainafter #734 ("Default--mrt-backendto legacy instead of auto"), with both features reverted — so the re-landed features sit on top of the legacy-default behavior and docs. The resulting tree is byte-identical to the currentmaintip (features + #734); the conflicts inSKILL.md/docs/cli/mrt.mdfrom the default-wording change were resolved to keep #734's legacy default while re-adding the ACH/redirect scope mentions.Changes
mrt env access-controlSCAPI backend + CRUD (SDK operations + client, CLI commands, docs, skill reference, tests).mrt env redirectSCAPI backend +get/update,--source/--destinationaliases oncreate(SDK operations, CLI commands, docs, skill reference, tests).Testing
main(git diff origin/mainempty).mrt env redirect+mrt env access-controlCLI suites — 54 passing.mrt-command+test/operations/mrt— 287 passing (incl. Default --mrt-backend to legacy instead of auto #734's legacy-default expectations).