Skip to content

CEXT-5236: Separating service urls based on execution context - #36

Merged
pdohogne-magento merged 2 commits into
mainfrom
CEXT-5236-contextual-service-urls
Oct 7, 2025
Merged

CEXT-5236: Separating service urls based on execution context#36
pdohogne-magento merged 2 commits into
mainfrom
CEXT-5236-contextual-service-urls

Conversation

@pdohogne-magento

Copy link
Copy Markdown
Collaborator

Description

When running inside a runtime action, use the internal endpoint for the service, otherwise use the external endpoint.

Related Issue

CEXT-5236: aio-lib-db to use correct urls depending on context

Motivation and Context

When running inside a runtime action, use the internal endpoint for the service, otherwise use the external endpoint.

How Has This Been Tested?

Unit testing. Manual tests require the code to be run from inside a deployed ethos cluster and cannot be done locally.

Screenshots (if appropriate):

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 added tests to cover my changes.
  • All new and existing tests passed.

@nofuss nofuss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good to me

Comment thread lib/__mocks__/constants.js Outdated
},
[constants.EXECUTION_CONTEXT.EXTERNAL]: {
[constants.PROD_ENV]: 'https://db.<region>.adobe.test',
[constants.STAGE_ENV]: 'https://db-stage.<region>.adobe.test'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe excessively picky, but might as well use stg to be consistent with the pattern elsewhere.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This led to me finding a bug in how I was mocking (or rather, not mocking) getCliEnv(), so thanks for being picky! 😄

@pdohogne-magento
pdohogne-magento merged commit 007f488 into main Oct 7, 2025
5 checks passed
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.

2 participants