ci: deduplicate PR runs and serialize live E2E#1888
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe CI workflow deduplicates pull request runs, validates E2E domain outputs, and serializes live E2E execution. Live runs consume dry-run outputs, reject superseded pull request runs before testing, and are covered by expanded workflow assertions. ChangesCI and live E2E gating
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Actions workflow
participant DryRun as e2e-dry-run
participant LiveE2E as e2e-live
participant API as GitHub Actions API
Workflow->>DryRun: Resolve and validate E2E domains
DryRun-->>Workflow: Publish mode, reason, and live_packages
Workflow->>LiveE2E: Start when prerequisites and outputs allow live testing
LiveE2E->>API: Check for newer pull request workflow runs
API-->>LiveE2E: Return workflow run data
LiveE2E->>LiveE2E: Run tests only when the run is not superseded
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@ceb5da9e4a7a28b2ddfa686341eb77b834f6a1b9🧩 Skill updatenpx skills add larksuite/cli#ci/serialize-live-e2e -y -g |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 13-15: Update the workflow concurrency configuration around the
top-level concurrency group so the e2e-live job is not governed by the
pull_request cancellation group. Exclude that job from the shared group or move
it into a separate workflow, while preserving cancellation for other pull
request jobs.
- Around line 321-325: Update the actionlint version or its configuration used
for the CI workflow so the valid concurrency.queue setting under the
lark-cli-e2e-live-shared-bot group is accepted. If upgrading is not feasible,
add a narrowly scoped ignore targeting this workflow’s concurrency.queue
diagnostic without suppressing unrelated actionlint errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 74d4493b-1852-4a03-85a5-e789c67e30ed
📒 Files selected for processing (2)
.github/workflows/ci.ymlscripts/ci-workflow.test.sh
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1888 +/- ##
==========================================
+ Coverage 74.66% 74.73% +0.06%
==========================================
Files 878 887 +9
Lines 91764 92644 +880
==========================================
+ Hits 68520 69235 +715
- Misses 17930 18050 +120
- Partials 5314 5359 +45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Controlled runtime validation completed on the PR head:
This proves the scheduler behavior and one successful serialized execution. It does not yet constitute a statistically significant before/after failure-rate comparison; that requires post-merge observation across multiple runs. |
Make the dry-run result a hard prerequisite for live E2E so skip-mode changes never acquire the repository-wide slot. This intentionally trades one full dry-run duration of live startup latency for lower contention on the exclusive queue.
The dry-run job is now a hard prerequisite for live E2E. Bound its execution so a stalled planning job cannot delay a PR verdict for the default six-hour job limit.
Summary
Pull request updates can overlap CI runs, while live E2E uses repository-wide shared resources that require exclusive execution. This PR cancels superseded PR work, keeps no-op live jobs out of the exclusive queue, and lets an already-started live test continue toward normal cleanup before the next live job starts, subject to its timeout and runner availability.
Changes
.github/workflows/ci.yml; push and manual runs remain independent, and non-PR runs retain GitHub's default title.e2e-dry-runthe live planning gate. It validates and publishes mode/package outputs with a 20-minute timeout; failed or skip-mode plans do not enter the live queue, while the requiredresultsjob still reports dry-run failure.e2e-livewithqueue: max, no in-progress cancellation, and a 30-minute timeout. Under ordinary PR supersession, an active Go test can continue sot.Cleanuphas an opportunity to finish. The timeout bounds how long a started live job can hold the exclusive slot; pending queue time is not covered.gotestsumstarts. The fail-closed lookup is scoped to the current head branch and GitHub-reported head repository, preventing cross-PR spoofing and avoiding repository-wide workflow-history scans. An Actions API failure may reject a valid live start rather than risk running an unverified stale job.scripts/ci-workflow.test.shto lock the scheduling, output-validation, permissions, cleanup, timeout, and supersession contracts.Test Plan
make script-testpassed (103 tests)bash -n scripts/ci-workflow.test.sh, workflow YAML parsing, andgit diff --checkpassedgo mod tidy -diffproduced no module changesresults, and golangci-lint, passed on the dry/live gating commit (run 29432206219)Related Issues
N/A