Repository navigation
ci: post the in-progress tests comment once per run - #25903
antobinary merged 1 commit into
Conversation
GitHub sends several workflow_run in_progress events for a single "Automated tests" run, often three or more. Each one started a publish-results run that deleted the PR's comment and posted "Automated tests are running..." again. Since e4fd6ef resolves the PR for fork branches on in_progress events too, this now happens on nearly every PR. Tag the in-progress comment with the run id and attempt, and skip an in_progress event when that comment is already there. Also skip it when the run has already completed or moved to a newer attempt, so a late event can't replace the final result with "running". The comment job now reads the run, so grant it actions: read. If that read fails, post as before. An in_progress comment job no longer cancels the one running for the same PR. Otherwise a late in_progress event would cancel the job posting the final result and then skip itself, leaving no result comment. It waits instead, and skips once the result is posted.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe workflow adds a run-and-attempt marker to in-progress comments. It avoids cancelling an existing job for in-progress events. Before posting, it checks whether the run has completed, whether the attempt matches the event, and whether a comment with the marker already exists. If fetching the run fails, the workflow treats it as still in progress. Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub event
participant Workflow as comment-pr job
participant Runs as Workflow run API
participant Comments as Pull request comments
GitHub->>Workflow: Start in-progress event
Workflow->>Runs: Fetch current run
alt Run completed or attempt differs
Runs-->>Workflow: Run state and attempt
Workflow->>Workflow: Skip comment
else Run is in progress or fetch fails
Workflow->>Comments: Check for attempt marker
alt Marker exists
Comments-->>Workflow: Matching comment found
Workflow->>Workflow: Skip comment
else Marker absent
Comments-->>Workflow: No matching comment
Workflow->>Comments: Post marked in-progress comment
end
end
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is established. The workflow prevents repeated in-progress comments while preserving completed-result handling; confirm behavior on the default branch after merging. Architecture SummaryArchitecture risk: 🔵 Low · up to The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency. Changed systems: None identified. Architecture concerns Review detailsBefore / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
🚨 Automated tests failed |
|
he in-progress dedupe looks right to me: the marker is unique per run attempt, and listing comments before Workflow means a late event that comes after the result was posted always sees completed. |
1a15774
into
bigbluebutton:v3.0.x-develop
What does this PR do?
Stops the "⏳ Automated tests are running..." comment from being deleted and re-posted several times during a single test run.
in_progressevent for which that comment already exists is skipped.in_progressevent whose run has already completed or moved to a newer attempt, so a late event can't replace the final result with "running".in_progresscomment job no longer cancels the one running for the same PR (cancel-in-progressis now false for it). Otherwise a late event would cancel the job posting the final result, then skip itself, and the PR would end up with no result comment.actions: readto look up the run. If that lookup fails, it posts as before.Completed events (passed / failed / cancelled) are handled exactly as before.
Closes Issue(s)
Closes #
Motivation
GitHub sends several
workflow_runin_progressevents for one "Automated tests" run. For example, run 36738867835 on #25901 triggered three publish-results runs (at 15:44:28, 15:44:45 and 15:46:59), and one run on 2026-09-08 triggered seven. Each of them deleted the marker comment and posted a new one.This became visible on almost every PR after e4fd6ef (2026-09-03). Before it, the PR number for
in_progressevents came only fromworkflow_run.pull_requests, which GitHub leaves empty for fork branches. Most in-progress events resolved no PR ("No open PR matched commit+head repo+branch"), and the comment job was skipped. e4fd6ef added thepulls.list({ head })lookup, so fork PRs now resolve on everyin_progressevent too.How to test
workflow_runworkflows always run the default branch's copy, so this PR's own checks don't exercise it. It takes effect once merged intov3.0.x-develop.actionlintpasses on the changed workflow.After merging, open a PR and watch the comment: it should be posted once when tests start and replaced once by the result.
More
The file is identical on
v4.0.x-developandv4.1.x-develop, so the usual forward merge carries this over.