ci: deploy PR preview for report-pipeline changes too#240
Merged
Conversation
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.
There was a problem hiding this comment.
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_changesregex sometadata.jsonchanges trigger previews correctly. - Extend preview triggering to include report pipeline scripts (
report.sh,aggregate.sh) and*.html.tmpltemplate changes. - Update step naming/messages to reflect broader preview rebuild criteria.
- .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))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Deploy PR Previewjob inpr-ci.ymlrebuilds and deploys the report only when itscheck_changesstep sees a submission-data diff. Its matcher was:Two consequences:
report.sh, theaggregate.shstep, or the*.html.tmpltemplates) produces no submission diff, sohas_changes=falseand 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 a404atpr-239/.)metadata.json..*\.(…|metadata\.json)requires a literal.immediately beforemetadata, but the file is preceded by/(.../<dir>/metadata.json), so ametadata.json-only change never triggered a preview either — contrary to the step's own comment (".uplcormetadata.json").Change
Widen and correct the matcher:
metadata.jsonnow matches (regrouped so the alternation carries its own leading separator).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 (viatreefmt) reports no formatting changes.