fix(distributions): hash production asset filenames for cache busting #10273
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 304 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.342
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10273"
general
weight: 0.35
paulovmr
Fixes: https://redhat.atlassian.net/browse/RHOAIENG-100829
Problem
Base-backed distribution builds emit static bundle filenames such as
app.js. After an upgrade, browsers can reuse stale assets and display outdated or broken UI.Solution
Use content-hashed production filenames for entry bundles, lazy chunks, fonts, and images in base, RHAII, and MaaS Portal. Keep output naming in production configs and shared asset loader definitions in common, selecting filenames by build mode. Development filenames remain unchanged, and inline styles inherit cache busting from their JavaScript bundles.
Add local Jest config tests for each distribution and shared-loader coverage for production, development, and default mode.
Evidence
All 49 config tests pass, including nine new tests. All three production build scripts pass; generated HTML references resolve to emitted hashed bundles. Dev scripts compile without type errors and serve unhashed
app.jsbundles over HTTP, including MaaS Portal's/maas-portal/prefix.Reproduce the config tests and production builds from the repository root:
Development checks use
pnpm --config.verify-deps-before-run=false --dir distributions/base run start:dev, with the corresponding directory for RHAII and MaaS Portal. Inspect the served HTML and confirm itsapp.jsrequest returns HTTP 200. Temporary verification servers are stopped afterward.Lint passes for the affected config directories, and diff whitespace checks pass. Builds report bundle-size warnings. Repository-wide lint/type-check reruns are blocked by pnpm attempting a dependency reinstall; the commands above use the installed dependencies without triggering that reinstall.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Build Improvements
Production builds now use content-hashed filenames for bundles, lazy-loaded chunks, fonts, and other assets. This helps browsers fetch updated files after changes while keeping unchanged files cacheable.
* Development builds retain unhashed asset filenames.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->