From ba8ff011b947f646186ee8747c56bf863fd7b387 Mon Sep 17 00:00:00 2001 From: Yura Lazarev Date: Thu, 9 Jul 2026 13:03:16 +0200 Subject: [PATCH 1/2] ci: deploy PR preview for report-pipeline changes too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/pr-ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 76345248..dee7298f 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -134,15 +134,19 @@ jobs: with: fetch-depth: 0 - - name: Check if submission data changed + - name: Check if the preview needs rebuilding id: check_changes run: | - # Check if .uplc or metadata.json files changed compared to main - if git diff --name-only origin/main...HEAD | grep -qE 'submissions/.*\.(uplc|metadata\.json)$'; then - echo "Submission data files changed, proceeding with report generation" + # Deploy a preview when either the report inputs (submission data) or + # the report pipeline itself (generator, aggregate, templates) change. + # A pipeline-only PR produces no submission diff but can still change + # every rendered page, so it must be previewable too. + if git diff --name-only origin/main...HEAD | grep -qE \ + 'submissions/.*(\.uplc|/metadata\.json)$|scripts/cape-subcommands/submission/(report|aggregate)\.sh$|scripts/cape-subcommands/submission/.*\.html\.tmpl$'; then + echo "Report inputs or pipeline changed, proceeding with report generation" echo "has_changes=true" >> $GITHUB_OUTPUT else - echo "No submission data changes detected (only docs/README), skipping deployment" + echo "No submission-data or report-pipeline changes detected (only docs/README), skipping deployment" echo "has_changes=false" >> $GITHUB_OUTPUT fi From 0757131f2b853ad907f3a4774378ee53e3c272a8 Mon Sep 17 00:00:00 2001 From: Yura Lazarev Date: Thu, 9 Jul 2026 13:31:17 +0200 Subject: [PATCH 2/2] address copilot review on PR #240 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .github/workflows/pr-ci.yml:145 — fetch origin/main before diffing so the preview job doesn't hit an ambiguous revision (https://github.com/IntersectMBO/UPLC-CAPE/pull/240#discussion_r3551205129) - .github/workflows/pr-ci.yml:150 — reword else message and quote "$GITHUB_OUTPUT" for accuracy and consistency (https://github.com/IntersectMBO/UPLC-CAPE/pull/240#discussion_r3551205157) --- .github/workflows/pr-ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index dee7298f..4b497e16 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -141,13 +141,17 @@ jobs: # the report pipeline itself (generator, aggregate, templates) change. # A pipeline-only PR produces no submission diff but can still change # every rendered page, so it must be previewable too. + # Fetch the base ref first: fetch-depth:0 does not guarantee a local + # origin/main, so the diff below would otherwise hit an ambiguous + # revision (same reason the `changed` job fetches it explicitly). + git fetch origin main --depth=1 if git diff --name-only origin/main...HEAD | grep -qE \ 'submissions/.*(\.uplc|/metadata\.json)$|scripts/cape-subcommands/submission/(report|aggregate)\.sh$|scripts/cape-subcommands/submission/.*\.html\.tmpl$'; then echo "Report inputs or pipeline changed, proceeding with report generation" - echo "has_changes=true" >> $GITHUB_OUTPUT + echo "has_changes=true" >> "$GITHUB_OUTPUT" else - echo "No submission-data or report-pipeline changes detected (only docs/README), skipping deployment" - echo "has_changes=false" >> $GITHUB_OUTPUT + echo "No report-affecting changes detected, skipping preview deployment" + echo "has_changes=false" >> "$GITHUB_OUTPUT" fi - name: Install Nix