-
Notifications
You must be signed in to change notification settings - Fork 5
Support snapshot builds #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t-payload.js I already adjusted it at some stage, but forgot that I had manually modified the output of the `get-webhook-event-payload.js` script in my tests, and it was therefore lacking the `id` and `action` lines. Signed-off-by: Johannes Schindelin <[email protected]>
Apparently the `workspaceRoot` variable is no longer suggested (even if it seems to work), but `workspaceFolder` is. Signed-off-by: Johannes Schindelin <[email protected]>
The idea is that that the `upload-snapshot` workflow is triggered as soon as the last `git-artifacts-*` check run has completed. Let's make it easy on myself by taking an existing webhook event that was delivered and that ideally should have triggered all that, and then develop the relevant code leaning heavily on VS Code's debugger. Signed-off-by: Johannes Schindelin <[email protected]>
ab5000e
to
660b44f
Compare
660b44f
to
042ad6e
Compare
The `tag-git` workflow can be used to handle Git for Windows' snapshots via the `snapshot` Boolean that is part of its inputs. The idea is that once that workflow has completed, the `git-artifacts` workflow runs are triggered automatically via GitForWindowsHelper, one per supported CPU architecture. Now this commit introduces the logic to trigger the `upload-snapshot` workflow once all of those `git-artifacts` runs completed successfully. Naturally, we have to be careful to do this only when the snapshot has not yet been uploaded, and only when the snapshot is built from a commit that is actually on git-for-windows/git's default branch. Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
When a new commit is pushed to Git for Windows' default branch, we either need to trigger a new snapshot build (namely when the `tag-git` workflow has not yet run on that commit) or upload the snapshot (this is the case when a new Git for Windows has been branch-deployed in a PR and the PR is now "merged" by pushing its tip to `main`). Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
042ad6e
to
f4eee78
Compare
if (!match) throw new Error( | ||
`Could not parse 'summary' attribute of check-run ${req.body.check_run.id}: ${output.summary}` | ||
) | ||
const [, ver, commit, tagGitWorkflowRunID] = match |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen this syntax before (the leading empty ,
).. is it intentional?
const [, ver, .....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this skips the match[0]
, which would be the entire matched string (I only need the capturing groups).
const needle = | ||
`Build Git ${ver} artifacts from commit ${commit} (tag-git run #${tagGitWorkflowRunID})` | ||
const latest = runs | ||
.filter(run => run.output.summary === needle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filtering feels fragile. Is this the best (only, I suspect 😢) way to filter runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is no other way, really. I use the title
, summary
and output
to "store" information that links those workflow runs together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record: The summary
is specified in the git-artifacts
workflow.
For almost eight years, Git for Windows' snapshots were hosted at https://wingit.blob.core.windows.net/files/index.html, i.e. on Azure Blobs. As of a combination of PRs [*1*], [*2*], snapshots are not only now built and deployed via GitHub Actions instead of Azure Pipelines (and ARM64 artifacts are now included, too), they are also hosted on GitHub [*3*], with the main page being hosted on GitHub Pages [*4*]. Therefore, the original link now redirects to a new location (which is also a lot easier to remember): http://gitforwindows.org/git-snapshots. Let's adjust the link to link there directly. References: *1*: git-for-windows#109 *2*: git-for-windows/gfw-helper-github-app#117 *3*: https://github.com/git-for-windows/git-snapshots/releases/ *4*: https://github.com/git-for-windows/git-snapshots/commits/gh-pages Signed-off-by: Johannes Schindelin <[email protected]>
For almost eight years, Git for Windows' snapshots were hosted at https://wingit.blob.core.windows.net/files/index.html, i.e. on Azure Blobs. As of a combination of PRs [*1*], [*2*], snapshots are not only now built and deployed via GitHub Actions instead of Azure Pipelines (and ARM64 artifacts are now included, too), they are also hosted on GitHub [*3*], with the main page being hosted on GitHub Pages [*4*]. Therefore, the original link now redirects to a new location (which is also a lot easier to remember): http://gitforwindows.org/git-snapshots. Let's adjust the link to link there directly. References: *1*: git-for-windows#109 *2*: git-for-windows/gfw-helper-github-app#117 *3*: https://github.com/git-for-windows/git-snapshots/releases/ *4*: https://github.com/git-for-windows/git-snapshots/commits/gh-pages Signed-off-by: Johannes Schindelin <[email protected]>
For almost eight years, Git for Windows' snapshots were hosted at https://wingit.blob.core.windows.net/files/index.html, i.e. on Azure Blobs. As of a combination of PRs [*1*], [*2*], snapshots are not only now built and deployed via GitHub Actions instead of Azure Pipelines (and ARM64 artifacts are now included, too), they are also hosted on GitHub [*3*], with the main page being hosted on GitHub Pages [*4*]. Therefore, the original link now redirects to a new location (which is also a lot easier to remember): http://gitforwindows.org/git-snapshots. Let's adjust the link to link there directly. References: *1*: git-for-windows/git-for-windows-automation#109 *2*: git-for-windows/gfw-helper-github-app#117 *3*: https://github.com/git-for-windows/git-snapshots/releases/ *4*: https://github.com/git-for-windows/git-snapshots/commits/gh-pages Note that technically, we could alternatively delete the `render_release_notes_and_mail` function from `please.sh`, as it was only used in the Azure Pipeline that is no longer triggered to build the snapshots. Let's leave the code there for a bit longer, though. Signed-off-by: Johannes Schindelin <[email protected]>
For almost eight years, Git for Windows' snapshots were hosted at https://wingit.blob.core.windows.net/files/index.html, i.e. on Azure Blobs. As of a combination of PRs [*1*], [*2*], snapshots are not only now built and deployed via GitHub Actions instead of Azure Pipelines (and ARM64 artifacts are now included, too), they are also hosted on GitHub [*3*], with the main page being hosted on GitHub Pages [*4*]. Therefore, the original link now redirects to a new location (which is also a lot easier to remember): http://gitforwindows.org/git-snapshots. Let's adjust the link to link there directly. References: *1*: git-for-windows/git-for-windows-automation#109 *2*: git-for-windows/gfw-helper-github-app#117 *3*: https://github.com/git-for-windows/git-snapshots/releases/ *4*: https://github.com/git-for-windows/git-snapshots/commits/gh-pages Signed-off-by: Johannes Schindelin <[email protected]>
The `SECURITY.md` document mentions Git for Windows' snapshots and helpfully provides a link. For almost eight years, these snapshots were hosted at https://wingit.blob.core.windows.net/files/index.html, i.e. on Azure Blobs. As of a combination of PRs [*1*], [*2*], snapshots are not only now built and deployed via GitHub Actions instead of Azure Pipelines (and ARM64 artifacts are now included, too), they are also hosted on GitHub [*3*], with the main page being hosted on GitHub Pages [*4*]. Therefore, the original link now redirects to a new location (which is also a lot easier to remember): http://gitforwindows.org/git-snapshots. Let's adjust the link to link there directly. References: *1*: git-for-windows/git-for-windows-automation#109 *2*: git-for-windows/gfw-helper-github-app#117 *3*: https://github.com/git-for-windows/git-snapshots/releases/ *4*: https://github.com/git-for-windows/git-snapshots/commits/gh-pages Signed-off-by: Johannes Schindelin <[email protected]>
The `SECURITY.md` document mentions Git for Windows' snapshots and helpfully provides a link. For almost eight years, Git for Windows' snapshots were hosted [on Azure Blobs](https://wingit.blob.core.windows.net/files/index.html). As of a combination of PRs (git-for-windows/git-for-windows-automation#109, git-for-windows/gfw-helper-github-app#117), snapshots are not only now built and deployed via GitHub Actions instead of Azure Pipelines (and ARM64 artifacts are now included, too), they are also hosted [on GitHub](https://github.com/git-for-windows/git-snapshots/releases/), with the main page being hosted [on GitHub Pages](https://github.com/git-for-windows/git-snapshots/commits/gh-pages). Therefore, the original link now redirects to a new location (which is also a lot easier to remember): http://gitforwindows.org/git-snapshots. Let's adjust the link to link there directly. This is a companion PR of git-for-windows/git-for-windows-automation#111 and of git-for-windows/build-extra#589.
This PR corresponds to git-for-windows/git-for-windows-automation#109, concluding the migration of Git for Windows' snapshot builds from being built via the
GitArtifacts
Azure Pipeline to a combination of GitHub workflows and an orchestration in a GitHub App (concretely, this here GitForWindowsHelper GitHub App).It implements the logic to run the
tag-git
workflow onpush
unless there is already atag-git
check run attached to thegit-for-windows/git
commit.If there already is one, then the
upload-snapshot
workflow needs to be triggered (uploading already-released Git for Windows versions, which is the scenario wheretag-git
check runs already exist).And GitForWindowsHelper also needs to learn to react to completed
git-artifacts
snapshot check runs ongit-for-windows/git
, triggering theupload-snapshot
workflow also in that case. It needs to be careful, though, to verify that this is wanted, by having a peek atgit-for-windows/git-artifacts
' releases to see whether a corresponding tag already exists, and also by doing anahead
check to see whether the corresponding commit is actually reachable fromgit-for-windows/git
'smain
branch: We do not want any snapshots to be uploaded when they correspond to a random topic branch that will never be merged.