Skip to content

ci: require linked PR discussion for awaiting-zulip - #45150

Open
kim-em wants to merge 1 commit into
masterfrom
ci/awaiting-zulip-link
Open

kim-em wants to merge 1 commit into
masterfrom
ci/awaiting-zulip-link

Conversation

@kim-em

@kim-em kim-em commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Require open PRs labelled awaiting-zulip to link, in their description or comments, to a Zulip topic that references that same mathlib PR. After a manual label addition, remove the label if no qualifying discussion is linked, and leave a polite, actionable comment mentioning the person who applied it.

The comment-labeling bot checks before applying awaiting-zulip and declines invalid requests, mentioning the requester. It uses the same validator as the manual-label check, since its GITHUB_TOKEN label changes do not trigger another workflow. It scans issue comments, review bodies, and inline comments; follows message anchors across topic renames; and checks the whole topic. Full GitHub URLs and linkifiers are recognised through rendered destinations and topic-title links, matching the repository and PR number rather than bare numbers.

Checks run on label and PR/comment changes, with a daily sweep to retry missed events/outages and catch changes on Zulip. Manual runs default to dry-run. Verification failures leave labels untouched; notices are updated rather than duplicated. Privileged jobs execute the default branch's action, and tests run without the Zulip secret.


The first scheduled sweep after merge will also enforce this on existing labels. Uses the existing ZULIP_API_KEY and mathlib Zulip bot account; linked private topics must be accessible to that bot. The live dry run used my account's read access, so it does not establish the bot's private-channel permissions.

Motivated by #44489 (comment).

🤖 prepared with Codex

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

PR summary 156db1ec70

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ API:
+ APITests(unittest.TestCase):
+ EnforcementTests(unittest.TestCase):
+ FakeGitHub:
+ FakeZulip:
+ Guard:
+ Links(HTMLParser):
+ MutationFailed(Exception):
+ NoRedirects(HTTPRedirectHandler):
+ ReferenceTests(unittest.TestCase):
+ TopicAPI:
+ TopicTests(unittest.TestCase):
+ Unavailable(Exception):
+ Zulip:
+ decode_topic(value):
+ directive(body):
+ label_event(events):
+ labeler(event,
+ link(url,
+ message(content="",
+ notice(number,
+ references_pr(message,
+ request_comment(event):
+ run():
+ zulip_urls(texts):

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 156db1e).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit 156db1ec70
Reference commit cc1ab32a3c

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

⚠️ Workflow documentation reminder

This PR modifies files under .github/workflows/.
Please update docs/workflows.md if the workflow inventory, triggers, or behavior changed.

Modified workflow files:

  • .github/workflows/awaiting_zulip.yml
  • .github/workflows/labels_from_comment.yml

@github-actions github-actions Bot added the CI Modifies the continuous integration setup or other automation label Oct 21, 2026
@SnirBroshi

Copy link
Copy Markdown
Collaborator

FWIW I intentionally did not link the discussion as it is private, and instead linked to the public discussion in #44115

@joneugster joneugster Oct 24, 2026 •

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.

Snir does have a point, currently the awaiting-zulip label is sometimes used for a general awaiting-discussion or needs-discussion. Maybe we need such a label, so that there is no "zulip" in it's name?

Sometimes it's desirable to ask the author to go and start their PR on Zulip and there might not be any topic existing yet. This is especially on PRs where it's foreseeable that the change is controversial. I don't think it should be the responsibility of the reviewer to open a Zulip topic about a PR they feel like would benefit from some discussion about it. (arguably in that case, one could also apply awaiting-author if awaiting-zulip was somehow guarded by a script)

Probably Snir's comment there could have been a bit more specific to help others understand the full context. But also, that particular discussion has been happening in several different places and the "conclusion" hasn't been implemented due to time constrains, so it's somewhat unfortunate.

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.

On another note, I wonder if it would be more than enough to simply check fro the existence of a link to Zulip and dropping all the validation on the Zulip-side.

This seems to add a lot of complexity and a lot of python for not much gain...

@joneugster joneugster added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Oct 24, 2026
@joneugster

Copy link
Copy Markdown
Member

(ironically, I would like to add awaiting-zulip on this PR and suggest this to be discussed on Zulip, for example in the reviewer channel or among maintainers, but afaik there's no topic to link to)

@grunweg

grunweg commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

This has been discussed in the mathlib maintainers stream. A tweaked proposal has been suggested there, which seems to have consensus there. I just audited all PRs tagged awaiting-zulip to this effect.

To me, sensible next steps are

  • posting in the reviewers channel, for additional feedback
  • adapting this PR to match the eventual proposal (right now, it differs from it)

@grunweg grunweg added the awaiting-zulip There is a Zulip discussion; the author should await and report/implement the decision reached there label Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. awaiting-zulip There is a Zulip discussion; the author should await and report/implement the decision reached there CI Modifies the continuous integration setup or other automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants