Skip to content

ci(nightly-e2e): scope concurrency group by event and branch - #2379

Merged
brandonpelfrey merged 1 commit into
mainfrom
issue-2375-nightly-e2e-concurrency-group-scoping
Apr 23, 2026
Merged

brandonpelfrey merged 1 commit into
mainfrom
issue-2375-nightly-e2e-concurrency-group-scoping

Conversation

@jyaunches

@jyaunches jyaunches commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The nightly-e2e workflow used a flat concurrency group (nightly-e2e) that let workflow_dispatch runs cancel the scheduled nightly cron and vice versa. The last two consecutive nightly cron runs (Apr 22–23) were both cancelled by dispatch runs on fix/slack-auth-crash-2340, leaving no nightly data since Apr 21.

Related Issue

Fixes #2375

Changes

  • Scope concurrency group by event and branch — scheduled cron runs get their own group (nightly-e2e-schedule-schedule) while dispatch runs are scoped per-branch (nightly-e2e-workflow_dispatch-refs/heads/<branch>). Dispatch runs on different branches no longer interfere with each other or the cron.
  • Extend notify-on-failure to fire on cancelled jobs — the if condition now includes contains(needs.*.result, 'cancelled') as defense-in-depth. If a run is ever cancelled unexpectedly, the team gets notified.
  • Richer notification body — the GitHub issue/comment now lists which jobs failed vs cancelled for faster triage.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes

Testing note: This is a CI workflow YAML change — no unit/E2E tests apply. Verification requires a manual workflow_dispatch run on this branch to confirm the expression parses and the concurrency group resolves correctly. Full validation happens after merge when the next nightly cron runs uninterrupted.

AI Disclosure

  • AI-assisted — tool: pi (Claude)

Summary by CodeRabbit

  • Chores
    • Expanded nightly test failure notifications to include cancelled job reporting with detailed categorization.
    • Adjusted workflow concurrency configuration for improved job isolation.

The nightly-e2e workflow used a flat concurrency group that let
workflow_dispatch runs cancel the scheduled nightly cron (and vice
versa). Two consecutive nightly cron runs were cancelled by dispatch
runs on fix/slack-auth-crash-2340, leaving no nightly data since Apr 21.

Changes:
- Scope concurrency group by event_name and branch so scheduled runs
  and dispatch runs never interfere. Dispatch runs on different branches
  also get their own groups.
- Extend notify-on-failure to fire on cancelled jobs (not just failures)
  as defense-in-depth. The notification now lists which jobs failed vs
  cancelled for faster triage.

Fixes #2375
@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The workflow's concurrency group is refined from a single value to event-scoped buckets, preventing workflow_dispatch and scheduled runs from interfering. The notification job is expanded to trigger and report on both failures and cancellations, improving observability of interrupted runs.

Changes

Cohort / File(s) Summary
Workflow Concurrency & Notification
.github/workflows/nightly-e2e.yaml
Updated concurrency group to be event-specific (schedule vs. workflow_dispatch with branch differentiation); expanded notify-on-failure trigger condition to include cancelled job states; enhanced notification script to categorize and report both failed and cancelled job statuses into markdown summaries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A workflow once fought o'er the lock,
Till concurrency buckets stopped the clock!
Now schedules and dispatches play nice,
With notifications—oh, what a price!
No more silent cancels in the night! 🌙✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: scoping the concurrency group by event and branch to prevent workflow_dispatch runs from cancelling scheduled cron runs.
Linked Issues check ✅ Passed The changes fully implement the proposed fix from issue #2375: event-scoped concurrency groups, extended notify-on-failure condition for cancelled jobs, and enriched notification body with failed/cancelled lists.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolve issue #2375. The workflow modifications (concurrency group scoping, notify-on-failure condition, notification enrichment) are cohesive and address the stated problem.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-2375-nightly-e2e-concurrency-group-scoping

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/nightly-e2e.yaml (1)

700-707: Consider neutral outcome wording for cancellation-only runs.

Lines 700 and 707 always say “failed,” which can be inaccurate when only cancellations occurred.

✏️ Suggested wording tweak
+            const outcome = failed.length && cancelled.length
+              ? 'failed and was partially cancelled'
+              : failed.length
+                ? 'failed'
+                : 'was cancelled';

             if (match) {
               await github.rest.issues.createComment({
                 owner: context.repo.owner,
                 repo: context.repo.repo,
                 issue_number: match.number,
-                body: `Failed again on ${new Date().toISOString().split('T')[0]}.\n\n**Run:** ${runUrl}\n${summary}\n**Artifacts:** Check the run artifacts for install/test logs (artifact names vary by job).`,
+                body: `Nightly E2E ${outcome} on ${new Date().toISOString().split('T')[0]}.\n\n**Run:** ${runUrl}\n${summary}\n**Artifacts:** Check the run artifacts for install/test logs (artifact names vary by job).`,
               });
             } else {
               await github.rest.issues.create({
                 owner: context.repo.owner,
                 repo: context.repo.repo,
                 title: `${title} — ${new Date().toISOString().split('T')[0]}`,
-                body: `The nightly E2E pipeline failed.\n\n**Run:** ${runUrl}\n${summary}\n**Artifacts:** Check the run artifacts for install/test logs (artifact names vary by job).`,
+                body: `The nightly E2E pipeline ${outcome}.\n\n**Run:** ${runUrl}\n${summary}\n**Artifacts:** Check the run artifacts for install/test logs (artifact names vary by job).`,
                 labels: ['bug', 'CI/CD'],
               });
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/nightly-e2e.yaml around lines 700 - 707, The issue: the
issue body and title use the word "failed" unconditionally (in the
github.rest.issues.create calls that build title and body using title, runUrl,
and summary), which is misleading for cancellation-only runs; fix it by
computing a neutral outcome label (e.g., outcomeLabel =
summary.includes('cancel') ? 'Cancelled/Attention' : 'Failed') or derive from
the run conclusion variable, then use that outcomeLabel in the title and in the
body instead of hardcoding "failed"; update the two github.rest.issues.create
invocations to interpolate outcomeLabel into title and body (keep runUrl,
summary and artifacts text unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/nightly-e2e.yaml:
- Around line 700-707: The issue: the issue body and title use the word "failed"
unconditionally (in the github.rest.issues.create calls that build title and
body using title, runUrl, and summary), which is misleading for
cancellation-only runs; fix it by computing a neutral outcome label (e.g.,
outcomeLabel = summary.includes('cancel') ? 'Cancelled/Attention' : 'Failed') or
derive from the run conclusion variable, then use that outcomeLabel in the title
and in the body instead of hardcoding "failed"; update the two
github.rest.issues.create invocations to interpolate outcomeLabel into title and
body (keep runUrl, summary and artifacts text unchanged).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 519fb189-d40e-45eb-9a02-86aa4a0f8efa

📥 Commits

Reviewing files that changed from the base of the PR and between 02dff1e and d283488.

📒 Files selected for processing (1)
  • .github/workflows/nightly-e2e.yaml

@brandonpelfrey
brandonpelfrey merged commit 1a34560 into main Apr 23, 2026
39 of 58 checks passed
ericksoa added a commit that referenced this pull request Apr 23, 2026
…ds list)

Merge main into fix/nightly-e2e-repairs-v4, resolving the conflict in
.github/workflows/nightly-e2e.yaml:
- Keep multi-line needs array format (PR readability)
- Restore cloud-experimental-e2e in needs list (from main)
- Adopt cancelled-job notification condition (from #2379)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions bug-fix PR fixes a bug or regression chore Build, CI, dependency, or tooling maintenance and removed CI/CD bug-fix PR fixes a bug or regression labels Jun 3, 2026
@jyaunches
jyaunches deleted the issue-2375-nightly-e2e-concurrency-group-scoping branch June 12, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(nightly-e2e): workflow_dispatch runs cancel scheduled nightly cron via shared concurrency group

3 participants