feat: review claims via comments - #1601
Conversation
[feat maintenance] Added actions scripts to count no. of reviewers
Adds the Cloudflare Worker relay that bridges a Zulip outgoing webhook (bot receives a DM) to GitHub's repository_dispatch API, replacing the daily 8am cron trigger. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
.wrangler/ is gitignored going forward; this cache/account data shouldn't have been committed in the first place. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This automation now lives at https://github.com/Alex-Zughaid/PhysLibBots instead of inside physlib itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Backfills Jan-Jun 2026 (monthly-diffs/*.diff + index.json) and adds a scheduled workflow that generates the previous month's diff automatically on the 1st of each month, going forward.
Copilot attempt at making the diff automation workflow - happy with changes reviewed on Github
Instead of concatenating every commit's diff, compute a single diff between the last commit before the month started and the last commit within the month, strip all diff syntax, and keep only the raw lines that were added (grouped by file). Also fixes commit selection to walk the first-parent chain only - REF's history has merge commits, so two commits picked by date alone weren't guaranteed to be ancestors of each other, which was inflating some months' diffs by 5-6x.
Improved the readability of DIFF
Adds a small Verso (Manual genre) doc project that renders each month's added lines per file, then compiles that to a PDF with lualatex - mirrors how Verso builds its own User's Guide PDF. Backfills Jan-Jun 2026 and updates the scheduled workflow to build and commit the PDF each month (with Lake/Verso build caching, since a cold build compiles ~450 Lean files).
Removes the feature added in 94c58c1, reworked in 21992fb, and rebuilt on Verso/LaTeX in b0cc792: the generator scripts, the Verso doc project, the generated PDFs and index.json, and the scheduled workflow. The approach wasn't working out. Two problems drove this: - Month boundaries are resolved by walking --first-parent back from upstream/master's tip, which is required to stop non-linear history inflating a month's declaration count 5-6x. But the first-parent chain is not stable over time - a later merge can re-root the mainline, so regenerating a past month yields different contributors and line counts than the run that first produced it. - raw.githubusercontent.com serves the PDFs as application/octet-stream with X-Content-Type-Options: nosniff, so a browser can never render them inline; the links only ever downloaded a file. Co-Authored-By: Claude <noreply@anthropic.com>
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
37e01c3 to
24a20a0
Compare
Replaces the fixed `reviewing-in-1/2/3-days` labels with comment commands, so a reviewer can say `claim 5 days` rather than being limited to the windows someone thought to make a label for, and can claim without repository permissions. claim -- claim this PR for review, for the default 2 day window claim 5 days -- ... for a specific window (hours / days / weeks) claim 2026-08-01 -- ... until a specific date disclaim -- release the claim early The bot requests a review from the claimant, assigns them, applies `review-claimed` and keeps one status comment per PR whose hidden marker carries the whole claim record, edited in place as the claim is extended, completed or released. Reviewing completes the claim; `review_claim_expiry.yml` reminds the claimant 48h and 24h before the deadline and releases stale claims hourly, so nothing stays blocked forever. A claim that runs out without a review takes the claimant back off the PR as reviewer and assignee, and is announced on the `PR reviews` Zulip topic so that somebody else can pick the PR up -- using the same bot credentials as the workers in Alex-Zughaid/PhysLibBots. Only failures are announced. Missing Zulip secrets or a Zulip outage downgrade to a warning: releasing the claim on GitHub matters more than announcing it. A claim is cooperative rather than a lock: anyone may review a claimed PR. The one thing the bot refuses is silently overwriting a live claim -- a second `claim` is answered with who holds it and until when -- while the claimant can always `disclaim` and maintainers can release a claim on someone else's behalf. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
24a20a0 to
c3195dc
Compare
Replaces the fixed `reviewing-in-1/2/3-days` labels with comment commands, so a reviewer can say `claim 5 days` rather than being limited to the windows someone thought to make a label for, and can claim without repository permissions. claim -- claim this PR for review, for the default 2 day window claim 5 days -- ... for a specific window (hours / days / weeks) claim 2026-08-01 -- ... until a specific date disclaim -- release the claim early The bot requests a review from the claimant, assigns them, applies `review-claimed` and keeps one status comment per PR whose hidden marker carries the whole claim record, edited in place as the claim is extended, completed or released. Reviewing completes the claim; `review_claim_expiry.yml` reminds the claimant 48h and 24h before the deadline and releases stale claims hourly, so nothing stays blocked forever. A claim that runs out without a review takes the claimant back off the PR as reviewer and assignee, and is announced on the `PR reviews` Zulip topic so that somebody else can pick the PR up -- using the same bot credentials as the workers in Alex-Zughaid/PhysLibBots. Only failures are announced. Missing Zulip secrets or a Zulip outage downgrade to a warning: releasing the claim on GitHub matters more than announcing it. A claim is cooperative rather than a lock: anyone may review a claimed PR. The one thing the bot refuses is silently overwriting a live claim -- a second `claim` is answered with who holds it and until when -- while the claimant can always `disclaim` and maintainers can release a claim on someone else's behalf. All three jobs are guarded on `github.repository`, as in `add_label_from_diff.yaml` and `pr_size_label.yaml`, so that forks do not run them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
c3195dc to
012ad62
Compare
claim / disclaim comments
claim / disclaim comments|
claim |
|
What happens when they review the PR, will they still get a comment? |
They don't get a comment and they aren't removed as a reviewer |
There was a problem hiding this comment.
Move to the main scripts file if possible?
Ports the claim logic from JavaScript running inside `actions/github-script` to Python, and moves it next to the repository's other Python tooling in `scripts/` rather than hiding it under `.github/scripts/`. The two workflows are now thin wrappers: each sparse-checks-out that one file and runs `python scripts/review_claim.py comment|review|expire`. The script is stdlib-only -- urllib against the REST API -- so the jobs need no dependency install, and it can be run by hand against a repository with a GITHUB_TOKEN. Behaviour is unchanged, except that the claim record in the status comment now stores ISO 8601 timestamps rather than epoch milliseconds, which reads better for anyone looking at the comment source. The jobs run the runner's preinstalled `python3` rather than setting up their own: the script is stdlib-only, so `actions/setup-python` bought nothing but a Node 20 deprecation warning and a slower job. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
f8c8aff to
dad2ba3
Compare
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved. Will merge shortly
Allows reviewers to claim reviews by commenting
claimThe default length is 2 days, but a user can type
X days/weeks/hoursafter theclaimcommand or type a specific date.They can type
disclaimto remove themselves.Maximum time they can choose is 2 weeks.
24/48 hour warnings in the form of github comments.
If they are removed as a reviewer, they are mentioned in a comment again and also a message is sent to Zulip to let others know that the PR needs a new reviewer