Skip to content

Conversation

@KRRT7
Copy link
Collaborator

@KRRT7 KRRT7 commented Dec 7, 2025

PR Type

Enhancement


Description

  • Add concurrency groups to all workflows

  • Enable cancel-in-progress for PR runs

  • Reduce redundant CI runs on updates

  • Standardize concurrency config across pipelines


Diagram Walkthrough

flowchart LR
  PR["Pull Request updates"] -- "triggers workflows" --> WF["Multiple GHA workflows"]
  WF -- "concurrency grouped by workflow+ref" --> CG["Concurrency groups"]
  CG -- "cancel in progress true" --> CI["Abort older in-flight runs"]
  CI -- "run latest only" --> Result["Faster, less redundant CI"]
Loading

File Walkthrough

Relevant files
Enhancement
12 files
e2e-async.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-bubblesort-benchmark.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-bubblesort-pytest-nogit.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-bubblesort-unittest.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-coverage-optimization.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-futurehouse-structure.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-init-optimization.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-topological-sort.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
e2e-tracer-replay.yaml
Add workflow concurrency and cancel-in-progress                   
+4/-0     
mypy.yml
Add concurrency and cancel-in-progress to type checks       
+4/-0     
unit-tests.yaml
Add concurrency and cancel-in-progress to unit tests         
+4/-0     
windows-unit-tests.yml
Add concurrency and cancel-in-progress to Windows tests   
+4/-0     

@github-actions github-actions bot added workflow-modified This PR modifies GitHub Actions workflows Review effort 2/5 labels Dec 7, 2025
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Concurrency Scope

Using group ${{ github.workflow }}-${{ github.ref }} may not cancel older runs for the same PR if github.ref differs between PR events and push events; consider ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }} or ${{ github.workflow }}-${{ github.ref_name }} to consistently group by branch/PR.

group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Cross-Event Grouping

The workflow is triggered by push, pull_request, and workflow_dispatch; verify that the chosen concurrency group prevents unintended cross-cancellation between branch pushes and PR runs from forks, or adjust to include repository/head_ref to avoid collisions.

group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
PR File Context

cancel-in-progress only applies within the same concurrency group; ensure PR-only runs use a group keyed to the PR head ref so successive commits to the same PR cancel prior e2e runs as intended.

group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

@KRRT7 KRRT7 enabled auto-merge (squash) December 7, 2025 06:48
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use ref_name for grouping

Replace github.ref in the concurrency group with github.ref_name to avoid creating
separate groups for refs with different prefixes (e.g., refs/pull/... vs
refs/heads/...). This ensures proper cancellation across retries and updates on the
same PR/branch. Keep the workflow-scoped part to avoid cross-workflow cancellations.

.github/workflows/mypy.yml [9-12]

 concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}
+  group: ${{ github.workflow }}-${{ github.ref_name }}
   cancel-in-progress: true
Suggestion importance[1-10]: 7

__

Why: The existing_code matches the new hunk and the change to use github.ref_name improves concurrency grouping across events/refs without altering behavior otherwise. It's a solid maintainability/behavior fix but not critical.

Medium
Normalize concurrency group key

Use github.ref_name instead of github.ref so multiple runs of the same branch or PR
share a concurrency group and cancel correctly. github.ref includes the refs/*
prefix, fragmenting groups and defeating the cancel-in-progress intent.

.github/workflows/unit-tests.yaml [9-12]

 concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}
+  group: ${{ github.workflow }}-${{ github.ref_name }}
   cancel-in-progress: true
Suggestion importance[1-10]: 7

__

Why: Correctly targets the added concurrency block and using github.ref_name will reduce fragmented groups, improving cancel-in-progress behavior; moderate impact, accurate fix.

Medium
Align group across events

Switch to github.ref_name to avoid differing group keys across event types
(pull_request, workflow_dispatch) and ensure in-progress runs are actually canceled
for the same PR/branch. This prevents parallel duplicates from slipping through.

.github/workflows/e2e-async.yaml [10-13]

 concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}
+  group: ${{ github.workflow }}-${{ github.ref_name }}
   cancel-in-progress: true
Suggestion importance[1-10]: 7

__

Why: The snippet exists at the specified lines and the switch to github.ref_name is accurate and beneficial for consistent cancellation across event types, offering a meaningful but not critical improvement.

Medium

@KRRT7 KRRT7 requested a review from a team December 7, 2025 07:14
@Saga4 Saga4 disabled auto-merge December 7, 2025 07:20
@Saga4 Saga4 merged commit 7a64cd2 into main Dec 7, 2025
9 of 30 checks passed
@Saga4 Saga4 deleted the cancel-in-progress branch December 7, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 workflow-modified This PR modifies GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants