Skip to content

git-artifacts: post snapshot-specific PR comments#168

Merged
dscho merged 1 commit into
mainfrom
snapshot-aware-pr-comments
Apr 30, 2026
Merged

git-artifacts: post snapshot-specific PR comments#168
dscho merged 1 commit into
mainfrom
snapshot-aware-pr-comments

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Apr 28, 2026

When building snapshots (via the not-yet-deployed /snapshot command) for PRs (as opposed to release candidates or full releases), the "Validate the installer manually" comment is misleading.

To help with this, the changes in this PR pipe the SNAPSHOT flag from tag-git.yml through bundle-artifacts/ so that git-artifacts.yml can post a different comment for snapshot builds, linking directly to the installer and Portable Git artifacts for x86_64 and aarch64.

This prepares for a /snapshot slash command in the gfw-helper-github-app repository that will trigger snapshot builds from a PR's merge commit.

When building snapshots for PRs (as opposed to release candidates or
full releases), the "Validate the installer manually" comment is
misleading because snapshot builds do not need pre-flight validation. A
future /snapshot slash command (to be implemented in the
gfw-helper-github-app repository) will trigger snapshot builds from a
PR's merge commit, and those builds need a different kind of feedback.

To let git-artifacts distinguish snapshots from releases, pipe the
SNAPSHOT flag (already available in tag-git.yml from its
workflow_dispatch input) through the bundle-artifacts directory. The
git-artifacts workflow reads it into the IS_SNAPSHOT environment
variable.

With this flag available, the existing "validate installer" step is
guarded behind IS_SNAPSHOT != 'true' so it only fires for release
builds. A new step posts a "Snapshot artifacts" comment instead, linking
directly to the installer and Portable Git artifacts for each
architecture (x86_64 and aarch64, skipping i686 which is no longer
advertised).

When multiple snapshot builds are requested on the same PR, each gets
its own comment block. The step iterates through all PR comments,
resetting when it sees a /snapshot command and tracking the last bot
comment containing "Snapshot artifacts" after that separator. This
avoids editing stale comments from prior snapshot requests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Apr 28, 2026
@dscho dscho requested review from mjcheetham and rimrul April 28, 2026 21:52
@dscho dscho marked this pull request as ready for review April 28, 2026 21:55
@dscho dscho merged commit 25ca4d2 into main Apr 30, 2026
@dscho dscho deleted the snapshot-aware-pr-comments branch April 30, 2026 07:33
dscho added a commit to git-for-windows/gfw-helper-github-app that referenced this pull request Apr 30, 2026
When working on changes to Git for Windows, it is often useful to build
a complete set of artifacts (installer, Portable Git, MinGit) to
validate a fix before merging (e.g. [in this
PR](git-for-windows/git#6215 (comment))).
Currently, building such artifacts requires either merging to `main`
first (which triggers automatic snapshot builds) or manually dispatching
the `tag-git` workflow with the right parameters.

A `/snapshot` slash command on PRs makes this workflow much more
accessible: trusted contributors and maintainers can simply comment
`/snapshot` on a PR to get a full set of build artifacts for the PR's
current state, without merging.

The command uses the PR's temporary merge commit (so the artifacts
reflect what will land on `main`, not just the topic branch in
isolation) and passes `snapshot: true` to the `tag-git` workflow. The
existing safeguard in `cascading-runs.js` that checks whether the commit
is on `main` prevents any upload to the `git-snapshots` repository, so
this is safe to use on any PR.

Depends on
git-for-windows/git-for-windows-automation#168
for snapshot-aware PR comments (linking artifacts instead of asking to
validate the installer).
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