-
Notifications
You must be signed in to change notification settings - Fork 121
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
infra: code freeze workflow #767
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #767 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 129 129
Lines 8374 8374
Branches 1866 1866
=========================================
Hits 8374 8374 ☔ View full report in Codecov by Sentry. |
.github/workflows/code-freeze.yml
Outdated
- main | ||
|
||
env: | ||
FROZEN: "false" # Set to "true" to freeze branches, "false" otherwise |
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.
Does this make use of action variables? https://github.com/amazon-braket/amazon-braket-sdk-python/settings/variables/actions
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.
No these are just set within the workflow. Is there a benefit to moving to action variables until we want to reuse these values?
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 don't mind the workflow for updating action variables, but there's a limitation that you can't set an empty value (for allowing all feature branch merges) and there's no documentation to attach to the place they get updated.
We could update this workflow to use a more generable/intuitive env variable UNFROZEN_PREFIX
to allow us to specify feature
or feature/my-feature
and not rely on an empty value
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.
Updated to use repository variables
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 code freezes, will we need to publish PRs each time? If so, I think using the action variables would allow for easier changes and cleaner commit history.
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.
Makes sense, I've update the script to use action variables
Co-authored-by: Abe Coull <85974725+math411@users.noreply.github.com>
If the branch is frozen will updates from main break? |
There are two settings:
This workflow will run for any PR into main with the following logic:
I'm not sure specifically what you're asking about, but there is a race condition if the workflow succeeds before the repo is frozen and then is merged after. We can probably fix this by enabling a merge queue (which runs the workflows before merging), but maybe there's a more direct way to trigger this workflow only when the env variable is updated |
It seems like a benefit of using variables within the file is if we update the workflow on main, then any PRs will have to update their branch (and rerun the code freeze workflow) before merging, avoiding the race condition we get with repository variables. I think that's enough of a reason to at least move the FROZEN variable to the file. We can leave the unfrozen prefix in the action variables if you think it makes sense, or might as well have them together |
Issue #, if available:
Description of changes:
Support for selectively freezing main branch
Testing done:
Manual testing of the following cases:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.