Skip to content

Remove unnecessary test dependency from canary_go job#13925

Merged
pelikhan merged 2 commits intomainfrom
copilot/remove-test-dependency-canary-job
Feb 5, 2026
Merged

Remove unnecessary test dependency from canary_go job#13925
pelikhan merged 2 commits intomainfrom
copilot/remove-test-dependency-canary-job

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

The canary_go job waited for both test and integration jobs to complete before starting, but only needs integration. GitHub Actions' download-artifact fetches artifacts by name/pattern from the entire workflow run, not just from dependent jobs.

Change

# Before
needs: [test, integration]

# After  
needs: [integration]  # test dependency removed - download-artifact fetches by name, not job dependency

Impact

  • Performance: Canary starts immediately after integration completes (~2-3 min savings when test outlasts integration)
  • Functionality: No change - artifacts from both jobs remain available via pattern matching (test-result-*)
  • Risk: None - artifact availability is independent of job dependencies

The canary job downloads both test-result-unit and test-result-integration-* artifacts using pattern matching. Since both source jobs upload independently, explicit dependency on test is unnecessary.

Original prompt

This section details on the original issue you should resolve

<issue_title>[ci-coach] Remove unnecessary test dependency from canary_go job</issue_title>
<issue_description>### Summary
Removes the unnecessary test job dependency from the canary_go job. The canary job downloads test artifacts but doesn't need to wait for the unit test job to complete before starting.

Optimization

Remove Test Dependency from Canary Job

Type: Job Dependency Optimization
Impact: ~2-3 minutes per run
Risk: Very Low
Changes:

  • Line 393: Removed test from needs: [test, integration]needs: [integration]

Current Flow:

lint ─┬─→ test ────┐
      │            ├─→ canary_go
      └─→ integration ┘
``````

**Proposed Flow:**
``````
lint ─┬─→ test
      │
      └─→ integration ─→ canary_go

Rationale:
The canary_go job's purpose is to verify test coverage by downloading artifacts from both unit and integration tests. GitHub Actions' download-artifact action fetches artifacts by name regardless of job dependencies - it only requires that the artifacts exist. Since both test and integration jobs upload their artifacts independently (test-result-unit and test-result-integration-*), the canary job will successfully download both sets of artifacts even without an explicit dependency on test.

By removing this dependency:

  • Canary starts as soon as integration finishes (instead of waiting for both test and integration)
  • In cases where test finishes after integration (~2-3 min typical), canary starts earlier
  • No functionality impact - artifacts are still available via download-artifact

Expected Impact

  • Time Savings: ~2-3 minutes per run when test job outlasts integration
  • Risk Level: Very Low - artifacts are uploaded independently and remain available
  • Functionality: No change - canary still downloads and analyzes both unit and integration test results

Validation Results

✅ All validations passed:

  • YAML syntax: python3 -c "import yaml; yaml.safe_load(...)" - passed
  • Change is minimal: 1 line modified
  • Comment added explaining the change

Testing Plan

  • Verify YAML syntax is valid
  • Monitor canary job on next CI run
  • Confirm artifacts are still downloaded successfully
  • Validate test coverage analysis still works

Analysis Context

This optimization was identified by the CI Coach workflow (run #69) after analyzing 100 recent CI runs. The analysis found:

Current CI Health:

  • ✅ Test coverage: 100% (20,004/20,004 tests executed)
  • ✅ Integration matrix well-balanced (31 groups)
  • ✅ Proper caching and parallelization
  • ⚠️ Only issue: unnecessary job dependency

Why This Change:
The CI workflow is already well-optimized. This is the only clear low-risk optimization identified. Other potential improvements (reducing matrix size, cache optimization) have higher risk or lower impact.

Metrics Baseline:

  • Success rate (last 100 runs): 44% (includes cancelled/failed PRs)
  • Integration matrix: 31 groups
  • Test coverage: 100%

Analysis performed by CI Coach workflow run §69

AI generated by CI Optimization Coach

  • expires on Feb 7, 2026, 1:39 PM UTC

[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To apply the patch locally:

# Download the artifact from the workflow run https://github.com/github/gh-aw/actions/runs/21713303397
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 21713303397 -n agent-artifacts

# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patch
Show patch (37 lines)
From 645ea5b120c66a2cf0f8cf1daaddf369bc57f178 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Thu, 5 Feb 2026 13:37:02 +0000
Subject: [PATCH] ci: remove unnecessary test dependency from canary_go job

The canary_go job verifies test coverage by collecting artifacts from both
unit and integration test jobs. However, it doesn't need to wait for the
test job to complete - it only needs the artifacts, which are uploaded
independently.

Benefits:
- Removes unnecessary dependency
- Canary can start as soon as integration finishes
- No functionality impact - artifacts still available via download-artifact

This is a minimal optimization with very low risk.
---
 .github/workflows/ci.yml...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes github/gh-aw#13921

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

The canary_go job downloads test artifacts using the download-artifact
action with pattern matching (test-result-*). This action fetches artifacts
by name from the entire workflow run, regardless of job dependencies.

Since both test and integration jobs upload their artifacts independently,
canary_go can start as soon as integration finishes without waiting for
the test job to complete, saving 2-3 minutes in typical runs.

No functionality impact - artifacts remain available via pattern matching.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unnecessary test dependency from canary_go job Remove unnecessary test dependency from canary_go job Feb 5, 2026
Copilot AI requested a review from pelikhan February 5, 2026 13:57
@pelikhan pelikhan marked this pull request as ready for review February 5, 2026 14:01
Copilot AI review requested due to automatic review settings February 5, 2026 14:01
@pelikhan pelikhan merged commit 31807fc into main Feb 5, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/remove-test-dependency-canary-job branch February 5, 2026 14:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the CI workflow by removing an unnecessary job dependency. The canary_go job previously waited for both test and integration jobs to complete, but only needed to wait for integration since GitHub Actions' download-artifact fetches artifacts by name/pattern from the entire workflow run, not just from dependent jobs.

Changes:

  • Removed test from the needs array of the canary_go job, allowing it to start as soon as integration completes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants