Skip to content

ci: post the daily CI approval reminder to Slack with AI triage labels - #4645

Merged
dolfim-ibm merged 1 commit into
mainfrom
ci/pr-approval-reminder-slack
Oct 7, 2026
Merged

dolfim-ibm merged 1 commit into
mainfrom
ci/pr-approval-reminder-slack

Conversation

@dolfim-ibm

Copy link
Copy Markdown
Member

Rewrites the PR Workflow Approval Reminder workflow. Every morning, it posts to Slack the open PRs whose CI waits for a maintainer to approve it.

Why a rewrite

The current workflow has three problems:

  • It looks for runs with the waiting status. Runs that wait for approval have the conclusion action_required instead, so it never finds a PR.
  • It reads only the first 30 open PRs.
  • It puts the message, which contains PR titles, into a shell command with ${{ }}. This allows shell injection.

What it does now

  • Finding waiting runs: it finds pull_request runs with the conclusion action_required. It matches them to open PRs by the current head commit, because runs from forks have an empty pull_requests list. A run for an older commit of a PR does not count. Draft PRs are skipped.

  • Message: it groups the PRs by their AI triage label (see ci: add advisory AI triage for pull requests before CI approval #4639):

    • ai:ci-safe
    • ai:ci-needs-care
    • not triaged

    Each PR shows a link, the author, how long the CI has waited, and the other ai:* labels, for example ai:possible-duplicate. The oldest PRs come first, and the list shows at most 40.

  • Posting: it posts a Block Kit message to Slack through the PR_REMINDER_SLACK_WEBHOOK secret. PR titles are escaped, so they cannot form links or mentions, and they never reach a shell. When no PR waits, it posts nothing.

  • Schedule: every day at 06:00 in the Europe/Zurich time zone. The timezone key of schedule handles daylight saving time. Only docling-project/docling runs it, not forks. A workflow_dispatch run with dry_run prints the message in the log instead of posting it.

This replaces the Discord webhook. The PR_REMINDER_DISCORD_WEBHOOK secret is not used anymore.

Setup needed before merge

  • Create a Slack incoming webhook for the maintainer channel.
  • Store it as the secret PR_REMINDER_SLACK_WEBHOOK. Without the secret, the job prints the message and shows a warning.

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Review evidence:

  • uv run pytest tests/test_pr_approval_reminder.py: 3 passed. The tests cover matching by head commit, drafts, old commits, grouping, escaping, and splitting long lists.
  • make validate: passed.
  • A local dry run (--dry-run) against docling-project/docling found 14 open PRs that wait for CI approval. The oldest waits 22 days. All 14 are in "Not triaged", because the AI triage is not merged yet.
  • Not run: a real post to Slack, because no webhook exists yet.

Rewrite the PR workflow approval reminder:

- Find waiting runs by the `action_required` conclusion. The old check looked
  for the `waiting` status, which these runs never have, so it found no PR.
- Match runs to open PRs by the current head commit, because runs from forks
  have no `pull_requests` entry. Read all pages of open PRs and runs.
- Group the PRs by their AI triage label (ai:ci-safe, ai:ci-needs-care, not
  triaged) and show the other ai:* labels, the author, and the waiting time.
- Post to Slack with Block Kit through the PR_REMINDER_SLACK_WEBHOOK secret.
  PR titles are escaped and never reach a shell.
- Run every day at 06:00 Europe/Zurich, only in the upstream repository.

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @dolfim-ibm, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@PeterStaar-IBM
PeterStaar-IBM self-requested a review October 7, 2026 13:16

@PeterStaar-IBM PeterStaar-IBM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

@dolfim-ibm
dolfim-ibm merged commit 60b6f54 into main Oct 7, 2026
46 checks passed
@dolfim-ibm
dolfim-ibm deleted the ci/pr-approval-reminder-slack branch October 7, 2026 15:38
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.

2 participants