Skip to content

@W-23634161: warn before installing non-Salesforce Commerce Apps - #604

Open
jbisaSF wants to merge 1 commit into
SalesforceCommerceCloud:mainfrom
jbisaSF:jbisa.W-23634161.cap-install-non-sfdc-warning
Open

@W-23634161: warn before installing non-Salesforce Commerce Apps#604
jbisaSF wants to merge 1 commit into
SalesforceCommerceCloud:mainfrom
jbisaSF:jbisa.W-23634161.cap-install-non-sfdc-warning

Conversation

@jbisaSF

@jbisaSF jbisaSF commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • cap:install now reads the provider field from commerce-app.json and, when it isn't 'salesforce' (including manifests that omit the field entirely, e.g. older apps), prints a warning and prompts for y/n confirmation before proceeding.
  • Added --force to skip the prompt; the prompt is also automatically skipped in --json mode.
  • Added CommerceAppProvider type and provider field to CommerceAppManifest in the SDK, plus a readManifestFromTarget helper (directory or .zip) so the CLI can inspect the manifest even when --skip-validate is passed.

Backwards compatibility

This is backwards compatible: no install that succeeded before this change will fail because of it, and no manifest field is required.

  • provider is optional on CommerceAppManifest. Manifests predating this field (provider is undefined) still parse and install correctly.
  • The check is manifest.provider !== 'salesforce', so a missing provider is treated the same as an explicit 'thirdParty'/'custom' — it triggers the warning rather than silently skipping it. This is intentional: most existing Commerce Apps predate the provider field, and we can't assume "missing" means "Salesforce-authored," so they get the same non-Salesforce confirmation as an app that explicitly declares a third-party provider.
  • The prompt itself doesn't block anything permanently — it can be bypassed with --force, and is skipped automatically in --json mode — so existing scripts/CI pipelines that install CAPs non-interactively continue to work unchanged.

Test plan

  • pnpm --filter @salesforce/b2c-cli run test:agent — all passing, including new provider-warning suite (salesforce/thirdParty/no-provider, cancel, --force, --json)
  • pnpm --filter @salesforce/b2c-tooling-sdk run test:agent — passing (one pre-existing unrelated oauth-command failure present on main)
  • pnpm run lint:agent — clean
  • Changeset added (@salesforce/b2c-cli, @salesforce/b2c-tooling-sdk, patch)

@jbisaSF
jbisaSF requested a review from clavery as a code owner July 31, 2026 16:57
Comment thread packages/b2c-cli/src/commands/cap/install.ts
@jbisaSF
jbisaSF force-pushed the jbisa.W-23634161.cap-install-non-sfdc-warning branch from 8cdd2f6 to 421c2ad Compare July 31, 2026 21:01
cap:install now reads the commerce-app.json provider field and, when it
is anything other than 'salesforce' (including apps predating the
field), prints a warning and prompts for confirmation before
proceeding. --force and --json bypass the prompt for scripted use.

Co-Authored-By: Claude <noreply@anthropic.com>
@jbisaSF
jbisaSF force-pushed the jbisa.W-23634161.cap-install-non-sfdc-warning branch from 421c2ad to 7bbeff2 Compare July 31, 2026 21:05
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.

3 participants