Skip to content

Conversation

@iivvaannxx
Copy link

@iivvaannxx iivvaannxx commented Nov 10, 2025

Description

Integrates the new business configuration library as an initial step towards unified app-management. Renames environment variables as needed per the generated actions.

Additional Fixes

  • Fix the Node Version in the ci.yml, which was mismatched from the required version declared in the package.json engines property.

Ticket

CEXT-5327

@iivvaannxx iivvaannxx requested a review from a team as a code owner November 10, 2025 17:48
@iivvaannxx iivvaannxx marked this pull request as draft November 10, 2025 17:49
@iivvaannxx iivvaannxx marked this pull request as ready for review November 11, 2025 10:20
@iivvaannxx iivvaannxx force-pushed the CEXT-5327-integrate-aio-lib-config branch from 7b78217 to b6b9b34 Compare November 13, 2025 09:18
@iivvaannxx iivvaannxx force-pushed the CEXT-5327-integrate-aio-lib-config branch from c9f18e0 to 8413931 Compare November 17, 2025 15:15
@iivvaannxx iivvaannxx changed the base branch from main to business-config-do-not-delete November 17, 2025 15:26
Copy link
Member

@obarcelonap obarcelonap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some doubts from my side

@@ -0,0 +1,99 @@
operations:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate on the general concept about this and how it is used in config management?
first time I see

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly aware of what's the use case but is something that @asalloum5 spoke in the past and he might be able to explain it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@iivvaannxx iivvaannxx Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, it allows to get a list of the operations an extension point has (some kind of metadata). This serves the purpose of not having to guess (or assume) that some operation is present, and also know which is the runtime action that performs it.

function: .generated/actions/app-management/get-scope-tree.js
web: yes
runtime: nodejs:22
inputs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

action is not hitting the instance, are you sure injecting the credentials is required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe for this runtime action hitting commerce is "optional" on whether you feed the commerceConfig or not, but I didn't implement so not sure why. @aminakhyat Implemented that and she's out these days, but maybe @emartinpalomas knows the answer 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment about least privilege principle, we have to be careful on injecting the minimum credentials as possible

web: yes
runtime: nodejs:22
inputs:
LOG_LEVEL: info
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to be able to configure this using an env var

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will create a patch in @adobe/aio-commerce-lib-config to fix that 👍🏻

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file autogenerated? if so it is missing the notice

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will add

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably has to be moved into .generated folder too

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no, while some of it's contents are auto-generated, you might want to add some extra configuration to it. You may want to add a hook for example, in the current implementation I placed hooks in the app.config.yaml, but nothing stops you from doing it in the ext.config.yaml.

Having it in .generated would be confusing in that sense. But will keep it in mind and discuss it with @aminakhyat when she comes back. For now, I'll add only a comment to the generated properties.

require-adobe-auth: true
final: true
include:
- - .generated/configuration-schema.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this two dashes syntax correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, include is actually an array of arrays in the shape of [[source, dest], [source, dest]]. I'd prefer to write this in the format of multiple - [source, dest] but that is the output of the yaml stringify operation.

AIO_COMMERCE_AUTH_INTEGRATION_CONSUMER_SECRET: $AIO_COMMERCE_AUTH_INTEGRATION_CONSUMER_SECRET
AIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN: $AIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN
AIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN_SECRET: $AIO_COMMERCE_AUTH_INTEGRATION_ACCESS_TOKEN_SECRET
AIO_COMMERCE_AUTH_IMS_CLIENT_ID: $AIO_COMMERCE_AUTH_IMS_CLIENT_ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you need this IMS credentials here: if the requestor is from Commerce admin or Unified Shell the token should have already the needed scopes to request to the instance. Therefore, you can just grab the token from Authentication header and forward.
Same for PaaS if they use IMS, not sure if we need integration creds.
Have you explored this option?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, token forwarding is something that we can implement but it's not present right now, so as of this moment we need the inputs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe is important in this case since code is autogenerated from a lib we provide, should follow least principle privilege. I'd strongly suggest you consider token forwarding for the config implementation (extra points if it comes from the auth lib).

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.

7 participants