Repository navigation
Closed
Labels
priority: mediumShould be addressed in the normal course of developmentstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: feature requestA request to add new functionality that does not currently exist
Description
Summary
Add a comment-command interface to the CLDMV bot: a maintainer comments @cldmv-bot <command> on a PR and a reusable v4 workflow runs the matching automation. The first command is @cldmv-bot rebase.
Motivation
Open PR branches regularly fall behind next, most visibly after a release when next-reset resets next to master and every open branch suddenly carries the already-released commits (see the "After a release: rebase open PR branches cut from the old next" routine). Rebasing today means a local clone, a rebase, a re-run of the gates and a --force-with-lease push. A bot command would make the common case a one-line comment.
Proposed behaviour: @cldmv-bot rebase
- Triggered by an
issue_commentevent on a pull request whose body starts with@cldmv-bot rebase. - Only acts for commenters with write access or higher (checked with the collaborator permission API); anyone else gets a short refusal comment or a silent ignore.
- Rebases the PR head branch onto the current tip of the PR's base branch (
next, orhotfixes), keeping only the branch's own commits. After a release, where the branch was cut from the pre-releasenext, it usesgit rebase --onto <base> <old merge-base>so the released commits drop out. - Re-signs the rebased commits with the bot signing key (same
CLDMV_BOT_*GPG secrets the other bot commits use), so the PR stays Verified, then pushes with--force-with-lease. - Replies on the PR with the result: the new head sha and commit count, "already up to date", or the conflicting files when the rebase cannot complete. On conflict nothing is pushed and the branch is left untouched.
- Reacts to the triggering comment (eyes while running, then thumbs up or confusion) so the state is visible without opening the run.
Guard rails
- Never touches
next,hotfixes,masterormain, and never runs for the persistent release PRs. - Skips fork PRs (the token cannot push to them) and says so.
- Refuses when the head branch moved between checkout and push (the lease fails) and reports it instead of retrying blindly.
- One run per PR at a time (concurrency group keyed on the PR number).
- The command text is parsed strictly (
@cldmv-bot <word> [args]); unknown commands get a short help reply listing the supported ones.
Design notes
- Implemented as a reusable
workflow_callworkflow (for exampleworkflow-bot-commands.yml@v4) plus a thin caller template underexamples/individual-repo-workflows/automation/, added to the standard v4 workflow set and therelease-merge.ymlworkflow list handling as needed. - Dispatch through a small command table so further commands slot in without new workflows. Candidates once the mechanism exists:
update-branch(merge base into head),retarget(change the PR base),rerun(re-run failed checks),docs-check(report whether the release changelog is current). - The comment body is untrusted input. Use it only for matching a fixed command word, never interpolate it into shell.
Acceptance
@cldmv-bot rebaseon a normalfix/*PR whose base moved results in a rebased, signed, force-with-lease-pushed branch and a result comment.- The post-release case (branch cut from the old
next) ends with only the branch's own commits ingit rev-list --count origin/next..<branch>. - A conflicting rebase pushes nothing and lists the conflicts.
- A commenter without write access cannot trigger it.
- Documented in
docs/conventions/with the command list.
Metadata
Metadata
Assignees
Labels
priority: mediumShould be addressed in the normal course of developmentstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: feature requestA request to add new functionality that does not currently exist
Activity
feat(bot): add @cldmv-bot comment commands, starting with rebase
cldmv-bot commentedon Oct 12, 2026
Marked
status: implemented— resolved by #375, merged intonext. This issue closes automatically when that work ships to the default branch.cldmv-bot commentedon Oct 12, 2026
Closed in v4.33.0 — resolved by #375.