gardener: Add triage, pull request review and mention tasks - #164
Conversation
|
|
Thanks for your interest in Cloudflare Computer. This repository does not accept unsolicited pull requests. Please use one of the accepted contribution paths instead:
If a maintainer asked you to open this pull request, they can add the |
commit: |
| gardener: | ||
| if: >- | ||
| ${{ | ||
| (github.event_name == 'pull_request' && github.event.action == 'opened' && github.event.pull_request.head.repo.full_name == github.repository) |
There was a problem hiding this comment.
🔴 Forked maintainer PRs receive no review
When a maintainer opens a PR from a fork, gardener skips the review because its head repository differs. Eligible maintainer PRs receive no review.
Learn more
The review task accepts pull requests authored by maintainers, but the job guard checks the head repository rather than the author's eligibility. A maintainer can open an approved pull request from their own fork. The workflow then skips the job before Gardener can run. A forked pull_request workflow also has restricted token permissions, so removing the guard alone will not enable submitting the review.
Example: A collaborator opens PR #200 from alice/computer into cloudflare/computer. The task admits the collaborator, but the repositories have different full names, so the review job is skipped.
Recommended fix: Use a fork-compatible event and permission model for the review task, while retaining Gardener's maintainer-author check. Regenerate the workflow and lock file rather than editing generated output alone.
Was this helpful? React with 👍 or 👎 to provide feedback.
| triggers: | ||
| - event: github.issue_comment.created | ||
| mentions: [self] | ||
| - event: github.discussion_comment.created | ||
| mentions: [self] |
There was a problem hiding this comment.
🟡 Inline PR mentions go unanswered
When a maintainer mentions @gardener-cf in an inline review comment, mention-reply never runs. GitHub emits pull_request_review_comment, not either subscribed comment event.
Learn more
GitHub separates general PR conversation comments from inline review comments. General comments produce issue_comment, which this task handles; comments attached to a diff produce pull_request_review_comment, which it does not. This leaves mentions in code review threads unanswered.
Example: A maintainer writes @gardener-cf what does this change do? on a changed line in PR #200. No configured event starts mention-reply, although the same message on the PR's Conversation tab starts it.
Recommended fix: Add a github.pull_request_review_comment.created trigger if Gardener supports it, regenerate the workflow and lock file, and ensure the effect replies to the appropriate review thread.
Was this helpful? React with 👍 or 👎 to provide feedback.
| trigger: | ||
| event: github.issue.opened | ||
| authors: maintainers | ||
| tools: | ||
| - repository.list_files | ||
| - repository.read_file | ||
| - provider.api.read | ||
| effects: | ||
| - issue.comment.create | ||
| - issue.label.add |
There was a problem hiding this comment.
Adds Gardener (internal preview), a repository bot that runs as GitHub Actions workflows and uses Workers AI. It can only take the actions each task declares.
What it does
triagepr-reviewmention-reply@gardener-cf …on an issue, PR or discussion@gardener-cf rebase thishas GitHub rebase the branch ontomain(ormerge main in)Only org members and collaborators can trigger it. It never pushes code, merges or closes anything.
How to use it
@gardener-cfin a comment, e.g. "@gardener-cf where is the exec timeout set?"Each task runs as a
Gardener · …workflow in the Actions tab. A red run means Gardener couldn't finish; nothing in the repo changes, so just let me know.Changing or adding tasks
Tasks live in
.gardener/tasks/<id>/TASK.md: YAML front matter for triggers, tools, allowed effects and limits, plus plain-language instructions. See the task authoring guide.TASK.md. To stop a task, delete its folder or setdraft: true.npm run gardener:generate(Node.js 24+) and commit the task with the regenerated files. If you forget, the pull request's Check tasks check fails and says so.Gardener · Sync tasksworkflow sends the tasks to Gardener when they reachmain, so the change is live straight away.If stale files get merged anyway, the sync run on
maingoes red and the previous tasks keep running until a fixed commit lands.What's in this PR
.gardener/: project config (handlegardener-cf, pinned to a Gardener release), the three tasks, and the generated lock file..github/workflows/gardener-*.yml: one generated workflow per task, plusgardener-sync.yml, which enrols the tasks on each change tomainand checks pull requests that change them. Don't edit these by hand.package.json: agardener:generatescript, pinned to the same Gardener release as the workflows.biome.jsonc: ignores the generated.gardener/gardener.lock.json, likepackage-lock.json.The repository is already connected to the Gardener runtime, so the tasks start working once this merges.