feat(run-environment): log which authentication method the run uses - #521
Merged
fargito merged 1 commit intoAug 28, 2026
Merged
Conversation
Merging this PR will not alter performance
|
fargito
force-pushed
the
cod-3406-add-an-info-level-log-to-tell-users-which-authentication
branch
2 times, most recently
from
August 28, 2026 09:14
6f24cee to
7164dce
Compare
fargito
marked this pull request as ready for review
August 28, 2026 09:17
Greptile SummaryThe PR tracks authentication provenance alongside credentials and reports the method used for result uploads.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/api_client.rs | Replaces the optional token field with an authentication model that retains both credentials and their provenance. |
| src/cli/mod.rs | Maps run-level tokens, configured login credentials, and missing credentials to the corresponding authentication variants. |
| src/executor/orchestrator.rs | Reports the effective authentication method after per-upload OIDC refresh and before the first upload. |
| src/run_environment/github_actions/provider.rs | Records successfully minted GitHub Actions credentials as OIDC authentication. |
| src/run_environment/circleci/provider.rs | Records successfully minted CircleCI credentials as OIDC authentication and reuses centralized documentation URLs. |
| src/run_environment/interfaces.rs | Centralizes authentication documentation URLs and exposes the appropriate link for each run environment. |
| src/upload/uploader.rs | Reuses centralized authentication documentation links in unauthorized-upload guidance. |
Sequence Diagram
sequenceDiagram
participant CLI
participant Provider as Run Environment Provider
participant Client as API Client
participant Upload
CLI->>Client: Construct with resolved Authentication
Provider->>Client: Refresh OIDC authentication when configured
Client-->>CLI: Expose effective authentication label
CLI->>CLI: Log authentication method and documentation link
CLI->>Upload: Upload results with effective token
Reviews (2): Last reviewed commit: "feat(run-environment): log which authent..." | Re-trigger Greptile
adriencaccia
approved these changes
Aug 28, 2026
The runner resolves how it authenticates from the environment rather than being told, so nothing in its output distinguished a job uploading with an OIDC token from one falling back to tokenless because the workflow forgot `id-token: write`. Print the method, and a link to the run environment's authentication docs, alongside the upload it describes. Name the method from where the token actually came from instead of guessing: `CodSpeedAPIClient` now holds an `Authentication` carrying the token together with the source that produced it, so `--token` / `CODSPEED_TOKEN` and the token `codspeed auth login` persists are no longer reported alike. Log it after the OIDC token is minted rather than before the benchmarks run. Minting can fail and fall back to a tokenless upload, so only by then is the method settled, and the line names the token the upload really carries. A token GitLab CI issues through `id_tokens` arrives in `CODSPEED_TOKEN`, exactly where a static CodSpeed token would, and only the upload endpoint can tell the two apart. It is reported as the `CODSPEED_TOKEN` it came from. Collect the documentation links these messages share into constants, so the uploader's 401 hint and the OIDC guidance stop repeating URLs the new authentication line would have to know as well. The Buildkite 401 hint gains the link it was missing. `CodSpeedAPIClient::new` takes an `Authentication`, and `with_token` and `set_token` become `with_authentication` and `set_authentication`. Callers pass the same tokens through the matching variant; no request changes. Closes COD-3406 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fargito
force-pushed
the
cod-3406-add-an-info-level-log-to-tell-users-which-authentication
branch
from
August 28, 2026 16:42
7164dce to
4ea6774
Compare
Member
Author
|
@greptileai review |
fargito
deleted the
cod-3406-add-an-info-level-log-to-tell-users-which-authentication
branch
August 28, 2026 17:06
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.
The runner resolves how it authenticates from the environment rather than being
told, so nothing in its output distinguished a job uploading with an OIDC token
from one falling back to tokenless because the workflow forgot
id-token: write.Both succeed. It now prints the method and a link to the run environment's
authentication docs, alongside the upload it describes:
The method is tracked rather than inferred:
CodSpeedAPIClientholds anAuthenticationcarrying the token together with the source that produced it.Logging it after the mint rather than before the benchmarks means a failed mint
that falls back to a tokenless upload is reported as tokenless, not as OIDC.
A token GitLab CI issues through
id_tokensarrives inCODSPEED_TOKEN, wherea static token would, so it is reported as the
CODSPEED_TOKENit came from:accurate, but a GitLab user running OIDC never sees the word OIDC.
The shared documentation links moved into constants, so the uploader's 401 hint
and the OIDC guidance no longer repeat URLs the new line also needs. Buildkite's
401 hint gains the link it was missing.
Worth a look:
CodSpeedAPIClient::newtakes anAuthentication, andwith_token/set_tokenbecomewith_authentication/set_authentication.Every caller passes the same token through the matching variant, so no request
changes.
Closes COD-3406