Skip to content

feat!: update runtime config support#157

Open
brian-smith-tcril wants to merge 8 commits intoopenedx:mainfrom
brian-smith-tcril:runtime-config
Open

feat!: update runtime config support#157
brian-smith-tcril wants to merge 8 commits intoopenedx:mainfrom
brian-smith-tcril:runtime-config

Conversation

@brian-smith-tcril
Copy link
Contributor

BREAKING CHANGE: rename mfeConfigApiUrl to runtimeConfigJsonUrl
BREAKING CHANGE: remove siteId from config URL building

add cache buster for development environments

BREAKING CHANGE: rename `mfeConfigApiUrl` to `runtimeConfigJsonUrl`
BREAKING CHANGE: remove `siteId` from config URL building

add cache buster for development environments
brian-smith-tcril and others added 4 commits February 4, 2026 00:54
- Remove siteId from test config (no longer used)
- Simplify configureCache mock (no URL param parsing needed)
- Rename test to clarify it tests merge behavior
- Test proper merge: runtime overrides build-time, build-time
  values preserved, runtime values added

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Test that app-level config in runtime properly merges with
  build-time app config
- Simulates full flow by calling addAppConfigs() after initialize
- Verifies runtime overrides build-time, build-time preserved,
  and runtime additions work at the app config level

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace supportEmail with theme config (realistic optional config)
- Use fake.url pattern for test URLs:
  - fake.config.url for runtime config endpoint
  - fake.cdn.url for CDN resources (theme, logos)
  - fake.lms.url for LMS base URL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@brian-smith-tcril
Copy link
Contributor Author

Used Claude to update tests, found a few other things in the process. The Claude changes were PR'd on my fork. I left a comment on that PR with the log. brian-smith-tcril#1

brian-smith-tcril and others added 2 commits February 4, 2026 01:10
- Add appConfigOnly option to mergeSiteConfig for runtime config
- Runtime config: only merge config for existing apps, ignore new apps
- Build-time config: full app merge by appId, allow adding new apps
- Add lodash.keyby dependency for cleaner implementation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive unit tests covering all code paths in mergeSiteConfig:
- Top-level config merging (new values, overrides, preservation)
- App merging with full merge (default behavior)
- App merging with appConfigOnly option
- Edge cases (empty arrays, undefined apps, missing config)

Uses jest.spyOn pattern for verifying publish(CONFIG_CHANGED) calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment on lines 196 to 202
* Apps are merged by appId rather than array index. By default, new apps can be added.
* When `appConfigOnly` is true, only the `config` property of existing apps is merged,
* and new apps are ignored.
*
* @param {Object} newSiteConfig
* @param {Object} options
* @param {boolean} options.appConfigOnly - Only merge app config for existing apps
Copy link
Contributor Author

Choose a reason for hiding this comment

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

better explain what appConfigOnly implies:

  • still merge all non-app parts of the config
  • only merge the "config" parts of each app

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in b2729a9

fyi @arbrandes

Clearer name that doesn't imply "only do app stuff" - it still
merges all non-app config normally.

Also improved JSDoc to clarify behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant