-
Notifications
You must be signed in to change notification settings - Fork 60
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
Automate certified release process #352
Merged
rvermeulen
merged 171 commits into
github:main
from
rvermeulen:rvermeulen/release-process-improvements
Nov 15, 2023
Merged
Automate certified release process #352
rvermeulen
merged 171 commits into
github:main
from
rvermeulen:rvermeulen/release-process-improvements
Nov 15, 2023
Conversation
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
rvermeulen
force-pushed
the
rvermeulen/release-process-improvements
branch
13 times, most recently
from
September 2, 2023 00:07
46ca338
to
6ab572a
Compare
rvermeulen
force-pushed
the
rvermeulen/release-process-improvements
branch
17 times, most recently
from
September 11, 2023 21:48
0875500
to
0527406
Compare
rvermeulen
force-pushed
the
rvermeulen/release-process-improvements
branch
from
October 11, 2023 00:45
b08b119
to
0c6f341
Compare
This in response to yaml/pyyaml#601 on MacOS.
jsinglet
approved these changes
Nov 14, 2023
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.
In addition to our extensive in person reviews, I think this is GTG now! Thanks for all this amazing hard work @rvermeulen 🚀
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.
Description
This PR adds new workflows and updates existing workflows to create an automated certified release process.
This process reuses the existing release branch approach, but automates the release using a release PR against the release branch. This allows use to reuse all the checks we already perform on PRs and add checks specific for a release.
This event driven process requires monitoring of dispatched workflows and the overall status of the release. This has been realized using check-runs.
The overall flow a release is:
but this is not the actually execution flow because those are event driven.
The
prepare-release.yml
workflow starts the release process through a dispatch that takes as inputs theversion
to release and theref
to release from. The workflows thenThe creation of the PR is done in such a way that it will trigger a
pull_request
event targeting a release branch. This will ensure it will execute all the existing tests and additional release tests defined invalidate-release.yml
.The
validate-release.yml
workflow will dispatch the performance and compiler testing defined in thecodeql-coding-standards-engineering
repository. To be able to monitor these dispatched workflows and the overall release status 3 check-runs are created and updated accordingly.On each workflow conclusion its associated checkrun concludes and the
update-release-status.yml
workflow is configured to validate the overall release status when triggered by an checkrun completion or re-request. A release status that was concluded could be renewed if a checkrun is re-requested.Once a release status is complete, as determined by
update-release-status.yml
, theupdate-release.yml
workflow will be called that will update the release body and artifacts. This workflow relies on theupdate-release-assets.py
andupdate-release-notes.py
. The latter is a simple wrapper to call the existinggenerate_release_notes.py
script, but theupdate-release-assets.py
is a new script.The
update-release-assets.py
takes thehead-sha
of the PR, GitHub tokens to collect workflow runs, and a layout. The layout decoratively specifies the release layout. Our current layout is defined inrelease-layout.yml
.The layout specification builds artifacts through the supported actions. We currently have 4 actions:
file
,shell
,workflow-log
, andworkflow-artifact
to support the existing artifacts and the artifacts required for the certification kit.Once the release is status is green we can merge the release PR. The closing of a release PR triggers the
finalize-release.yml
workflow that pushes the latest release tag and takes the release out of draft, concluding the release.Finally, the
update-check-run.yml
is used to allow external repositories with dispatch authorization on this repository to update check-runs. Check runs cannot be updated with a PAT, but only by GitHub Apps. Since we cannot install the later this is a workaround that allow use to update check-runs with a PAT.Resilience
The release process is designed to be resilient against errors by making each workflow restartable in the case of errors. The
prepare-release.yml
will only stop preparing a new release if there already exists a non-draft release of the provided version. When you restart the a release preparation the release branch will be recreated so any additional commits will be removed.The developer manual will contain a list of possible failures and how to restart the release process.
Caveats
update-release-status.yml
has only be tested with manual dispatch because thecheck_run
event isn't triggered on workflows outside of the main branch.update-release.yml
isn't tested in full because the package generation and unit tests flows require a larger runner not available on the accounts used to test the new workflows.TODOS
rvermeulen/codeql-coding-standards
used for testing.Change request type
.ql
,.qll
,.qls
or unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.