Skip to content

Conversation

@tonyredondo
Copy link
Member

What does this PR do?

Improves the ci.job.url tag format for GitHub Actions to enable direct navigation to specific job logs and proper correlation between Test Optimization and CI Visibility.

Before: Generic URL routing to all jobs overview

https://github.com/{owner}/{repo}/commit/{commit_sha}/checks

After: Job-specific URL when numeric job ID is available

https://github.com/{owner}/{repo}/actions/runs/{run_id}/job/{job_id}

Changes

  • Add getGithubActionsJobID() to resolve numeric job ID in priority order:
    1. JOB_CHECK_RUN_ID environment variable
    2. GitHub Actions runner diagnostics files (Worker_*.log)
    3. Fallback to current behavior
  • Add helper functions for diagnostics parsing (JSON + regex fallback)
  • Support Linux, macOS, and Windows diagnostics directory paths
  • Add numeric validation, whitespace trimming, and file size guards
  • Guard ci.pipeline.url and ci.pipeline.id when GITHUB_RUN_ID is empty
  • Add 5 new test fixtures covering all scenarios
  • Add unit tests for isNumericJobID and diagnostics parsing

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Construct the correct job-specific URL when the numeric job ID is
available, enabling direct navigation to specific job logs and proper
correlation between Test Optimization and CI Visibility.

The numeric job ID is resolved in priority order:
1. JOB_CHECK_RUN_ID environment variable
2. GitHub Actions runner diagnostics files (Worker_*.log)
3. Fallback to current behavior (commit checks URL)

Changes:
- Add job ID resolution helpers with JSON and regex parsing
- Support Linux, macOS, and Windows diagnostics directories
- Add numeric validation and whitespace trimming
- Guard against oversized files and non-integer values
- Add comprehensive test fixtures and unit tests
@tonyredondo tonyredondo requested a review from a team as a code owner January 27, 2026 12:44
@pr-commenter
Copy link

pr-commenter bot commented Jan 27, 2026

Benchmarks

Benchmark execution time: 2026-01-27 13:05:36

Comparing candidate commit e5377ba in PR branch tony/civiz-cijoburl-fix with baseline commit fa72b69 in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 155 metrics, 8 unstable metrics.

scenario:BenchmarkParallelMetrics/gauge/get-handle-25

  • 🟩 execution_time [-12.983ns; -3.193ns] or [-11.047%; -2.717%]

@tonyredondo
Copy link
Member Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link

gh-worker-devflow-routing-ef8351 bot commented Jan 27, 2026

View all feedbacks in Devflow UI.

2026-01-27 15:29:29 UTC ℹ️ Start processing command /merge


2026-01-27 15:30:28 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 43m (p90).


2026-01-27 16:18:02 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit 0c69229:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants