[PR #7986] [MERGED] feat(review): push Dottore repairs to fork branches that allow maintainer edits #8040

Closed
opened 2026-10-24 04:09:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7986
Author: @Promansis
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature(review)/7985-dottore-fork-repairs


📝 Commits (3)

  • f48ceb2 feat(review): push Dottore repairs to fork branches that allow maintainer edits
  • 8f987ef fix(review): name GitHub's maintainer-edits checkbox and comment with GITHUB_TOKEN
  • b2783a0 fix(review): report a Dottore repair push that fails before git answers

📊 Changes

3 files changed (+41 additions, -12 deletions)

View changed files

📝 .github/dottore-review/README.md (+6 -4)
📝 .github/dottore-review/dottore_review.py (+15 -5)
📝 .github/workflows/dottore-review.yml (+20 -3)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7985

Why this change

  • Dottore's autofix (the "Let Dottore fix the open findings" box, or /dottore autofix) refused every pull request whose branch lives on a fork, saying "Dottore can only push repairs to this repository's own branches". Most pull requests here come from forks, members' included, so the repair never ran where people asked for it. #7971 got that refusal three times on 2026-10-21 with the box ticked.
  • GitHub lets anyone with push access to this repository push to a fork's pull request branch when the author allowed edits by maintainers. Dottore's App pushes with a token for this repository, so the refusal only needs to cover forks that did not allow it.

What changed

  • On a pull request from a fork that allows edits by maintainers, ticking the autofix box (or /dottore autofix) now runs the repair, and Dottore pushes its commit to the fork's branch, as it already did for branches in this repository. Not yet proven live, see Manual verification notes.
  • A fork pull request that does not allow maintainer edits still gets a refusal. It now names the fork and says the author can tick Allow edits and access to secrets by maintainers (GitHub's label on a fork with workflows; forks owned by an organisation cannot), or use the repair prompt at the end of the review. A pull request whose fork was deleted gets its own one-line refusal.
  • When Dottore's repair push is rejected or the branch moved meanwhile, its explanatory comment now actually posts. The push step commented with the App token, which is minted with contents permission only. It now comments with GITHUB_TOKEN, like the step before it, and still pushes with the App token.
  • When the repair push job fails any other way (a fork or branch gone before the checkout, a failed commit), Dottore now says on the pull request that the repair could not be pushed, with the run link, instead of ending as a red job with no comment.
  • How: dottore_review.py autofix_prompt() reads maintainerCanModify and the head repository and records owner/name in meta.json. dottore-review.yml exports it as the review job's head_repo output, and the repair push job checks out that repository at the head branch with the App token, so origin is the fork for a fork pull request. The moved-branch check, commit message and rejected-push report are otherwise unchanged.
  • .github/dottore-review/README.md (Autofix) describes the rule.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run checks, recorded here rather than ticked:

  • pnpm check at b2783a02f: exit 0 (one existing client lint warning). It does not cover .github/.
  • python3 -m py_compile .github/dottore-review/dottore_review.py: ok. actionlint 1.7.7 on dottore-review.yml reports only the six job.workflow_sha/job.workflow_repository warnings that staging already has (actionlint does not know those properties yet).
  • Temporary probe outside the repo (deleted; the repo has no harness for dottore_review.py) calling autofix_prompt() with stubbed gh. Fork with maintainer edits: autofix=true, meta.head_repo=Promansis/Marinara-Engine. Fork without: refusal naming the fork, no repair request. Same-repository PR: head_repo=Pasta-Devs/Marinara-Engine. Deleted fork: refusal, no crash. On staging's code the first three cases fail.
  • Live, this branch's workflow via workflow_dispatch:
    • #7971 (fork, maintainer edits on at the time, findings already resolved): run https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39634068760 got past the fork check and answered "There are no open Dottore findings to repair." instead of the fork refusal.
    • This PR (fork, maintainer edits on, one open Dottore thread): run https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39637633101. The decision step requested the repair, the fix job checked out the fork head 8f987efc1 from this repository and ran the repair, and the push job reported "changed nothing", because the only finding was in a workflow file, which the repair may not edit. The App-token checkout of the fork and the push to it were not reached.
  • Local read-only review: no defects. It pointed out the contents-only App token on the push step's comments (fixed in 8f987efc1) and GitHub's current checkbox label (fixed).
  • Dottore's reviews: the token-scope claim (a repo-scoped token gets a 404 on the fork) was answered and resolved. A repo-scoped installation token can read public repositories; see Agents run https://github.com/Pasta-Devs/Marinara-Agents/actions/runs/39633889292. The "no word on the pull request when the push job fails" point was valid and is fixed in b2783a02f. The new step was checked by simulating its marker logic under bash -e, not live.

Manual verification notes

  • Still unproven: whether GitHub accepts the Dottore App token's push to a user fork's branch under maintainer edits. GitHub documents this permission for people with push access and says nothing about Apps. One-step check after merge: on a fork pull request that allows maintainer edits and has an open Dottore finding outside .github/workflows/, tick the autofix box (or comment /dottore autofix). Then confirm a Dottore-Autofix commit lands on the fork branch. If the push is rejected, Dottore posts git's error on that pull request, and this change should be reverted.
  • Manually verify: on a fork pull request without maintainer edits, ticking the box gets the new refusal naming the fork.
  • Manually verify: on a same-repository pull request, autofix still pushes to the branch here.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Only .github/dottore-review/README.md changes; it is not under docs/, so no translation is affected. Marinara-Agents picks this up when its dottore-review.yml pin moves to a merge commit containing it.

UI evidence (if applicable)

Not applicable (CI tooling only).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Autofix repairs can now target pull-request branches hosted in forks when maintainer edits and required access are enabled.
    • Repair workflows now preserve the correct branch and repository context when applying fixes.
  • Bug Fixes

    • Added clearer guidance when fork permissions prevent automatic repairs or when a fork is unavailable.
    • Pull requests now receive comments when repair application or push operations fail, reducing duplicate reporting.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7986 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature(review)/7985-dottore-fork-repairs` --- ### 📝 Commits (3) - [`f48ceb2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f48ceb2b9486d6722034383acbf5667b3f26e694) feat(review): push Dottore repairs to fork branches that allow maintainer edits - [`8f987ef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f987efc1d0d239e8412ceb6c6528428c78e20d1) fix(review): name GitHub's maintainer-edits checkbox and comment with GITHUB_TOKEN - [`b2783a0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b2783a02fc90a0993317cee309c4332182929ef5) fix(review): report a Dottore repair push that fails before git answers ### 📊 Changes **3 files changed** (+41 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `.github/dottore-review/README.md` (+6 -4) 📝 `.github/dottore-review/dottore_review.py` (+15 -5) 📝 `.github/workflows/dottore-review.yml` (+20 -3) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7985 ## Why this change - Dottore's autofix (the "Let Dottore fix the open findings" box, or `/dottore autofix`) refused every pull request whose branch lives on a fork, saying "Dottore can only push repairs to this repository's own branches". Most pull requests here come from forks, members' included, so the repair never ran where people asked for it. #7971 got that refusal three times on 2026-10-21 with the box ticked. - GitHub lets anyone with push access to this repository push to a fork's pull request branch when the author allowed edits by maintainers. Dottore's App pushes with a token for this repository, so the refusal only needs to cover forks that did not allow it. ## What changed - On a pull request from a fork that allows edits by maintainers, ticking the autofix box (or `/dottore autofix`) now runs the repair, and Dottore pushes its commit to the fork's branch, as it already did for branches in this repository. **Not yet proven live, see Manual verification notes.** - A fork pull request that does not allow maintainer edits still gets a refusal. It now names the fork and says the author can tick **Allow edits and access to secrets by maintainers** (GitHub's label on a fork with workflows; forks owned by an organisation cannot), or use the repair prompt at the end of the review. A pull request whose fork was deleted gets its own one-line refusal. - When Dottore's repair push is rejected or the branch moved meanwhile, its explanatory comment now actually posts. The push step commented with the App token, which is minted with contents permission only. It now comments with `GITHUB_TOKEN`, like the step before it, and still pushes with the App token. - When the repair push job fails any other way (a fork or branch gone before the checkout, a failed commit), Dottore now says on the pull request that the repair could not be pushed, with the run link, instead of ending as a red job with no comment. - How: `dottore_review.py` `autofix_prompt()` reads `maintainerCanModify` and the head repository and records `owner/name` in `meta.json`. `dottore-review.yml` exports it as the review job's `head_repo` output, and the repair push job checks out that repository at the head branch with the App token, so `origin` is the fork for a fork pull request. The moved-branch check, commit message and rejected-push report are otherwise unchanged. - `.github/dottore-review/README.md` (Autofix) describes the rule. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run checks, recorded here rather than ticked: - `pnpm check` at `b2783a02f`: exit 0 (one existing client lint warning). It does not cover `.github/`. - `python3 -m py_compile .github/dottore-review/dottore_review.py`: ok. actionlint 1.7.7 on `dottore-review.yml` reports only the six `job.workflow_sha`/`job.workflow_repository` warnings that staging already has (actionlint does not know those properties yet). - Temporary probe outside the repo (deleted; the repo has no harness for `dottore_review.py`) calling `autofix_prompt()` with stubbed `gh`. Fork with maintainer edits: `autofix=true`, `meta.head_repo=Promansis/Marinara-Engine`. Fork without: refusal naming the fork, no repair request. Same-repository PR: `head_repo=Pasta-Devs/Marinara-Engine`. Deleted fork: refusal, no crash. On staging's code the first three cases fail. - Live, this branch's workflow via `workflow_dispatch`: - #7971 (fork, maintainer edits on at the time, findings already resolved): run https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39634068760 got past the fork check and answered "There are no open Dottore findings to repair." instead of the fork refusal. - This PR (fork, maintainer edits on, one open Dottore thread): run https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39637633101. The decision step requested the repair, the `fix` job checked out the fork head `8f987efc1` from this repository and ran the repair, and the push job reported "changed nothing", because the only finding was in a workflow file, which the repair may not edit. **The App-token checkout of the fork and the push to it were not reached.** - Local read-only review: no defects. It pointed out the contents-only App token on the push step's comments (fixed in `8f987efc1`) and GitHub's current checkbox label (fixed). - Dottore's reviews: the token-scope claim (a repo-scoped token gets a 404 on the fork) was answered and resolved. A repo-scoped installation token can read public repositories; see Agents run https://github.com/Pasta-Devs/Marinara-Agents/actions/runs/39633889292. The "no word on the pull request when the push job fails" point was valid and is fixed in `b2783a02f`. The new step was checked by simulating its marker logic under `bash -e`, not live. ### Manual verification notes - **Still unproven: whether GitHub accepts the Dottore App token's push to a user fork's branch under maintainer edits.** GitHub documents this permission for people with push access and says nothing about Apps. One-step check after merge: on a fork pull request that allows maintainer edits and has an open Dottore finding outside `.github/workflows/`, tick the autofix box (or comment `/dottore autofix`). Then confirm a `Dottore-Autofix` commit lands on the fork branch. If the push is rejected, Dottore posts git's error on that pull request, and this change should be reverted. - Manually verify: on a fork pull request without maintainer edits, ticking the box gets the new refusal naming the fork. - Manually verify: on a same-repository pull request, autofix still pushes to the branch here. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Only `.github/dottore-review/README.md` changes; it is not under `docs/`, so no translation is affected. Marinara-Agents picks this up when its `dottore-review.yml` pin moves to a merge commit containing it. ## UI evidence (if applicable) Not applicable (CI tooling only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **New Features** - Autofix repairs can now target pull-request branches hosted in forks when maintainer edits and required access are enabled. - Repair workflows now preserve the correct branch and repository context when applying fixes. - **Bug Fixes** - Added clearer guidance when fork permissions prevent automatic repairs or when a fork is unavailable. - Pull requests now receive comments when repair application or push operations fail, reducing duplicate reporting. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8040
No description provided.