-
Notifications
You must be signed in to change notification settings - Fork 228
Automatically Backport Security Fixes #8583
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
base: master
Are you sure you want to change the base?
Changes from 8 commits
e412fc2
e312548
ff18ea9
2d76d96
05635be
be28747
faa279c
86f7916
9d2dee0
2296513
181e074
8644bb9
a0f0af9
bd116ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- | ||
Please rename the PR to follow the following convention: | ||
PR Title: "Security Fix: <Short Description of Changes>" | ||
|
||
Please add the "security" label to the PR. | ||
--> | ||
|
||
## Security Fix | ||
|
||
aruniverse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Severity | ||
|
||
- [ ] Critical | ||
- [ ] High | ||
- [ ] Medium | ||
- [ ] Low | ||
|
||
### Description | ||
|
||
A clear description of the security issue being addressed. | ||
|
||
### Root Cause | ||
|
||
Brief explanation of what caused the security issue. | ||
|
||
### Link to Security Notice | ||
|
||
Link to CVE/GHAS notice. | ||
|
||
### Solution | ||
|
||
Describe the fix implemented and why this approach was chosen. | ||
|
||
### Additional Notes | ||
|
||
Any additional context or considerations for reviewers. | ||
|
||
--- | ||
<!-- This PR will be automatically backported to supported release branches via Mergify due to the "security" label --> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
# Configuration file for mergify | ||
|
||
# Branch variables for backport targets | ||
latestMinor: &latestMinor "release/5.2.x" | ||
|
||
previousMajor: &previousMajor "release/4.11.x" | ||
|
||
defaults: | ||
actions: | ||
backport: | ||
|
@@ -27,3 +32,15 @@ pull_request_rules: | |
message: | | ||
This pull request is now in conflicts. Could you fix it @{{author}}? 🙏 | ||
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/ | ||
|
||
- name: Automatic backport for Security fixes | ||
conditions: | ||
- and: | ||
- merged | ||
- base=master | ||
- label="security" | ||
hl662 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
actions: | ||
backport: | ||
branches: | ||
- *latestMinor | ||
- *previousMajor |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,10 @@ jobs: | |
# manually to be the most recent previous major release | ||
# e.g. if this release is `release/5.0.x`, value in `gather-docs.yaml` | ||
# should be `release/4.<whatever_last_minor_release_version_was>.x` | ||
# additionally if major version bump, the `mergify.yml` also needs to be edited manually | ||
# if this release is `release/5.0.x`,change the `latestMinor` variable to `release/5.0.x` | ||
|
||
# and the `previousMajor` variable to `release/4.<whatever_last_minor_release_version_was>.x` | ||
|
||
if [ $((previousMinorVersion)) -lt 0 ] | ||
then | ||
echo "This is is a major release. Edit \"gather-docs.yaml\" manually." | ||
|
@@ -254,8 +258,22 @@ jobs: | |
displayName: Get new version number | ||
name: getVersion | ||
|
||
# When creating a minor release, the NextVersion.md need to be cleared and the contents placed into a {Version Number}.md file | ||
- ${{ if eq(parameters.BumpType, 'minor') }}: | ||
|
||
# When creating a minor release, the mergify.yml file needs to be updated to change the "latestMinor" branch for security fixes | ||
- bash: | | ||
mergifyPath=".github/mergify.yml" | ||
version=$(echo $(getVersion.version) | sed 's/\([0-9]*\.[0-9]*\)\.[0-9]*/\1.x/') | ||
releaseBranch="release/$version" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we were to update 4.11 to 12, would this still work? It looks fine, but just double checking updating prev major won't cause unintended problems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there's a chance it would break with this current implementation. Currently it basically just takes the version created from the version bump step and sets the first release branch in the list to that value. If we were to run a version bump on release/4.11.x for a new minor, I think it would set 5.whatever.x to 4.12.x and leave 4.11.x there. There wouldn't be any problem with patches. Is there any precedent for us releasing a new minor on a previous major, though? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a fail safe, the most recent commit changed the logic so that the version-bump step looks at the major version number of the new version, and updates the release branch which starts with that same major version number. This means that if we were to release a new minor on a previous major version (4.11 -> 4.12), the bump would update the correct branch. |
||
echo "Updating mergify.yml to use $releaseBranch as the recent minor branch for security fixes" | ||
|
||
# Update the latestMinor variable in mergify.yml | ||
sed -i "s|^latestMinor: \&latestMinor \"release/[0-9]*\.[0-9]*\.x\"$|latestMinor: \&latestMinor \"$releaseBranch\"|" "$mergifyPath" | ||
|
||
displayName: Update mergify.yml for new minor release | ||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) | ||
|
||
# When creating a minor release, the NextVersion.md need to be cleared and the contents placed into a {Version Number}.md file | ||
- powershell: | | ||
$sourceFile = 'docs/changehistory/NextVersion.md' | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.