Repository navigation
Let other bazelflare deployments use the credential helper - #8154
Conversation
There was a problem hiding this comment.
Superseded by the review of
de05c6d2.
This review, of fdaf7acc
💬 Approved with comments — The change is correct and opt-in. The only notes are an optional suggestion about the OIDC audience, which stays hardcoded, and a comment-wording nit.
Findings: 1 info · 1 suggestion
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info · 1 suggestion
Both hooks work as described. Two optional points: the OIDC audience is still hardcoded, and the comment wording could be tidier.
Recommendation: 💬 Optional Nits
- [INFO] The override note shares a comment with the unrelated TODO(soon) and cites a file in another repository. Consider putting it on its own line and describing what the variable does. (
build/bazelflare/credential-helper:10) - [SUGGESTION] OIDC_AUDIENCE is still hardcoded to
bazelflare-workerdwhile ACCESS_APP is now overridable. Another deployment that uses the GitHub Actions path would request a token for the wrong audience. Consider aBAZELFLARE_OIDC_AUDIENCEoverride, or a note that only the Access app can be overridden. (build/bazelflare/credential-helper:12)
View full review
build/bazelflare/credential-helper:12:OIDC_AUDIENCEstays fixed atbazelflare-workerd, whileACCESS_APPcan now be overridden. A wrapper for another deployment running in GitHub Actions would take theACTIONS_ID_TOKEN_REQUEST_URLpath and request a token for workerd's audience, which that deployment would probably reject. This doesn't affect the use case described here: theBAZELFLARE_ID_TOKENpath doesn't use the audience. If other deployments might use the GitHub path later,OIDC_AUDIENCE=${BAZELFLARE_OIDC_AUDIENCE:-bazelflare-workerd}would make the two overrides consistent. Otherwise, a note that the override applies only to the Access path would do.build/bazelflare/credential-helper:9-10: The new sentence aboutBAZELFLARE_ACCESS_APPis on the same comment as the unrelatedTODO(soon), so the two read as one note. It also cites a file in another repository that readers of this tree can't see. Consider giving the override note its own line, phrased as what the variable does ("a wrapper for another deployment sets BAZELFLARE_ACCESS_APP to its own Access app").
I have no concerns about the rest. BAZELFLARE_ID_TOKEN is checked first and goes through the same expiry and empty-token handling as the other token sources.
✅ All other checks passed
📝 Documentation: ✅ LGTM
The header comment matches the new behaviour: it describes BAZELFLARE_ID_TOKEN as the first CI option, ahead of the GitHub Actions token.
Reviewed commit: fdaf7acc
fdaf7ac to
de05c6d
Compare
There was a problem hiding this comment.
Superseded by the review of
b4909d08.
This review, of de05c6d2
💬 Approved with comments — The change is correct and opt-in. The only notes are an optional suggestion about the OIDC audience, which stays hardcoded, and a comment-wording nit.
Findings: 1 info · 1 suggestion (2 are inline comments on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info · 1 suggestion
Both hooks work as described. Two optional points: the OIDC audience is still hardcoded, and the comment wording could be tidier.
Recommendation: 💬 Optional Nits
- [INFO] The override note shares a comment with the unrelated TODO(soon) and cites a file in another repository. Consider putting it on its own line and describing what the variable does. (
build/bazelflare/credential-helper:10) - [SUGGESTION] OIDC_AUDIENCE is still hardcoded to
bazelflare-workerdwhile ACCESS_APP is now overridable. Another deployment that uses the GitHub Actions path would request a token for the wrong audience. Consider aBAZELFLARE_OIDC_AUDIENCEoverride, or a note that only the Access app can be overridden. (build/bazelflare/credential-helper:12)
View full review
build/bazelflare/credential-helper:12:OIDC_AUDIENCEstays fixed atbazelflare-workerd, whileACCESS_APPcan now be overridden. A wrapper for another deployment running in GitHub Actions would take theACTIONS_ID_TOKEN_REQUEST_URLpath and request a token for workerd's audience, which that deployment would probably reject. This doesn't affect the use case described here: theBAZELFLARE_ID_TOKENpath doesn't use the audience. If other deployments might use the GitHub path later,OIDC_AUDIENCE=${BAZELFLARE_OIDC_AUDIENCE:-bazelflare-workerd}would make the two overrides consistent. Otherwise, a note that the override applies only to the Access path would do.build/bazelflare/credential-helper:9-10: The new sentence aboutBAZELFLARE_ACCESS_APPis on the same comment as the unrelatedTODO(soon), so the two read as one note. It also cites a file in another repository that readers of this tree can't see. Consider giving the override note its own line, phrased as what the variable does ("a wrapper for another deployment sets BAZELFLARE_ACCESS_APP to its own Access app").
I have no concerns about the rest. BAZELFLARE_ID_TOKEN is checked first and goes through the same expiry and empty-token handling as the other token sources.
✅ All other checks passed
📝 Documentation: ✅ LGTM
The header comment matches the new behaviour: it describes BAZELFLARE_ID_TOKEN as the first CI option, ahead of the GitHub Actions token.
Reviewed commit: de05c6d2 — same changes as fdaf7acc, so this is that commit's review (no new review was run; line numbers are as of fdaf7acc)
edgeworker runs its own bazelflare deployment and would otherwise keep a second copy of this helper, which already fell behind (it doesn't log in through the browser). A wrapper can now name its deployment's Access app in BAZELFLARE_ACCESS_APP, and a CI job that already holds an OIDC token, such as a GitLab job's id_tokens entry, passes it in BAZELFLARE_ID_TOKEN.
de05c6d to
b4909d0
Compare
There was a problem hiding this comment.
💬 Approved with comments — The change is correct and opt-in. The only notes are an optional suggestion about the OIDC audience, which stays hardcoded, and a comment-wording nit.
Findings: 1 info · 1 suggestion
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info · 1 suggestion
Both hooks work as described. Two optional points: the OIDC audience is still hardcoded, and the comment wording could be tidier.
Recommendation: 💬 Optional Nits
- [INFO] The override note shares a comment with the unrelated TODO(soon) and cites a file in another repository. Consider putting it on its own line and describing what the variable does. (
build/bazelflare/credential-helper:10) - [SUGGESTION] OIDC_AUDIENCE is still hardcoded to
bazelflare-workerdwhile ACCESS_APP is now overridable. Another deployment that uses the GitHub Actions path would request a token for the wrong audience. Consider aBAZELFLARE_OIDC_AUDIENCEoverride, or a note that only the Access app can be overridden. (build/bazelflare/credential-helper:12)
View full review
build/bazelflare/credential-helper:12:OIDC_AUDIENCEstays fixed atbazelflare-workerd, whileACCESS_APPcan now be overridden. A wrapper for another deployment running in GitHub Actions would take theACTIONS_ID_TOKEN_REQUEST_URLpath and request a token for workerd's audience, which that deployment would probably reject. This doesn't affect the use case described here: theBAZELFLARE_ID_TOKENpath doesn't use the audience. If other deployments might use the GitHub path later,OIDC_AUDIENCE=${BAZELFLARE_OIDC_AUDIENCE:-bazelflare-workerd}would make the two overrides consistent. Otherwise, a note that the override applies only to the Access path would do.build/bazelflare/credential-helper:9-10: The new sentence aboutBAZELFLARE_ACCESS_APPis on the same comment as the unrelatedTODO(soon), so the two read as one note. It also cites a file in another repository that readers of this tree can't see. Consider giving the override note its own line, phrased as what the variable does ("a wrapper for another deployment sets BAZELFLARE_ACCESS_APP to its own Access app").
I have no concerns about the rest. BAZELFLARE_ID_TOKEN is checked first and goes through the same expiry and empty-token handling as the other token sources.
✅ All other checks passed
📝 Documentation: ✅ LGTM
The header comment matches the new behaviour: it describes BAZELFLARE_ID_TOKEN as the first CI option, ahead of the GitHub Actions token.
Reviewed commit: b4909d08 — same changes as fdaf7acc, so this is that commit's review (no new review was run; line numbers are as of fdaf7acc)
edgeworker runs its own bazelflare deployment (cloudflare/ew/edgeworker!15721) and would otherwise keep a second copy of
build/bazelflare/credential-helper, which had already fallen behind this one (no browser login). Two small hooks let it reuse this one through a wrapper:BAZELFLARE_ACCESS_APPoverrides the Access app, defaulting to workerd's.--credential_helpertakes a path with no arguments, so a wrapper sets it.BAZELFLARE_ID_TOKEN, when set, is sent asauthorization: Bearer, ahead of the GitHub Actions check: for CI jobs that already hold an OIDC token, such as a GitLab job'sid_tokensentry. Bazel passes the client environment to credential helpers, so the token reaches it.Nothing changes for workerd: neither variable is set in its CI or on workstations.
Checked: shellcheck; the bearer path with a dummy token; and the Access path with
BAZELFLARE_ACCESS_APPpointed at another deployment's app, which returned that app's token.