Skip to content

Add pull request viewer previews - #22090

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:viewer-preview
Oct 6, 2026
Merged

calixteman merged 1 commit into
mozilla:masterfrom
calixteman:viewer-preview

Conversation

@calixteman

Copy link
Copy Markdown
Contributor

Build generic and generic-legacy viewers and report results on the PR. Publish to pdf.js.refs for authors with write access or commits approved with the viewer-preview label. Remove previews on PR closure and prune stale previews during publication.

Build generic and generic-legacy viewers and report results on the PR.
Publish to pdf.js.refs for authors with write access or commits approved
with the viewer-preview label. Remove previews on PR closure and prune
stale previews during publication.
@calixteman calixteman added To Review For PRs to review after they've been merged (for example when reviewers are off). infra Infrastructure related labels Oct 6, 2026
@codecov-commenter

codecov-commenter commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 90.28%. Comparing base (c1be1c9) to head (5b666ff).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #22090   +/-   ##
=======================================
  Coverage   90.28%   90.28%           
=======================================
  Files         269      269           
  Lines       67362    67362           
=======================================
  Hits        60819    60819           
  Misses       6543     6543           
Flag Coverage Ξ”
unittestcli 58.39% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@calixteman
calixteman merged commit 5915a9d into mozilla:master Oct 6, 2026
13 checks passed
@calixteman
calixteman deleted the viewer-preview branch October 6, 2026 16:44

@timvandermeij timvandermeij left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good overall, with a number of comments for consideration.

- name: Remove the viewers
env:
GH_TOKEN: ${{ steps.refs-token.outputs.token }}
run: bash .github/scripts/viewer-preview/publish-pages.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Given that the shell scripts already have bash in their shebang, it seems a bit nicer if we could give them the executable bit and then just run them here so that the fact that we invoke bash specifically is only encoded in a single place.

github.event.action == 'closed'
runs-on: ubuntu-latest
environment:
name: sync_pdfs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this the correct environment given that we don't actually sync PDF files here? If so, we might want to consider renaming it.

if: steps.artifact.outputs.found == 'true'
id: check
run: |
set -euo pipefail

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is quite a large script, so it would benefit from some small one-line guiding comments for the various stages of validation we perform here to make the flow clearer. Alternatively maybe split it up into a few smaller workflows steps, or even extract the (larger) shell scripts into separate files that we just invoke here (this could make the workflow definitions smaller and thus easier to oversee).

: "${PREVIEW_REPO:?}"
: "${PR:?}"
[[ "$PR" =~ ^[1-9][0-9]*$ ]] || { echo "::error::Invalid PR number: $PR"; exit 1; }
command -v jq >/dev/null || { echo "::error::jq is required"; exit 1; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it necessary to check this? jq is quite common, and in the GitHub Actions context always available AFAIK, and even if it's not the error messages one gets will probably be clear enough anyway.

done
}

for attempt in 1 2 3 4 5; do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Using a sequence expression would be a little bit nicer here: for i in {1..5}; do

if [ -n "$base" ]; then
prune
fi
touch .nojekyll

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is this for, since we don't use Jekyll?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Infrastructure related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants