Skip to content

Make the maintenance tooling ready for agents - #83

Merged
schlessera merged 2 commits into
mainfrom
agent-ready-maintenance
Oct 30, 2026
Merged

schlessera merged 2 commits into
mainfrom
agent-ready-maintenance

Conversation

@schlessera

@schlessera schlessera commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

First step towards running the WP-CLI maintenance and release chores mainly through agents, with humans as the fallback. The tooling assumed a human at a terminal: someone who had exported a token, could read prose output, would answer prompts, and would notice when something silently went wrong. This PR removes those assumptions without changing what the commands are for. Planning releases, the release plan/apply flow and the human-only signing step for the bundle come in follow-up PRs.

Credentials are picked up automatically. The login of the GitHub CLI is used first, because it is what maintainers already have set up. GH_TOKEN and GITHUB_TOKEN are the fallback. Requests run under the maintainer's own identity on purpose, so there is no separate bot account to manage. Write requests fail before they reach GitHub when there are no credentials, so nothing is left half-done.

wp maintenance doctor checks the setup. An agent can run it before doing anything and know whether it can proceed: which credentials and account are in use, scopes, remaining rate limit, and which tools are missing.

Output that can be parsed. release-notes, contrib-list and the milestones-* commands gain a JSON format, and failed API requests report a stable error code with a hint. The markdown and HTML output stays the same, apart from the fixes below.

No full install needed. wp-cli.yml now loads the commands through a small autoloader, so any wp executable can run them from this folder. Release work then needs WP-CLI, git and gh, not 50 clones and a WordPress install.

Work in progress is left alone. composer install and composer update used to switch every clone to its default branch and pull. Now a clone that has uncommitted changes or is on another branch is only fetched. Agents run these commands routinely, and should never disturb someone's checkout. Git failures are now reported instead of ignored.

Bugs fixed along the way. These came out of an audit, and most would mislead an agent without anyone noticing:

  • replace-label --delete crashed after relabelling. It also only looked at the first 100 open issues, so the delete would have stripped the label from every closed issue.
  • Release notes and contributor lists counted pull requests that were closed without being merged, and credited bots.
  • release generate skipped every remaining milestone of a repository once one milestone was skipped.
  • release close-released --all only covered the bundle.
  • Bundle-wide release notes and contributor lists failed on wp-cli/mustangostang-spyc, whose repository is wp-cli/spyc.
  • contrib-list <repo> and release-notes <repo> without a milestone did not work as documented.
  • milestones-after depended on the order the API happened to return milestones in.
  • foreach-bundle lost argument quoting.
  • The unused fetch-org script is removed; .maintenance/clone-all-repositories.sh replaced it.

The new pure logic has unit tests. The commands were also run against the live API: bundle-wide notes and contributors for 3.0.0, and the credential fallbacks with gh, with a token, and with neither. The README is regenerated by the existing workflow after merge.

schlessera and others added 2 commits October 30, 2026 14:46
Authenticate transparently through the GitHub CLI with a token fallback,
add `wp maintenance doctor`, add JSON output, let the commands run
without a full install, stop the refresh script from switching branches
and fix the bugs found while auditing the commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Map bundled packages to their GitHub repository, keep the milestone order
in release notes, preserve argument quoting in foreach-bundle, and make
the refresh and clone scripts report git and API failures instead of
silently carrying on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 github-actions Bot added bug Something isn't working command:maintenance Related to 'maintenance' command enhancement New feature or request labels Oct 30, 2026
@schlessera
schlessera marked this pull request as ready for review October 30, 2026 16:29
@schlessera
schlessera requested a review from a team as a code owner October 30, 2026 16:29
@schlessera
schlessera merged commit 05db281 into main Oct 30, 2026
19 of 23 checks passed
@schlessera
schlessera deleted the agent-ready-maintenance branch October 30, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working command:maintenance Related to 'maintenance' command enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant