feat(run-environment): add CircleCI provider for GitHub repositories - #473
Open
fargito wants to merge 1 commit into
Open
feat(run-environment): add CircleCI provider for GitHub repositories#473fargito wants to merge 1 commit into
fargito wants to merge 1 commit into
Conversation
Greptile SummaryAdds CircleCI support for GitHub-hosted repositories.
Confidence Score: 5/5The PR appears safe to merge with respect to the eligible follow-up findings. No blocking failure remains from the previous logger thread, because direct stdout output is required inside the logging sink and matches the repository's other logger backends.
|
| Filename | Overview |
|---|---|
| src/run_environment/circleci/provider.rs | Implements CircleCI detection, GitHub repository validation, event metadata, static-token enforcement, and workflow run-part identity. |
| src/run_environment/circleci/logger.rs | Adds a CircleCI logging sink with colored headings and level-aware output consistent with the repository's logger implementations. |
| src/run_environment/mod.rs | Registers CircleCI in provider detection before the local fallback. |
| src/run_environment/interfaces.rs | Adds the serialized CircleCI run-environment variant. |
| src/upload/uploader.rs | Provides CircleCI users the static-token authentication hint for unauthorized uploads. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Env["CircleCI environment variables"] --> Detect["Detect CIRCLECI=true"]
Detect --> Validate["Parse and validate GitHub repository"]
Validate --> Metadata["Build run-environment metadata"]
Validate --> Part["Build workflow/job/node run-part identity"]
Metadata --> Upload["Upload benchmark profile"]
Part --> Upload
Token["CODSPEED_TOKEN"] --> Upload
Reviews (4): Last reviewed commit: "feat(run-environment): add CircleCI prov..." | Re-trigger Greptile
Merging this PR will not alter performance
|
fargito
force-pushed
the
feat/circleci-run-environment
branch
from
July 27, 2026 16:04
f002a69 to
bc6db31
Compare
Support running benchmarks from CircleCI on GitHub-hosted repositories. The build runs on CircleCI while commits and pull requests live on GitHub, so the run reports against the GitHub commit and PR. Unlike GitHub Actions, CircleCI checks out the associated commit itself rather than a synthetic merge ref, so the default git HEAD read already yields CIRCLE_SHA1 and no commit hash override is needed. CircleCI exposes no base branch variable either: baseRef is left empty and CodSpeed resolves the base branch from the pull request. CircleCI also builds Bitbucket and GitLab repositories, so the domain of CIRCLE_REPOSITORY_URL is validated and anything but github.com is rejected with an explicit error. That domain is the only signal available at runtime: the explicit pipeline.project.type is a pipeline value, interpolated when the config is compiled, so it never reaches the job as a variable. Uploads authenticate with a static CODSPEED_TOKEN. Run part data is already reported, so runs group correctly once multi-part upload support lands: CIRCLE_WORKFLOW_ID is shared by every job and every parallel container of a workflow, while CIRCLE_JOB and CIRCLE_NODE_INDEX identify a single part. Refs COD-2977 Refs COD-2995 Refs COD-3262
fargito
force-pushed
the
feat/circleci-run-environment
branch
from
July 27, 2026 16:12
bc6db31 to
4e52cfa
Compare
fargito
marked this pull request as ready for review
July 27, 2026 16:51
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.
Add a CircleCI run environment, for repositories hosted on GitHub.
The build runs on CircleCI while commits and pull requests live on GitHub, so the run is reported
against the GitHub commit and pull request. Detection is
CIRCLECI=true, and the repository comesfrom
CIRCLE_REPOSITORY_URL.CircleCI also builds Bitbucket and GitLab repositories, so the remote's domain is checked and
anything but
github.comis rejected with an error naming the domain found. That domain is theonly signal available at runtime:
pipeline.project.typeis a pipeline value, interpolated whenthe config is compiled, so it never reaches the job as an environment variable.
Two things worth a look:
merge ref, so reading git
HEADalready yieldsCIRCLE_SHA1.runIdisCIRCLE_WORKFLOW_ID, shared by every job and every parallel container of aworkflow. The per-job
CIRCLE_WORKFLOW_JOB_IDwould split one workflow into unrelated runs.runPartIdis{CIRCLE_JOB}-{CIRCLE_NODE_INDEX}, to stay unique along both fan-out axes.baseRefis left empty, as CircleCI exposes no base-branch variable. Pull request uploads need aserver-side change that is not released yet; push events are unaffected.
Uploads authenticate with a static
CODSPEED_TOKEN. Minting OIDC tokens instead is #482, stackedon top.
Refs COD-2995
Refs COD-3262