Skip to content

slash-commands: add /snapshot command#211

Merged
dscho merged 1 commit intomainfrom
snapshot-slash-command
Apr 30, 2026
Merged

slash-commands: add /snapshot command#211
dscho merged 1 commit intomainfrom
snapshot-slash-command

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Apr 28, 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). 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).

Add a /snapshot slash command for git-for-windows/git PRs. It triggers
the tag-git workflow with the PR's temporary merge commit and snapshot
mode enabled, cascading into git-artifacts builds for all architectures.

Because the merge commit is not on the main branch, the cascading-runs
safeguard (which checks ahead_by > 0) prevents upload-snapshot from
being triggered. This makes /snapshot safe to use for testing PRs
without publishing to git-snapshots.

The implementation closely follows /git-artifacts but uses the PR's
merge_commit_sha (from the GitHub Pull Request API) instead of the
tip commit, and passes snapshot: 'true' instead of 'false'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Copy Markdown
Member Author

dscho commented Apr 28, 2026

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)

For the record, in the example I mentioned there, I actually did single step through this proposed code in VS Code, and let it give a thumbs-up (and in the first, failed run, a frownie), and then trigger the workflow run (without the changes of git-for-windows/git-for-windows-automation#168, of course, hence the "Validate the installer" comment).

dscho added a commit to git-for-windows/git-for-windows-automation that referenced this pull request Apr 30, 2026
When [building
snapshots](git-for-windows/git#6215 (comment))
(via the not-yet-deployed `/snapshot` command) for PRs (as opposed to
release candidates or full releases), the ["Validate the installer
manually"
comment](git-for-windows/git#6215 (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](git-for-windows/gfw-helper-github-app#211)
that will trigger snapshot builds from a PR's merge commit.
@dscho dscho merged commit f760800 into main Apr 30, 2026
1 check passed
@dscho dscho deleted the snapshot-slash-command branch April 30, 2026 07:35
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.

2 participants