[Test Optimization] Improve GitHub Actions `@ci.job.url` format by tonyredondo · Pull Request #8098 · DataDog/dd-trace-dotnet
…navigation
Fixes the `@ci.job.url` tag to construct proper job-specific URLs that navigate
directly to the job logs instead of the commit checks page.
Core changes:
- Add `JOB_CHECK_RUN_ID` environment variable support for explicit job ID
- Implement diagnostics file parsing to extract numeric job ID from Worker_*.log
- Use dual extraction strategy: JSON parse with regex fallback for robustness
- Construct correct URL format: `{repo}/actions/runs/{run_id}/job/{job_id}`
Priority order for job ID resolution:
1. `JOB_CHECK_RUN_ID` environment variable (set via `${{ job.check_run_id }}`)
2. GitHub Actions runner diagnostics files (`_diag/Worker_*.log`)
3. Fallback to `GITHUB_JOB` with commit checks URL (existing behavior)
Defensive measures:
- 10MB file size limit for diagnostics files
- Graceful error handling with debug logging
- Platform-specific diagnostic directory detection (Linux, macOS, Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters