Skip to content

CEXT-6080: add conditional schema properties based on commerce flavor#418

Open
vinayrao2000 wants to merge 1 commit intoadobe:mainfrom
vinayrao2000:cext-6080-conditional-schema-commerce-flavor
Open

CEXT-6080: add conditional schema properties based on commerce flavor#418
vinayrao2000 wants to merge 1 commit intoadobe:mainfrom
vinayrao2000:cext-6080-conditional-schema-commerce-flavor

Conversation

@vinayrao2000
Copy link
Copy Markdown

Description

Enables flavor-aware configuration schema retrieval in App Management by forwarding the selected Commerce instance flavor (paas or saas) to app config endpoints.

  • Adds support for passing commerceEnv as a query parameter on the config GET request
  • Updates useGetConfigValues.fetchConfig to accept an optional commerceEnv and append it only when it strictly matches 'paas' or 'saas'
  • Reuses existing useCommerceInstance() logic to derive flavor from the encoded instance ID (no new parsing logic introduced)
  • Preserves backward compatibility by omitting invalid or undefined values
  • No changes to write path (useSetConfigValues remains unchanged)

As a result, apps using the Adobe Commerce SDK can return only the schema fields relevant to the selected flavor.

Motivation and Context

App configuration schemas were previously flavor-agnostic, causing users to see fields that were not relevant to their selected Commerce instance (PaaS or SaaS).

This change ensures that App Management forwards the correct flavor context to apps, enabling them to return filtered, environment-specific schema fields. This improves user experience and prevents confusion or misconfiguration.

How Has This Been Tested?

  • Added unit tests to verify:

    • paas and saas values are correctly appended
    • Invalid values (undefined, '', 'unknown', 'PaaS') are ignored
    • Existing query parameters on configUrl are preserved
  • Updated integration test (ConfigureApplication) to account for the new commerceEnv argument

  • Manual verification:

    • /env/paas → request includes commerceEnv=paas
    • /env/saas → request includes commerceEnv=saas
    • Invalid or legacy instance → no param sent → full schema returned
  • Validation:

    • tsc --noEmit passes
    • eslint passes
    • jest tests passing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have read the DEVELOPMENT document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 1, 2026

⚠️ No Changeset found

Latest commit: bb16792

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added without-changeset The PR does not contain a Changeset file pkg: aio-commerce-lib-config Includes changes in `packages/aio-commerce-lib-config` pkg: aio-commerce-lib-app Includes changes in `packages/aio-commerce-lib-app` labels May 1, 2026
@vinayrao2000 vinayrao2000 changed the title add conditional schema properties based on commerce flavor (CEXT-6080) CEXT-6080: add conditional schema properties based on commerce flavor May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: aio-commerce-lib-app Includes changes in `packages/aio-commerce-lib-app` pkg: aio-commerce-lib-config Includes changes in `packages/aio-commerce-lib-config` without-changeset The PR does not contain a Changeset file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant