Repository navigation
🐛 Report the real PR title, head commit, and author on GitHub pull_request runs - #369
Merged
Merged
Conversation
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.
Why
On GitHub Actions
pull_requestruns,actions/checkoutchecks out the throwaway merge commit GitHub builds atrefs/pull/N/merge. We already read the real head SHA from the event payload, but the commit message and build name still came from that merge commit. So every PR build showed up in Vizzly asMerge <sha> into <sha>and was namedHEAD-<sha>. In production that's about 11k builds with the merge message and 6k with theHEAD-name, across customer projects too.What changed
The CLI now resolves the build's commit once and describes everything from it. On GitHub PR runs, the commit message is the PR title, which matches what the squash-merged build on
mainshows later.VIZZLY_COMMIT_MESSAGEstill wins. Outside that case, the message and author are read from the resolved head SHA withgit log, and fall back toHEADwhen a shallow clone doesn't have the SHA locally.Build names are now generated from the CI-aware branch and commit detectors, so PR builds get
<head-branch>-<head-sha7>instead ofHEAD-<merge-sha7>.Builds also send
commit_author_nameandcommit_author_email, withVIZZLY_COMMIT_AUTHOR_NAME/VIZZLY_COMMIT_AUTHOR_EMAILoverrides and GitLab'sCI_COMMIT_AUTHOR. The Vizzly app uses the email to match the build to an organization member for a new "Your builds" dashboard section. It doesn't store the email itself.What we found
GitHub's synthetic merge commit keeps the PR head commit's author, so even a depth-1 checkout has the right author on
HEAD. The event payload has the PR title but no head commit message, which is why the title is the reliable source on shallow clones.Risk
The payload fields are additive and only sent when present. The server already accepted unknown build fields, and vizzly-testing/vizzly#843 starts using them. The new tests build a real repo shaped like GitHub's merge checkout (head commit present and missing), and the CI env tests now share one helper that clears CI variables, so they behave the same when run on Actions. The full suite, lint and type tests pass.
Follow-up
The Storybook, static-site and Swift clients create builds through
services.git.detect()inplugin-api.js, so they don't send the author yet.