From 5023b81988c1ed7b890f0a35371120051dc50d8c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Feb 2026 22:06:18 +0000 Subject: [PATCH] Normalize org_url_slug to lowercase Automatically converts the org_url_slug parameter to lowercase during argument parsing to ensure consistent organization slug handling regardless of how the user provides the value. Implements TRUNK-17528 Slack thread: https://trunk-io.slack.com/archives/C09E85RBK0B/p1770759586804229?thread_ts=1770753745.539689&cid=C09E85RBK0B https://claude.ai/code/session_01Gn6ectQLY8ec7UwMP1xk6V --- cli/src/upload_command.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/src/upload_command.rs b/cli/src/upload_command.rs index cddcbbfe..beb4b652 100644 --- a/cli/src/upload_command.rs +++ b/cli/src/upload_command.rs @@ -68,7 +68,7 @@ pub struct UploadArgs { help = "Comma-separated list of glob patterns to test report files. Supports JUnit XML, Bazel BEP, and XCResult formats." )] pub test_reports: Vec, - #[arg(long, env = constants::TRUNK_ORG_URL_SLUG_ENV, help = "Organization url slug.")] + #[arg(long, env = constants::TRUNK_ORG_URL_SLUG_ENV, value_parser = parse_org_url_slug, help = "Organization url slug.")] pub org_url_slug: String, #[arg( long, @@ -270,6 +270,10 @@ fn parse_sha(s: &str) -> anyhow::Result { } } +fn parse_org_url_slug(s: &str) -> anyhow::Result { + Ok(s.to_lowercase()) +} + impl UploadArgs { pub fn new( token: String, @@ -280,7 +284,7 @@ impl UploadArgs { ) -> Self { Self { junit_paths, - org_url_slug, + org_url_slug: org_url_slug.to_lowercase(), token, repo_root, allow_empty_test_results: true,