fix(execute): don't overwrite env-derived ADO context with None CLI args#413
Conversation
build_execution_context unconditionally replaced ado_org_url and ado_project (resolved by ExecutionContext::default() from SYSTEM_TEAMFOUNDATIONCOLLECTIONURI / SYSTEM_TEAMPROJECT) with the CLI argument values — which are None when the flags are omitted. This caused 'AZURE_DEVOPS_ORG_URL not set' errors for every safe output that needs an org URL during pipeline execution. Only override the env-derived values when the CLI flags are explicitly provided, and re-derive ado_organization when the URL is overridden. Co-authored-by: Copilot <[email protected]>
🔍 Rust PR ReviewSummary: Fix is correct — looks good to merge. Findings✅ What Looks Good
|
|
@copilot implement suggestion: The org-name extraction logic is now duplicated between result.rs::from_env_lookup and main.rs::build_execution_context. Consider extracting a small private helper (e.g. fn org_from_url(url: &str) -> Option) in result.rs and calling it from both sites — eliminates the risk of the two copies drifting if the URL format ever changes (e.g. on-prem `(server/redacted) Not a blocker for this fix. |
…cation Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/d1969572-fd31-4c6f-85f0-cf5878796285 Co-authored-by: jamesadevine <[email protected]>
Done in d8fb969. Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Problem
build_execution_contextinmain.rsunconditionally overwrotectx.ado_org_urlandctx.ado_projectwith the CLI argument values. When the--ado-org-url/--ado-projectflags are not passed (the normal case during pipeline execution), these areNone— wiping out the values thatExecutionContext::default()had correctly resolved from the ADO built-in variablesSYSTEM_TEAMFOUNDATIONCOLLECTIONURIandSYSTEM_TEAMPROJECT.This caused all safe outputs requiring an org URL to fail with:
Fix
Only override the env-derived fields when the CLI flags are explicitly provided. When the org URL is overridden via CLI,
ado_organizationis also re-derived to stay consistent.Testing
cargo build✅cargo test— all 8 test suites pass ✅