-
Notifications
You must be signed in to change notification settings - Fork 521
WIP: Add GITHUB_TOKEN to releng-ci-bazel container image #1031
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
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: saschagrunert The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
Ah yes 🙈, I did not take into consideration that the token has write access to the repo. We would finally need a new token with read-only access to k/k (like every user has). Let me prepare the PR accordingly... |
This is needed to run changelog e2e/integration tests within the CI. Signed-off-by: Sascha Grunert <[email protected]>
secrets: | ||
- kmsKeyName: projects/kubernetes-release-test/locations/global/keyRings/anago/cryptoKeys/k8s-release-robot | ||
secretEnv: | ||
GITHUB_TOKEN: <TOKEN> |
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.
@justaugustus I think we would need a new token here, which has read-only access to k/k for parsing the release notes from it.
I think there is some confusion: The token here would only be available when building the image, i.e. while For #1023, we'd want the token at the runtime of the tests. However, and I know I repeat myself, I don't think we should implement any tool doing things like this (e.g. git pushing) if we can avoid doing so, but rather have GCB do it. I think a tool should ideally prepare the git repo locally and hand off to another GCB task which does the pushing (or pulling or whatever interaction with the outside world). Skimming the code really quick, I think specifically for #1023 that is straight forward. This would also mean, we get one step closer to not running random release steps on a devs laptop (which we have no control or idea about). |
We need this token primarily to generate the release notes, not for pushing content to any remote.
Okay I see. I will follow up on another PR where we can continue the discussion. |
If we need a token (for e2e testing or anything else), we could (there are other options, maybe better ones):
For this, I think we'd want to have a different kms keyring / secret which is manageable by non-SIG-chairs, for easier management. I am not sure how feasible that all is, considering that we have multiple GCP projects and there is no automation for that (AFAIK) available (yet), and I think we'd want to make sure we have the projects in sync. (If that's already there, yiihhaa, I'd love to introduce a new secret to play with sendgrid or similar). However, even if it has one more "indirection" I am starting to like the prow -> builder -> GCB pre-submit, I think it could allow us to manage pretty much everything (esp. secrets included) ourselves, given we get the access stuff right on all GCP projects involved. Alternatively, there is a way to store secrets in prow, but I am not sure how that exactly works. IIRC someone from test-infra creates a k8s secret which we then can use in our prow jobs? 🤷 Other folks (@justaugustus, @calebamiles, and others) know way more about that. Does this make sense? What's y'all's preference?
|
@saschagrunert -- Apologies for dropping a hold on this and not getting back to you with something more detailed. That said, I agree with @hoegaarden's assessment.
Yep, this could be a variant in the
Yep, there's a pull URI/branch that we can use (the exact form escapes me at the moment).
Agreed that we want to minimize the amount of creds we have to manage. We could also potentially use the new Secret Manager (https://cloud.google.com/secret-manager/docs), though I haven't had a chance to play around with that yet.
Glad the flow sounds good to you :)
I think we should start with managing the secret in Prow, since it's what we've got today. Going back to the What I'd like to see additionally (separate PR) is the removal of any flags within our tools which allow for passing tokens via command line. As we output logs in GCB, Prow, and elsewhere (pasting logs to debug in issues/Slack), having sensitive creds on the command line open us up to accidentally exposure (mentioned here as well). We should get sensitive information into the environment ahead of the command's execution (pass by env variable, environment file). |
Thank you for all the feedback regarding this change. In the long term we need to have a GITHUB_TOKEN for real integration testing anyway, but for now lets close this one since the changes are out of scope. Let's follow-up on #1023 |
This is needed to run changelog e2e/integration tests within the CI.
Needed by: #1023