From 6b9f5eea961c60ece396e768b002b42eb9c3c932 Mon Sep 17 00:00:00 2001 From: Matysh Date: Thu, 27 Aug 2026 11:04:38 +0300 Subject: [PATCH] ci: support legacy performance baselines Issue: #322 User-Visible: no --- .github/workflows/performance.yml | 9 ++++++++- docs/DEVELOPMENT.md | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 5c597c77..863d5b3d 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -149,7 +149,14 @@ jobs: npm --prefix candidate run build (cd candidate && node scripts/bundle-sync.mjs) npm --prefix baseline run build - (cd baseline && node scripts/bundle-sync.mjs) + if [ -f baseline/scripts/bundle-sync.mjs ]; then + (cd baseline && node scripts/bundle-sync.mjs) + else + echo "::notice::The comparison base predates bundle-sync.mjs; materializing its freshly built bundle with the legacy copy path." + mkdir -p baseline/custom_components/houseplan/frontend baseline/demo/srv/assets + cp baseline/dist/houseplan-card.js baseline/custom_components/houseplan/frontend/houseplan-card.js + cp baseline/dist/houseplan-card.js baseline/demo/srv/assets/houseplan-card.js + fi - name: Capture base and candidate profiles working-directory: candidate diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 8a8c5df7..6094fc1f 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -152,6 +152,10 @@ on one pinned Chromium/CI profile, applies relative and absolute budgets, and uploads both reports plus the comparison. A developer-laptop report remains a diagnostic and must not be used to loosen CI limits. See `demo/performance/README.md`. +When the comparison base predates `scripts/bundle-sync.mjs`, the workflow still +builds that exact tree and materializes its fresh bundle through the equivalent +legacy copy path. This keeps old stable releases usable as performance baselines +without borrowing build output from the candidate. Both browser diagnostics require a freshly built/copied demo bundle. Rollup embeds a SHA-256 fingerprint of `src/` plus the locked package and Rollup/TypeScript build inputs; benchmark/golden runners fail before