Skip to content

ci: post the in-progress tests comment once per run - #25903

Merged
antobinary merged 1 commit into
bigbluebutton:v3.0.x-developfrom
germanocaumo:u30d/ci/dedupe-running-tests-comment
Oct 22, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v3.0.x-developfrom
germanocaumo:u30d/ci/dedupe-running-tests-comment

Conversation

@germanocaumo

Copy link
Copy Markdown
Contributor

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.

  • Tags the in-progress comment with the run id and attempt. An in_progress event for which that comment already exists is skipped.
  • Skips an in_progress event whose run has already completed or moved to a newer attempt, so a late event can't replace the final result with "running".
  • An in_progress comment job no longer cancels the one running for the same PR (cancel-in-progress is 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.
  • Grants the comment job actions: read to 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_run in_progress events 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_progress events came only from workflow_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 the pulls.list({ head }) lookup, so fork PRs now resolve on every in_progress event too.

How to test

workflow_run workflows always run the default branch's copy, so this PR's own checks don't exercise it. It takes effect once merged into v3.0.x-develop.

  • actionlint passes on the changed workflow.
  • I ran the "Cleanup previous comments" script under Node against a mocked GitHub API. The cases were: first event, repeat event, late event after completion, event for an older attempt after a re-run, a new attempt, a completed event, and a failed run lookup. Each one deleted and skipped as expected.

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-develop and v4.1.x-develop, so the usual forward merge carries this over.

  • Added/updated documentation

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.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2c1d4272-33a3-48ff-be97-f32d3cf3f139

📥 Commits

Reviewing files that changed from the base of the PR and between 27f85f1 and 2db5ec7.

📒 Files selected for processing (1)
  • .github/workflows/automated-tests-publish-results.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The 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
Loading

Merge Risk: ⚪ Minimal · up to 2db5e

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 Summary

Architecture risk: 🔵 Low · up to 2db5e

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .github/workflows/automated-tests-publish-results.yml: Adds an in-progress comment marker containing the workflow-run ID and attempt number.
  • observed — Modified behavior in .github/workflows/automated-tests-publish-results.yml: Changes concurrency handling so in_progress events do not cancel an existing job, while other actions still can. Adds the actions: read permission needed to query workflow-run state.
  • observed — Modified behavior in .github/workflows/automated-tests-publish-results.yml: For in-progress events, fetches the current workflow run before cleanup proceeds. If the run is completed or its attempt no longer matches the event, sets skip and returns; if fetching fails, treats the event as still in progress. Also skips when a comment containing this run attempt’s marker already exists.
  • observed — Modified behavior in .github/workflows/automated-tests-publish-results.yml: Restricts the in-progress comment step to events not marked for skipping and adds the per-attempt marker to the comment body.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main workflow change: posting the in-progress tests comment once per run.
Description check ✅ Passed The description directly explains the workflow changes, motivation, testing, and expected behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

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

@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@antobinary antobinary added this to the Release 3.0 milestone Sep 30, 2026
@antobinary antobinary mentioned this pull request Sep 30, 2026
12 of 24 tasks
@guiiBecker

Copy link
Copy Markdown
Contributor

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.

@antobinary
antobinary merged commit 1a15774 into bigbluebutton:v3.0.x-develop Oct 22, 2026
32 of 33 checks passed
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.

3 participants