fix: fetch PR head history for Lunaria builds#708
Merged
IEvangelist merged 2 commits intomainfrom Apr 13, 2026
Merged
Conversation
Fetch the PR head ref in the reusable frontend workflow before the Lunaria build so PR merge checkouts stop falling back to shallow history for new docs pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the reusable frontend-build workflow to ensure Lunaria can access PR head history during PR merge checkouts by explicitly fetching the PR head ref before building.
Changes:
- Add an optional
pull_numberinput to the reusablefrontend-buildworkflow. - For PR runs, fetch
refs/pull/<n>/head(attempting--unshallowfirst) to make PR head history available to Lunaria. - Pass the PR number from
ci.ymlinto the reusable workflow when the event ispull_request.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/frontend-build.yml | Adds pull_number input and PR-aware git fetch logic to ensure Lunaria sees PR head history. |
| .github/workflows/ci.yml | Wires github.event.pull_request.number into the reusable frontend workflow for PR runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Validate the reusable workflow pull number input, use a clearer remote-tracking ref namespace, and avoid suppressing real fetch failures while still handling shallow PR merge checkouts correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Addressed the review feedback in the latest push:
The guarded fetch path still reproduces correctly against the known failing PR shapes (#701 and #705): shallow |
davidfowl
approved these changes
Apr 13, 2026
JamesNK
pushed a commit
that referenced
this pull request
Apr 16, 2026
Fetch the PR head ref in the reusable frontend workflow before the Lunaria build so PR merge checkouts stop falling back to shallow history for new docs pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JamesNK
pushed a commit
that referenced
this pull request
Apr 21, 2026
Fetch the PR head ref in the reusable frontend workflow before the Lunaria build so PR merge checkouts stop falling back to shallow history for new docs pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Follow up to #707 by fetching the PR head ref in the reusable frontend workflow before the Lunaria build.
Why
The earlier
git fetch --unshallowchange was necessary, but not sufficient for all pull request checkouts. We still have failingfrontend-buildruns where Lunaria logs:and then fails on a newly added docs page such as:
/src/frontend/src/content/docs/get-started/faq.mdxin Add FAQ page and homepage FAQ link #701/src/frontend/src/content/docs/deployment/environments.mdxin Add environments documentation guide #705Root cause
On some PR merge checkouts (
refs/pull/<n>/merge), Lunaria still sees the repository as shallow and switches into its fallback history path. That path cannot resolve git history for docs pages that only exist on the PR branch.Fix
When this reusable workflow is running for a pull request, fetch:
explicitly, with
--unshallow, before the frontend build. This makes the PR head history available even when the checkout was created from the merge ref.For non-PR builds, keep the existing
git fetch --unshallowfallback.Validation
Simulated PR merge checkouts for the known failing cases:
true->false,faq.mdxhistory restoredtrue->false,environments.mdxhistory restored