Skip to content

Conversation

@aminakhyat
Copy link
Contributor

@aminakhyat aminakhyat commented Nov 10, 2025

Description

Add Business Config Library into the Integration Starter Kit.

This PR updates the environment variable naming convention throughout the codebase to use the new AIO_COMMERCE_* prefixes. While most files contain variable name updates, the primary focus of this PR is the integration of aio-commerce-lib-config.

📋 Environment Variable Changes
IMS OAuth Variables:

  • OAUTH_CLIENT_IDAIO_COMMERCE_AUTH_IMS_CLIENT_ID
  • OAUTH_CLIENT_SECRETAIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS
  • OAUTH_TECHNICAL_ACCOUNT_IDAIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID
  • OAUTH_TECHNICAL_ACCOUNT_EMAILAIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL
  • OAUTH_ORG_IDAIO_COMMERCE_AUTH_IMS_ORG_ID
  • OAUTH_SCOPESAIO_COMMERCE_AUTH_IMS_SCOPES

Commerce Integration Variables:

  • COMMERCE_CONSUMER_KEYAIO_COMMERCE_AUTH_INTEGRATION_CONSUMER_KEY
  • COMMERCE_CONSUMER_SECRETAIO_COMMERCE_AUTH_INTEGRATION_CONSUMER_SECRET
  • COMMERCE_ACCESS_TOKENAIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN
  • COMMERCE_ACCESS_TOKEN_SECRETAIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN_SECRET
  • COMMERCE_BASE_URLAIO_COMMERCE_API_BASE_URL

🎯 Key Files to Review (aio-commerce-lib-config integration)

⚠️ These files contain the most important changes and should be prioritized during review:

  • commerce-configuration-1/ext.config.yaml - Extension configuration added
  • app.config.yaml - Application configuration changes to add extension point
  • env.dist - Environment template with updated variable names
  • install.yaml - Installation configuration updates
  • package.json - New dependency additions and updates

@aminakhyat aminakhyat marked this pull request as ready for review November 11, 2025 09:34
@aminakhyat aminakhyat requested a review from a team as a code owner November 11, 2025 09:34
@rojoangel
Copy link
Collaborator

Heads-up: the vars renaming is going to require changes to the starter kit public docs: https://developer.adobe.com/commerce/extensibility/starter-kit/integration/create-integration/, for example the section in the screenshot below
image

@rojoangel
Copy link
Collaborator

Following the README to install a vanilla starter-kit project, I run into an issue where the generated runtime actions do not get deployed.
I run directly aio app deploy (didn't call aio app build beforehand), and as the output shows, the config actions are generated after the existing actions have been deployed.

aio app deploy
✔ Built 35 action(s) for 'application'
ℹ No frontend or a build already exists, skipping frontend build for 'application'
✔ Deployed 38 action(s) for 'application'
no frontend, skipping frontend deploy 'application'
Your deployed actions:
web actions:
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/web/starter-kit/info
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/web/webhook/check-stock
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/web/product-commerce/full-sync
non-web actions:
  -> starter-kit/__secured_info
  -> webhook/__secured_check-stock
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/deleted
  -> product-commerce/__secured_full-sync
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/group-updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/group-deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/group-created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/group-updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/group-deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-commerce/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/shipment-created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/shipment-updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-backoffice/updated
2025-11-11T11:29:17.343Z [@adobe/aio-commerce-lib-config:schema-validation] info: 🔄 Analyzing configuration schema...
2025-11-11T11:29:17.346Z [@adobe/aio-commerce-lib-config:schema-validation] info: ✅ Configuration schema validation passed.

2025-11-11T11:29:17.347Z [@adobe/aio-commerce-lib-config:actions:generate] info: 📄 Generated configuration-schema.json

2025-11-11T11:29:17.347Z [@adobe/aio-commerce-lib-config:actions:generate] info: 📝 Updating ext.config.yaml...
2025-11-11T11:29:17.353Z [@adobe/aio-commerce-lib-config:actions:generate] info: 🔧 Generating runtime actions...
2025-11-11T11:29:17.355Z [@adobe/aio-commerce-lib-config:actions:generate] info: ✅ Generated 6 action(s) in .generated/actions/app-management

ℹ no backend, skipping action build for 'commerce/configuration/1'
ℹ No frontend or a build already exists, skipping frontend build for 'commerce/configuration/1'
no backend, skipping action deploy 'commerce/configuration/1'
no frontend, skipping frontend deploy 'commerce/configuration/1'
 ›   Error: Cannot convert undefined or null to object

@rojoangel
Copy link
Collaborator

Also, notice this error at the end of aio app deploy

›   Error: Cannot convert undefined or null to object

@rojoangel
Copy link
Collaborator

Is there a recommendation for what to do with the files that were modified during the process? I noticed that they appear as code modified when running git status

git status
Alias tip: gst
On branch CEXT-5328-add-business-config-lib
Your branch is up to date with 'origin/CEXT-5328-add-business-config-lib'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   commerce-configuration-1/ext.config.yaml

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        commerce-configuration-1/.generated/

no changes added to commit (use "git add" and/or "git commit -a")

@aminakhyat
Copy link
Contributor Author

Following the README to install a vanilla starter-kit project, I run into an issue where the generated runtime actions do not get deployed. I run directly aio app deploy (didn't call aio app build beforehand), and as the output shows, the config actions are generated after the existing actions have been deployed.

❯ aio app deploy
✔ Built 35 action(s) for 'application'
ℹ No frontend or a build already exists, skipping frontend build for 'application'
✔ Deployed 38 action(s) for 'application'
no frontend, skipping frontend deploy 'application'
Your deployed actions:
web actions:
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/web/starter-kit/info
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/web/webhook/check-stock
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/web/product-commerce/full-sync
non-web actions:
  -> starter-kit/__secured_info
  -> webhook/__secured_check-stock
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-commerce/deleted
  -> product-commerce/__secured_full-sync
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/product-backoffice/deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/group-updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-commerce/group-deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/group-created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/group-updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/customer-backoffice/group-deleted
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-commerce/created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/shipment-created
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/order-backoffice/shipment-updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-commerce/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-commerce/updated
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-backoffice/consumer
  -> https://3117813-rojopocs-configlibtest2.adobeioruntime.net/api/v1/stock-backoffice/updated
2025-11-11T11:29:17.343Z [@adobe/aio-commerce-lib-config:schema-validation] info: 🔄 Analyzing configuration schema...
2025-11-11T11:29:17.346Z [@adobe/aio-commerce-lib-config:schema-validation] info: ✅ Configuration schema validation passed.

2025-11-11T11:29:17.347Z [@adobe/aio-commerce-lib-config:actions:generate] info: 📄 Generated configuration-schema.json

2025-11-11T11:29:17.347Z [@adobe/aio-commerce-lib-config:actions:generate] info: 📝 Updating ext.config.yaml...
2025-11-11T11:29:17.353Z [@adobe/aio-commerce-lib-config:actions:generate] info: 🔧 Generating runtime actions...
2025-11-11T11:29:17.355Z [@adobe/aio-commerce-lib-config:actions:generate] info: ✅ Generated 6 action(s) in .generated/actions/app-management

ℹ no backend, skipping action build for 'commerce/configuration/1'
ℹ No frontend or a build already exists, skipping frontend build for 'commerce/configuration/1'
no backend, skipping action deploy 'commerce/configuration/1'
no frontend, skipping frontend deploy 'commerce/configuration/1'
 ›   Error: Cannot convert undefined or null to object

I was testing with another app and had no issues, but I see this with SK 🤔 We might need to move the pre-app-build hook up from extensions to application:

application:
  hooks:
    pre-app-build: node_modules/@adobe/aio-commerce-lib-config/dist/cjs/hooks/pre-app-build.cjs

@iivvaannxx
Copy link
Collaborator

iivvaannxx commented Nov 13, 2025

Also, notice this error at the end of aio app deploy

Can reproduce, looking for a fix. This only happens if you run the deploy alongside a build via aio app deploy --force-build, plus the initial content of the ext.config.yaml is {}. If you run the command with the contents that are added by the pre-app-build hook it doesn't happen (even if you delete the built actions or the .generated source code).

Moving the hooks to the application doesn't work, the issue is most likely the one described in this thread. Also, if we were to move the hook this would cause a command like this to fail: aio app deploy --force-build -e commerce/configuration/1, as we would only be targeting a build/deploy for our extension point, and the hook would not be executed.

@iivvaannxx iivvaannxx force-pushed the CEXT-5328-add-business-config-lib branch from 5ee2e81 to a540aa4 Compare November 17, 2025 17:14
@iivvaannxx iivvaannxx changed the base branch from main to business-config-do-not-delete November 17, 2025 18:53
@rojoangel
Copy link
Collaborator

The app-management/sync-commerce-scopes action seems to be broken when connected to a SaaS instance. When called, despite the AIO_COMMERCE_AUTH_IMS env vars being initialized, it returns the following error

{
  "code": "INTERNAL_ERROR",
  "details": "Can't resolve authentication options for the given params. Please provide either IMS options (AIO_COMMERCE_AUTH_IMS_CLIENT_ID, AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS, AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID, AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL, AIO_COMMERCE_AUTH_IMS_ORG_ID, AIO_COMMERCE_AUTH_IMS_SCOPES) or Commerce integration options (AIO_COMMERCE_AUTH_INTEGRATION_CONSUMER_KEY, AIO_COMMERCE_AUTH_INTEGRATION_CONSUMER_SECRET, AIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN, AIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN_SECRET).",
  "message": "An internal server error occurred"
}

For PaaS, it is working fine. though

@iivvaannxx
Copy link
Collaborator

@rojoangel Everything should be working properly now

@iivvaannxx iivvaannxx merged commit 421e2f5 into business-config-do-not-delete Nov 25, 2025
2 checks passed
@iivvaannxx iivvaannxx deleted the CEXT-5328-add-business-config-lib branch November 25, 2025 09:38
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.

4 participants