-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor our CI workflows to use commit message trailers instead of branches to "carry" information. Currently we use branchnames like: trybot/$changeID/$commitID/$CL/$patchset when triggering trybot runs for CLs in Gerrit. We also create PRs in order to take advantage of GitHub's action caches: https://github.com/actions/cache However this approach is brittle. PRs, whilst having the advantage of being able to leverage the actions caches, regularly cause breakages. Workflows for a PR will not run if there are conflicts with respect to the target branch, nor will they run if there is not connection between the commit at the tip of the target branch and the PR itself (which can happen in the trybot repo when the default branch is used for other purposes). Instead, move to an approach where all workflows that run in the trybot repo (trybot or unity) use a force-push to the target branch. The information that was previously carried in the branch name is now passed in a Dispatch-Trailer such as: Dispatch-Trailer: {"type":"trybot","patchset":149,"CL":551352,"targetBranch":"master","ref":"refs/changes/52/551352/149"} The #dispatch schema for the JSON payload value of this trailer is defined in gerrithub.cue. Related changes to the gerritstatusupdater are made in CL 551980. There the go types for the dispatch payload are, for now, manually kept in sync with the #dispatch schema. These changes to gerritstatusupdater ensure that the old/new style of CI triggers is handled correctly. See the extensive commit message in that CL for more details. Related changes to cmd/cueckoo are presented in cue-lang/contrib-tools#44. Similarly, the Go type repositoryDispatchPayload is, for now, manually kept in sync with any changes to #dispatch in this repo. Now that all CI-related workflows run on the target branch, logic for determing whether we are running a trybot/unity workflow or on an actual protected branch commit has been updated. To help with testing of this new approach prior to submitting this CL, we also support dummy data that simulates the effect of calling cmd/cueckoo runtrybot. This only has effect on pushes to ci/test. This change, the related changes in other CLs, and the change to cmd/cueckoo, all need to be made "atomically". They are intentionally breaking. In case of rollback, all need to be rolled back. Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: I8662f5eec753e3caf6a5294b61d97f667e4ff2ee Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551352 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Chief Cueckoo <chief.cueckoo@gmail.com>
- Loading branch information
Showing
8 changed files
with
462 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.