8000 Share theme-resources.ftl via ThemeResourceProvider by edewit · Pull Request #55518 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Share theme-resources.ftl via ThemeResourceProvider - #55518

Open
edewit wants to merge 2 commits into
keycloak:mainfrom
edewit:issue-55514-share-theme-resources-ftl
Open

edewit wants to merge 2 commits into
keycloak:mainfrom
edewit:issue-55514-share-theme-resources-ftl

Conversation

@edewit
@edewit edewit commented Nov 25, 2026
Copy link
Copy Markdown
Contributor

Closes #55514

Product builds skip resources-community, so admin and account consoles could not resolve theme-resources.ftl. Serve a single shared copy from theme-resources/templates (ThemeResourceProvider fallback) instead of duplicating it under each theme type.

Decisions and assumptions:

  • Theme types do not share a parent hierarchy, so a shared ThemeResourceProvider template is the right way to avoid per-type copies.
  • Custom themes can still override by shipping their own theme-resources.ftl.
  • Assisted by an AI coding agent.

Product builds skip resources-community, so admin and account consoles
failed to find theme-resources.ftl. Serve one shared copy from
theme-resources/templates instead of duplicating it per theme type.

Closes keycloak#55514

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
@edewit
edewit marked this pull request as ready for review November 25, 2026 09:44
@edewit
edewit requested review from a team as code owners November 25, 2026 09:44
Copilot AI balanced review requested due to automatic review settings November 25, 2026 09:44
Copilot AI 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.

🟡 Changes recommended

The test bypasses ThemeResourceProvider registration and fallback, leaving the missing-template regression and custom-theme precedence without regression coverage.

1 open issue
What changed in this PR

This PR addresses #55514 by relying on the existing shared ThemeResourceProvider template, allowing a 8000 dmin and account consoles to load when community resources are excluded from product builds.

Changes:

  • Removes four duplicate theme-local macro templates.
  • Updates the macro-rendering unit test to load the shared template.
  • Replaces the shared template’s synchronization comment with a description of its role.
File Description
themes/​src/​main/​resources/​theme/​base/​login/​theme-resources.ftl Removes the standard login copy.
themes/​src/​main/​resources-community/​theme/​base/​login/​theme-resources.ftl Removes the community login copy.
themes/​src/​main/​resources-community/​theme/​base/​admin/​theme-resources.ftl Removes the community admin copy.
themes/​src/​main/​resources-community/​theme/​base/​account/​theme-resources.ftl Removes the community account copy.
services/​src/​test/​java/​org/​keycloak/​theme/​ThemeResourcesMacrosTest.java Loads macros from the shared template path.
services/​src/​main/​resources/​theme-resources/​templates/​theme-resources.ftl Clarifies the shared template’s purpose in a comment.

Review effort: Balanced

Configuration cfg = new Configuration(Configuration.VERSION_2_3_32);
cfg.setOutputFormat(HTMLOutputFormat.INSTANCE);
cfg.setClassLoaderForTemplateLoading(getClass().getClassLoader(), "theme/base/login");
cfg.setClassLoaderForTemplateLoading(getClass().getClassLoader(), "theme-resources/templates");
Cover ThemeResourceProvider fallback for login, admin, and account, and
verify a custom theme-local copy still takes precedence.

Closes keycloak#55514

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 10:09
Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the change to shared theme-template resolution.

1 open issue

Review effort: Balanced

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.

Admin and account consoles fail in product builds: theme-resources.ftl not found

2 participants

0