← Back to Pull requests

fix(distributions): hash production asset filenames for cache busting #10273

Closed
unknown closed this pull request without merging on Oct 15, 2026 18:56 UTC
View on GitHub
unknown unknown commented on Oct 15, 2026 17:54 UTC
Author

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.js bundles over HTTP, including MaaS Portal's /maas-portal/ prefix.

Reproduce the config tests and production builds from the repository root:

for distribution in base rhaii maas-portal; do
  (cd "distributions/$distribution" && ../../node_modules/.bin/jest --silent --runInBand config/__tests__)
  pnpm --config.verify-deps-before-run=false --dir "distributions/$distribution" run build
done

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 its app.js request 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 -->

Diff: 304 lines (+228 / -76) across 3 files Reviewer: paulovmr Review duration: 62m
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
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.1% (MEDIUM) · Higher = larger blast radius
40.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.9% · Safe to merge
15.9%