Repository navigation
Make the maintenance tooling ready for agents - #83
Merged
Merged
Conversation
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>
|
Caution Review failedThe pull request is closed. Finishing Touches
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. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_TOKENandGITHUB_TOKENare 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 doctorchecks 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-listand themilestones-*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.ymlnow loads the commands through a small autoloader, so anywpexecutable can run them from this folder. Release work then needs WP-CLI, git andgh, not 50 clones and a WordPress install.Work in progress is left alone.
composer installandcomposer updateused 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 --deletecrashed 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 generateskipped every remaining milestone of a repository once one milestone was skipped.release close-released --allonly covered the bundle.wp-cli/mustangostang-spyc, whose repository iswp-cli/spyc.contrib-list <repo>andrelease-notes <repo>without a milestone did not work as documented.milestones-afterdepended on the order the API happened to return milestones in.foreach-bundlelost argument quoting.fetch-orgscript is removed;.maintenance/clone-all-repositories.shreplaced 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.