Skip to content

ci: deploy PR preview for report-pipeline changes too#240

Merged
Unisay merged 2 commits into
mainfrom
yura/preview-pipeline-changes
Jul 9, 2026
Merged

ci: deploy PR preview for report-pipeline changes too#240
Unisay merged 2 commits into
mainfrom
yura/preview-pipeline-changes

Conversation

@Unisay

@Unisay Unisay commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Deploy PR Preview job in pr-ci.yml rebuilds and deploys the report only when its check_changes step sees a submission-data diff. Its matcher was:

submissions/.*\.(uplc|metadata\.json)$

Two consequences:

  1. A PR that touches only the report pipeline (the generator report.sh, the aggregate.sh step, or the *.html.tmpl templates) produces no submission diff, so has_changes=false and the whole build+deploy is skipped — no hosted preview. That is exactly the kind of change where a visual preview matters most. (Surfaced while reviewing report: per-submission breakdown of measurements and checks (#231) #239, whose green CI produced a 404 at pr-239/.)
  2. The pattern never actually matched metadata.json. .*\.(…|metadata\.json) requires a literal . immediately before metadata, but the file is preceded by / (.../<dir>/metadata.json), so a metadata.json-only change never triggered a preview either — contrary to the step's own comment (".uplc or metadata.json").

Change

Widen and correct the matcher:

submissions/.*(\.uplc|/metadata\.json)$|scripts/cape-subcommands/submission/(report|aggregate)\.sh$|scripts/cape-subcommands/submission/.*\.html\.tmpl$
  • metadata.json now matches (regrouped so the alternation carries its own leading separator).
  • Report-pipeline files now trigger a preview.
  • Unchanged: metrics.json (regenerated by the measure step) and docs/README still do not trigger, so docs-only PRs stay cheap.

Cost note

A report-pipeline PR now runs the full measure --all + measure --preview + report --all + deploy path, same as a submission-data PR. That is the intended tradeoff: a pipeline change that can alter every page should be previewable.

Verified the regex against representative paths (.uplc, metadata.json, metrics.json, report.sh, aggregate.sh, *.html.tmpl, measure.sh, README.md) and confirmed prettier (via treefmt) reports no formatting changes.

The PR preview job only rebuilt and deployed the report when a PR changed
submission data (*.uplc / metadata.json). A PR that changes only the report
pipeline — the generator, the aggregate step, or the HTML templates — produced
no submission diff, so it got no hosted preview, even though it can change
every rendered page. Widen the trigger to also fire on
scripts/cape-subcommands/submission/{report,aggregate}.sh and *.html.tmpl.

Also fix the existing submission-data pattern: `submissions/.*\.(uplc|metadata\.json)$`
required a literal dot before `metadata`, so a metadata.json-only change (preceded
by `/`, not `.`) never matched and never triggered a preview, contrary to the
step's stated intent. Regroup as `submissions/.*(\.uplc|/metadata\.json)$` so both
inputs match.
@Unisay Unisay requested a review from Copilot July 9, 2026 11:22
@Unisay Unisay self-assigned this Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the PR preview deployment logic so that report previews are rebuilt not only for submission data changes, but also for report-pipeline changes (generator scripts and HTML templates), ensuring pipeline-only PRs still get a hosted preview.

Changes:

  • Fix and widen the check_changes regex so metadata.json changes trigger previews correctly.
  • Extend preview triggering to include report pipeline scripts (report.sh, aggregate.sh) and *.html.tmpl template changes.
  • Update step naming/messages to reflect broader preview rebuild criteria.

Comment thread .github/workflows/pr-ci.yml
Comment thread .github/workflows/pr-ci.yml Outdated
- .github/workflows/pr-ci.yml:145 — fetch origin/main before diffing so the preview job doesn't hit an ambiguous revision (#240 (comment))
- .github/workflows/pr-ci.yml:150 — reword else message and quote "$GITHUB_OUTPUT" for accuracy and consistency (#240 (comment))
@Unisay Unisay merged commit a1bd388 into main Jul 9, 2026
6 checks passed
@Unisay Unisay deleted the yura/preview-pipeline-changes branch July 9, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants