Visitar URL original
website-comment: add per-pull-request website preview actions by potiuk · Pull Request #1332 · apache/infrastructure-actions · GitHub
Skip to content

website-comment: add per-pull-request website preview actions - #1332

Open
potiuk wants to merge 4 commits into
apache:mainfrom
potiuk:pr-preview
Open

potiuk wants to merge 4 commits into
apache:mainfrom
potiuk:pr-preview

Conversation

@potiuk

@potiuk potiuk commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Composite actions that publish an armed pull request's built site to <site>-pr<N>.staged.apache.org, with a review overlay that turns a marked region into a screenshot and a link to its diff line. Extracted from apache/magpie-site (in sync up to #219), with generic names.

  • preview-annotate stamps source lines for Jekyll and Astro builds.
  • preview-artifact packages any static site, plus the diff-line anchors computed in the unprivileged build.
  • preview-publish publishes, retires and cleans up. A PR is armed by the preview label (added directly, by a /show-preview comment, or by dispatch), and the publisher runs on workflow_run / issue_comment, never pull_request_target. Every GitHub response is projected, so it never reads PR content.
  • preview-main-overlay (optional) puts the same overlay on the published site, where a comment opens an issue.

Test plan

  • npm test in website-comment/ (163 tests, including boundary.test.mjs: a full publisher run against baited responses and an endpoint allowlist)
  • website-comment-test.yml: Jekyll adapter end to end (on ubuntu-slim, Ruby from apt), preview-main-overlay on a small site, and preview-publish refusing a pull_request event
  • uv run pytest scripts/test_release_actions.py

🤖 Generated with Claude Code

Three composite actions that publish an armed pull request's built site
to <site>-pr<N>.staged.apache.org, with a review overlay that turns a
marked region into a screenshot and a link to its diff line.

preview-annotate stamps source lines for Jekyll and Astro builds;
preview-artifact packages any static site; preview-publish publishes,
retires and cleans up. Extracted from apache/magpie-site, with
generic names.

Generated-by: Claude Opus 5
@potiuk

potiuk commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

Extracted it from Magpie work - while working on new website, I developed this action/tooling that makes PR to the website possible to render on staging system of ASF and select areas of the website and get the comments back to the actual lines of code in PR that created it.

Screenshot 2026-09-27 at 18 48 44

How it looks like after selecting the part of the website:

Screenshot 2026-09-27 at 21 14 06

And then you get redirected to the line in the PR that produced the selected part -> and you can ctrl+v the screenshot with the area selected.

Ports apache/magpie-site apache#208, apache#210, apache#212 and apache#214 onto the extracted
actions, keeping the generic names:

- Arm with the `preview` label (a /show-preview comment or a dispatch
  adds it); publish on workflow_run / issue_comment, not a schedule.
- Project every GitHub response so the publisher never reads PR
  content; the build computes the diff anchors (write-meta.mjs).
- Post a new comment on each publish, and lead with the preview URL.
- New preview-main-overlay action: the overlay on the published site,
  where a comment opens an issue.

Generated-by: Claude Opus 5
@potiuk

potiuk commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

Updated screenshots from Magpie new site - also works on published site - not only on PR:

Screenshot 2026-09-29 at 06 05 22

The actions keep their names and tag prefixes; only the path changes,
to website-comment/<action>.

Generated-by: Claude Opus 5
@potiuk potiuk changed the title pr-preview: add per-pull-request website preview actions website-comment: add per-pull-request website preview actions Sep 29, 2026
Ports apache/magpie-site apache#211: ubuntu-slim cannot start a job
container, so Ruby, Bundler and a C toolchain come from apt and gems go
to a writable user gem home instead of the pinned ruby:3.3 image.

Generated-by: Claude Opus 5
@potiuk

potiuk commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Gentle ping @dfoulks1 @ppkarwasz - this has been waiting for review for a while; CI is green. A quick look would be appreciated.


Drafted-by: Claude Code (Opus 5.5); reviewed by @potiuk before posting

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.

1 participant