Skip to content

(Chore): Store additional CircleCI env vars#1071

Merged
trunk-io[bot] merged 2 commits intomainfrom
tyler/richer-circle-ci
Apr 17, 2026
Merged

(Chore): Store additional CircleCI env vars#1071
trunk-io[bot] merged 2 commits intomainfrom
tyler/richer-circle-ci

Conversation

@TylerJang27
Copy link
Copy Markdown
Collaborator

@TylerJang27 TylerJang27 commented Apr 17, 2026

Include additional CircleCI env vars to form full job URLs.

We'll need a repo version bump for ingestion to pick up the URL changes.

Most of this is informed by:

For reference, a quick example is:

  • A ${CIRCLE_BUILD_URL} will be something like https://circleci.com/gh/healthie/web/${CIRCLE_BUILD_NUM}
  • When you navigate there, you get redirected to https://app.circleci.com/pipelines/github/healthie/web/${pipeline-number}/workflows/${CIRCLE_WORKFLOW_ID}/jobs/${CIRCLE_BUILD_NUM}, which can be extended with /parallel-runs/${CIRCLE_NODE_INDEX}
  • From my own testing, it looks like pipeline-number (number, usually set via config like below) is also substitutable with ${CIRCLE_PIPELINE_ID} (uuid)
jobs:
  my-job:
    environment:
      PIPELINE_NUMBER: << pipeline.number >>

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 17, 2026

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.99%. Comparing base (2c3d07b) to head (1debd1e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1071      +/-   ##
==========================================
+ Coverage   81.70%   81.99%   +0.29%     
==========================================
  Files          69       69              
  Lines       14879    14905      +26     
==========================================
+ Hits        12157    12222      +65     
+ Misses       2722     2683      -39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trunk-staging-io
Copy link
Copy Markdown

trunk-staging-io bot commented Apr 17, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 17, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Comment thread constants/src/lib.rs
"CIRCLE_NODE_INDEX",
"CIRCLE_NODE_TOTAL",
"CIRCLE_PIPELINE_ID",
"CIRCLE_PIPELINE_NUMBER", // not a built-in but is common practice
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

See description, I want to start tracking how common setting this value is, as a more valid fallback

@TylerJang27 TylerJang27 requested a review from dfrankland April 17, 2026 21:05
Comment thread context/src/env/parser.rs
/// `https://circleci.com/gh/{org}/{repo}/{build_num}`.
/// Reference: https://discuss.circleci.com/t/circle-build-url-environment-variable-changing-for-projects-that-use-github-app-gitlab/49980/7
fn circleci_gh_org_repo_from_build_url(url: &str) -> Option<(&str, &str)> {
const PREFIX: &str = "https://circleci.com/gh/";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can extract & reuse const in

if url.starts_with("https://circleci.com/gh/")

condition above ^ ?

@trunk-io trunk-io bot merged commit c7a6ad4 into main Apr 17, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants