From bdf8659a3466af3224cfdbef4e92e98ca3fe16b5 Mon Sep 17 00:00:00 2001 From: Tyler Beebe Date: Tue, 2 Jun 2026 16:51:17 -0400 Subject: [PATCH 1/2] fix(circleci): use CIRCLE_WORKFLOW_NAME instead of CIRCLE_WORKFLOW_ID The workflow field was being populated with a UUID (CIRCLE_WORKFLOW_ID) instead of the human-readable workflow name (CIRCLE_WORKFLOW_NAME), causing the Job Run column in the uploads page to display a raw UUID. --- context/src/env/parser.rs | 2 +- context/tests/env.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/context/src/env/parser.rs b/context/src/env/parser.rs index 82a720b4..3635ab21 100644 --- a/context/src/env/parser.rs +++ b/context/src/env/parser.rs @@ -527,7 +527,7 @@ impl<'a> CIInfoParser<'a> { }); self.ci_info.actor = self.get_env_var("CIRCLE_USERNAME"); - self.ci_info.workflow = self.get_env_var("CIRCLE_WORKFLOW_ID"); + self.ci_info.workflow = self.get_env_var("CIRCLE_WORKFLOW_NAME"); self.ci_info.job = self.get_env_var("CIRCLE_JOB"); } diff --git a/context/tests/env.rs b/context/tests/env.rs index 98c75872..40fce0db 100644 --- a/context/tests/env.rs +++ b/context/tests/env.rs @@ -1282,7 +1282,7 @@ fn test_simple_circleci() { (String::from("CIRCLE_BUILD_NUM"), String::from("6")), (String::from("CIRCLE_BUILD_URL"), String::from(&build_url)), ( - String::from("CIRCLE_WORKFLOW_ID"), + String::from("CIRCLE_WORKFLOW_NAME"), String::from(&workflow_id), ), ( @@ -1406,7 +1406,7 @@ fn test_circleci_pr() { (String::from("CIRCLE_BRANCH"), String::from(&branch)), (String::from("CIRCLE_BUILD_URL"), String::from(&build_url)), ( - String::from("CIRCLE_WORKFLOW_ID"), + String::from("CIRCLE_WORKFLOW_NAME"), String::from(&workflow_id), ), (String::from("CIRCLE_JOB"), String::from(&job_name)), From 8cd240bf15957158e2092c6de1eabf1ac93978cd Mon Sep 17 00:00:00 2001 From: Tyler Beebe Date: Tue, 2 Jun 2026 17:07:07 -0400 Subject: [PATCH 2/2] fix(circleci): leave workflow as None since CircleCI has no workflow name env var CIRCLE_WORKFLOW_ID is a UUID with no human-readable equivalent in CircleCI's built-in environment variables. Setting workflow to None means the Job Run column shows just the job name instead of a UUID prefix. CIRCLE_WORKFLOW_ID is still used for building the job_url. --- context/src/env/parser.rs | 1 - context/tests/env.rs | 18 ++++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/context/src/env/parser.rs b/context/src/env/parser.rs index 3635ab21..76a44817 100644 --- a/context/src/env/parser.rs +++ b/context/src/env/parser.rs @@ -527,7 +527,6 @@ impl<'a> CIInfoParser<'a> { }); self.ci_info.actor = self.get_env_var("CIRCLE_USERNAME"); - self.ci_info.workflow = self.get_env_var("CIRCLE_WORKFLOW_NAME"); self.ci_info.job = self.get_env_var("CIRCLE_JOB"); } diff --git a/context/tests/env.rs b/context/tests/env.rs index 40fce0db..c0471c35 100644 --- a/context/tests/env.rs +++ b/context/tests/env.rs @@ -1265,7 +1265,6 @@ fn test_bitbucket_missing_job_url_vars() { fn test_simple_circleci() { let branch = String::from("circleci-project-setup"); let build_url = String::from("https://circleci.com/gh/trunk-io/trunk2/6"); - let workflow_id = String::from("5a984496-cf63-4f63-b315-5776a3186d4b"); let job_name = String::from("unit-tests"); let username = String::from("mmatheson"); @@ -1281,10 +1280,6 @@ fn test_simple_circleci() { (String::from("CIRCLE_USERNAME"), String::from(&username)), (String::from("CIRCLE_BUILD_NUM"), String::from("6")), (String::from("CIRCLE_BUILD_URL"), String::from(&build_url)), - ( - String::from("CIRCLE_WORKFLOW_NAME"), - String::from(&workflow_id), - ), ( String::from("CIRCLE_REPOSITORY_URL"), String::from("git@github.com:trunk-io/trunk2.git"), @@ -1323,7 +1318,7 @@ fn test_simple_circleci() { author_email: None, commit_message: None, title: None, - workflow: Some(workflow_id), + workflow: None, job: Some(job_name), } ); @@ -1386,7 +1381,7 @@ fn test_circleci_app_job_url_for_github_hosted_build() { author_email: None, commit_message: None, title: None, - workflow: Some(workflow_id), + workflow: None, job: None, } ); @@ -1396,7 +1391,6 @@ fn test_circleci_app_job_url_for_github_hosted_build() { fn test_circleci_pr() { let branch = String::from("feature/add-feature"); let build_url = String::from("https://circleci.com/gh/my-org/my-repo/456"); - let workflow_id = String::from("workflow-def-456"); let job_name = String::from("build-and-test"); let username = String::from("janedoe"); let pr_number = 42; @@ -1405,10 +1399,6 @@ fn test_circleci_pr() { (String::from("CIRCLECI"), String::from("true")), (String::from("CIRCLE_BRANCH"), String::from(&branch)), (String::from("CIRCLE_BUILD_URL"), String::from(&build_url)), - ( - String::from("CIRCLE_WORKFLOW_NAME"), - String::from(&workflow_id), - ), (String::from("CIRCLE_JOB"), String::from(&job_name)), (String::from("CIRCLE_USERNAME"), String::from(&username)), (String::from("CIRCLE_PR_NUMBER"), pr_number.to_string()), @@ -1434,7 +1424,7 @@ fn test_circleci_pr() { author_email: None, commit_message: None, title: None, - workflow: Some(workflow_id), + workflow: None, job: Some(job_name), } ); @@ -1483,7 +1473,7 @@ fn test_circleci_pull_request_url_fallback() { author_email: None, commit_message: None, title: None, - workflow: Some(workflow_id), + workflow: None, job: Some(job_name), } );