Skip to content

feat: add App.defaultConfig for bundled app config defaults - #298

Merged
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:arbrandes/default-app-config
Aug 28, 2026
Merged

feat: add App.defaultConfig for bundled app config defaults#298
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:arbrandes/default-app-config

Conversation

@arbrandes

Copy link
Copy Markdown
Contributor

Description

App.config held two unrelated kinds of value: the defaults an app author bundles with the app, and the configuration an operator supplies through site.config or the runtime config API. Because both went through one field, every key an app bundled was a key commonAppConfig could never supply, and an operator overriding a single value had to spread the app's existing config back in or silently discard the rest.

This adds an optional App.defaultConfig for the app author's values. getAppConfig resolves it below commonAppConfig, which resolves below config. The two fields are held separately, so operator-supplied configuration, including anything arriving via the runtime config API, can never write into an app's bundled defaults.

The field is additive: an app that does not set it resolves exactly as it does today. Nothing in this repository bundles app defaults, so there was nothing to migrate. The migration how-to now points app authors at defaultConfig, and ADR 0017 records the decision.

Closes #268.

LLM usage notice

Built with assistance from Claude.

@brian-smith-tcril

brian-smith-tcril commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

I do like the idea of adding the new app default config as a way to separate the concerns of "app author wants to set a default for something" and "site operator wants to override a site default for one app."

I'm now trying to think through the different configs, and it feels to me like we might be missing one:

Priority Config Purpose
0 ??? Common defaults
1 App.defaultConfig App defaults
2 commonAppConfig Operator provided common
3 config Operator provided app-specific

I know we have non-app "common" defaults in site config, and maybe that's a better place for anything that would fall into the "???" category to live, but I figured it was worth raising.

@arbrandes

Copy link
Copy Markdown
Contributor Author

@brian-smith-tcril

non-app "common" defaults

That doesn't exist at the level of frontend-base or apps. It's something for the site, and we already have a place for it: commonAppConfig.

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

We do have non-app "common" defaults (in the optional section of SiteConfig)

accessTokenCookieName: 'edx-jwt-cookie-header-payload',

What we don't have are common app defaults. I don't see not having those as something that should block this PR, and I don't see an immediate need for it, but I wanted to open a discussion about it.

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couple notes on the ADR but overall this looks great!

Comment thread docs/decisions/0017-bundled-app-config-defaults.rst Outdated
Comment thread docs/decisions/0017-bundled-app-config-defaults.rst Outdated
defaultConfig now holds the author's values and resolves below
commonAppConfig, which resolves below config; it is optional, so an app
that doesn't set it resolves exactly as before.

Co-Authored-By: Claude <noreply@anthropic.com>
@arbrandes
arbrandes force-pushed the arbrandes/default-app-config branch from 29158d8 to 48ed704 Compare August 28, 2026 16:34
@arbrandes
arbrandes enabled auto-merge (rebase) August 28, 2026 16:35
@arbrandes
arbrandes merged commit 97241fe into openedx:main Aug 28, 2026
5 checks passed
@arbrandes
arbrandes deleted the arbrandes/default-app-config branch August 28, 2026 16:37
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0-alpha.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App.config conflates bundled defaults with operator config

3 participants