chore(ci): source code tampering protection for release#2301
Merged
leandrodamascena merged 9 commits intoaws-powertools:developfrom May 23, 2023
Merged
chore(ci): source code tampering protection for release#2301leandrodamascena merged 9 commits intoaws-powertools:developfrom
leandrodamascena merged 9 commits intoaws-powertools:developfrom
Conversation
Uses new mechanism to seal source code, run quality checks separately, and always reuses sealed source code in every step to prevent source code tampering. It documents every job purpose, and creates a new faster action to upload and download artifacts.
Contributor
|
Reviewing now |
rubenfonseca
suggested changes
May 22, 2023
Contributor
rubenfonseca
left a comment
There was a problem hiding this comment.
Super good job, TIL that you can have your own custom actions on the same repo. Just left some questions and a tiny comment.
| # NOTES | ||
| # | ||
| # Upload-artifact and download-artifact takes ~2m40s to upload 8MB | ||
| # so this is custom action cuts down the entire operation to 1s |
Co-authored-by: Ruben Fonseca <fonseka@gmail.com> Signed-off-by: Heitor Lessa <lessa@amazon.nl>
Contributor
Author
|
@rubenfonseca gonna need your review one more time as I've added a hash verifier as per @leandrodamascena ask. Leandro reviewed |
Contributor
Author
|
Successful run publishing to Test PyPi repo (minus layers for good reasons and no change there): https://github.com/heitorlessa/aws-lambda-powertools-test/actions/runs/5053853611 |
leandrodamascena
approved these changes
May 23, 2023
Contributor
leandrodamascena
left a comment
There was a problem hiding this comment.
APPROVED!! Amazing work @heitorlessa!
Contributor
Author
|
Aleluia! <3 |
This file contains hidden or 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
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.
Issue number: #2206
Summary
Implements mechanism to seal source code, further break
buildjob, further isolatereleasejob with binaries only, and fixes the Git Tag creation process.Changes
bump_versionandcreate_tagto use sealed source code with version bumpedubuntu-latestas we no longer need those 4 cores (savings!!)pyproject.tomlin case sealed source code is incorrectAdditional fixes
create_tagas it needs to add staged changes before pushing... otherwise it pushes the current commitThreats to address
RELEASE_COMMITduring checkoutsealjob to hash and reuse artifact throughout releasepipx install git+<url+SHA>for poetry to prevent rogue package managerrelease-<build-hash>for traceability and immutabilitypipx install git+<url+SHA>for poetry to prevent rogue package managerreleasejob doesn't install any dependencies but a pinnedpoetrysealjob to hash and reuse artifactpyproject.tomlthat changed insealto our local git tree, then push that with the new tag only. This also solves the data race condition where PR is only merged later and our tag uses an older version.releaseenvironmentreleaseenvironment requires manual approval before proceedingUser experience
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.