ci(#11292): add AndraBot to static check external contributor PRs#11293
Open
dianabarsan wants to merge 4 commits into
Open
ci(#11292): add AndraBot to static check external contributor PRs#11293dianabarsan wants to merge 4 commits into
dianabarsan wants to merge 4 commits into
Conversation
Signed-off-by: Diana Barsan <barsan@medic.org>
Signed-off-by: Diana Barsan <barsan@medic.org>
…timize linked issue logic Signed-off-by: Diana Barsan <barsan@medic.org>
Member
Author
…changes instead of editing Signed-off-by: Diana Barsan <barsan@medic.org>
Member
Author
Member
Author
Member
Author
Member
Author
Member
Author
Member
Author
|
@andrablaj mind giving the general functionality a look? |
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.






Description
Adds AndraBot, a GitHub Action that checks pull requests opened by external contributors and guides them through our contribution requirements before review.
On
opened/edited/synchronize/reopened, for PRs whose author is not an OWNER / MEMBER / COLLABORATOR (bots are also skipped), it checks that:.github/PULL_REQUEST_TEMPLATE.mdat run time, so template changes work without touching the script. Sections that are empty in the template (e.g.Description) must be filled in; pre-filled sections must be present.closingIssuesReferences).When any check fails, the bot posts a single comment listing everything that needs fixing, labels the PR
Waiting for contributorand fails the check. Once everything passes, the comment is replaced with a success message and the label is swapped forReady for review. Compliant PRs never get a comment — just theReady for reviewlabel — so reviewers can filter external PRs that have cleared the gate.The bot maintains a single comment: when its content changes it is deleted and re-posted (comment edits do not notify the author, new comments do), and when a re-run produces identical content the comment is left untouched, so authors get exactly one notification per state change.
All comment texts live as markdown files in
scripts/ci/andra-bot-messages/with{{placeholder}}substitution, so wording can be edited without code changes (see the README there).Implementation notes
pull_request_targetbecause fork PRs only get a read-only token underpull_request, so the bot couldn't comment. It never checks out or executes PR code — checkout targets the base branch (sparse:scripts/ciand.githubonly) and all checks operate on API data. A documented zizmordangerous-triggerssuppression covers this (ignore entries must be workflow basenames — the pre-existing path-style entries in.github/zizmor.ymlmay be silently inert, worth a separate look).contents: read,issues: read,pull-requests: write. Everything the bot does works with the defaultGITHUB_TOKEN— no PAT or app required. (Draft conversion was considered and dropped: the draft-state mutations are not available to app installation tokens, so labels are used instead.)Waiting for contributorandReady for reviewlabels must exist in the repo; a missing label degrades to a workflow warning, never a crash.github-actions[bot]; the AndraBot name appears as the check name. (A GitHub App would be needed for a real bot identity.)webapp/tests/mocha/unit/testing-tests/andra-bot.spec.js(29 cases) cover all checks, the comment lifecycle and the label swaps, asserting against the real PR template and rendered message files so future edits to either don't break tests spuriously.AI disclosure
Heavily used Claude for development.
closes #11292
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.