Skip to content

Let other bazelflare deployments use the credential helper - #8154

Merged
LuisDuarte1 merged 1 commit into
mainfrom
lduarte/bazelflare-helper-other-deployments
Nov 3, 2026
Merged

LuisDuarte1 merged 1 commit into
mainfrom
lduarte/bazelflare-helper-other-deployments

Conversation

@LuisDuarte1

Copy link
Copy Markdown
Contributor

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_APP overrides the Access app, defaulting to workerd's. --credential_helper takes a path with no arguments, so a wrapper sets it.
  • BAZELFLARE_ID_TOKEN, when set, is sent as authorization: Bearer, ahead of the GitHub Actions check: for CI jobs that already hold an OIDC token, such as a GitLab job's id_tokens entry. 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_APP pointed at another deployment's app, which returned that app's token.

@LuisDuarte1
LuisDuarte1 requested review from a team as code owners November 2, 2026 16:47

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-workerd while ACCESS_APP is now overridable. Another deployment that uses the GitHub Actions path would request a token for the wrong audience. Consider a BAZELFLARE_OIDC_AUDIENCE override, 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_AUDIENCE stays fixed at bazelflare-workerd, while ACCESS_APP can now be overridden. A wrapper for another deployment running in GitHub Actions would take the ACTIONS_ID_TOKEN_REQUEST_URL path and request a token for workerd's audience, which that deployment would probably reject. This doesn't affect the use case described here: the BAZELFLARE_ID_TOKEN path 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 about BAZELFLARE_ACCESS_APP is on the same comment as the unrelated TODO(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

@LuisDuarte1
LuisDuarte1 enabled auto-merge November 2, 2026 21:22
@LuisDuarte1
LuisDuarte1 force-pushed the lduarte/bazelflare-helper-other-deployments branch from fdaf7ac to de05c6d Compare November 2, 2026 21:46

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-workerd while ACCESS_APP is now overridable. Another deployment that uses the GitHub Actions path would request a token for the wrong audience. Consider a BAZELFLARE_OIDC_AUDIENCE override, 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_AUDIENCE stays fixed at bazelflare-workerd, while ACCESS_APP can now be overridden. A wrapper for another deployment running in GitHub Actions would take the ACTIONS_ID_TOKEN_REQUEST_URL path and request a token for workerd's audience, which that deployment would probably reject. This doesn't affect the use case described here: the BAZELFLARE_ID_TOKEN path 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 about BAZELFLARE_ACCESS_APP is on the same comment as the unrelated TODO(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)

Comment thread build/bazelflare/credential-helper Resolved
Comment thread build/bazelflare/credential-helper Resolved
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.
@LuisDuarte1
LuisDuarte1 force-pushed the lduarte/bazelflare-helper-other-deployments branch from de05c6d to b4909d0 Compare November 3, 2026 10:49

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 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-workerd while ACCESS_APP is now overridable. Another deployment that uses the GitHub Actions path would request a token for the wrong audience. Consider a BAZELFLARE_OIDC_AUDIENCE override, 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_AUDIENCE stays fixed at bazelflare-workerd, while ACCESS_APP can now be overridden. A wrapper for another deployment running in GitHub Actions would take the ACTIONS_ID_TOKEN_REQUEST_URL path and request a token for workerd's audience, which that deployment would probably reject. This doesn't affect the use case described here: the BAZELFLARE_ID_TOKEN path 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 about BAZELFLARE_ACCESS_APP is on the same comment as the unrelated TODO(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)

@LuisDuarte1
LuisDuarte1 merged commit 29b484a into main Nov 3, 2026
23 checks passed
@LuisDuarte1
LuisDuarte1 deleted the lduarte/bazelflare-helper-other-deployments branch November 3, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants