-
Notifications
You must be signed in to change notification settings - Fork 514
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
Trigger AWS Lambda tests on label #2538
Conversation
cc @asottile-sentry @mdtro in case you guys want to/have time to double check |
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.
from urllib.parse import quote | ||
from urllib.request import Request, urlopen | ||
|
||
LABEL = "Trigger: tests" |
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 would maybe make this more explicit that it's sensitive tests requiring secrets
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.
Changed to "Trigger: tests using secrets"
(open to better names)
Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
Our AWS Lambda test suite currently doesn't run properly on external contributor PRs because it needs access to repo secrets, which it currently doesn't have. This PR adds a label to grant access to the secrets, which is invalidated upon any new code changes.
How it works
For the AWS Lambda test suite (and any future test suites that need access to GH secrets):
check-permissions
job that runs before all test jobscheck-permissions
job runs a Python script (taken from here) that finishes with an error code if the PR was not made by someone with write permissions and there is noTrigger: tests using secrets
label on the PRTrigger: tests using secrets
label on any code changes before any code from the PR is checked outcheck-permissions
finishing successfullypull_request_target
(with access to secrets)Copied and adapted the approach from
sentry
: https://github.com/getsentry/sentry/blob/master/.github/workflows/getsentry-dispatch.ymlThe test AWS account has been stripped down of all unnecessary permissions: #2493 (comment)
Since the workflow is now on
pull_request_target
it won't run until we've actually merged this PR. I tried the changes out in a test repo.Supersedes #2493