Skip to content

Add optional argument / environment variable to override PR number#1032

Merged
trunk-io[bot] merged 3 commits intomainfrom
max/trunk-17515-add-analytics-cli-argument-env-var-for-pr-number
Feb 5, 2026
Merged

Add optional argument / environment variable to override PR number#1032
trunk-io[bot] merged 3 commits intomainfrom
max/trunk-17515-add-analytics-cli-argument-env-var-for-pr-number

Conversation

@max-trunk
Copy link
Contributor

@max-trunk max-trunk commented Feb 5, 2026

In the event that one's CI configuration prevents the environment from setting the PR info needed to detect uploads from PRs, allow users to conditionally set the PR number on PR builds. This will get propagated through the bundle meta's envs and used / preferred when parsing the PR number (and therefore branch class as well) later on in the pipeline

Tested a Bamboo upload where I set TRUNK_PR_NUMBER=1, observed it present in the captured bundle meta env vars:

{"CI": "true", "bamboo_agentId": "3407873", "bamboo_planKey": "TEST-TEST3", "TRUNK_PR_NUMBER": "1", "bamboo_buildKey": "TEST-TEST3-JOB1", "bamboo_planName": "Test - test - new-branch", "bamboo_resultsUrl": "http://172.19.0.3:8085/browse/TEST-TEST3-JOB1-1", "bamboo_buildNumber": "1", "bamboo_shortJobName": "Default Job", "bamboo_shortPlanKey": "TEST3", "bamboo_buildPlanName": "Test - test - new-branch - Default Job", "bamboo_shortPlanName": "test", "bamboo_buildResultKey": "TEST-TEST3-JOB1-1", "bamboo_buildTimeStamp": "2026-02-05T19:07:30.491Z", "bamboo_buildResultsUrl": "http://172.19.0.3:8085/browse/TEST-TEST3-JOB1-1", "bamboo_triggerReason_key": "com.atlassian.bamboo.plugin.system.triggerReason:InitialBuildTriggerReason", "bamboo_shortPlanBranchName": "new-branch", "bamboo_planRepository_branch": "new-branch", "bamboo_planRepository_revision": "a26603e03823c78fa634a811e56c3abbd04922b3", "bamboo_planRepository_username": "max-trunk", "bamboo_planRepository_branchName": "new-branch", "bamboo_planRepository_repositoryUrl": "https://github.com/max-trunk/go-tests.git"}

@trunk-io
Copy link

trunk-io bot commented Feb 5, 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

codecov-commenter commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.68%. Comparing base (90c3482) to head (262b7ae).

Files with missing lines Patch % Lines
context/src/env/parser.rs 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1032      +/-   ##
==========================================
+ Coverage   81.40%   81.68%   +0.27%     
==========================================
  Files          69       69              
  Lines       14566    14577      +11     
==========================================
+ Hits        11858    11907      +49     
+ Misses       2708     2670      -38     

☔ 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.

@max-trunk max-trunk marked this pull request as ready for review February 5, 2026 19:11
@trunk-io trunk-io bot merged commit 4cd1871 into main Feb 5, 2026
25 checks passed
@trunk-staging-io
Copy link

trunk-staging-io bot commented Feb 5, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@trunk-io
Copy link

trunk-io bot commented Feb 5, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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.

3 participants