Issues and pull requests / Pull requests
Open a draft and ask for reviews
You want to open a pull request before the work is done, and nobody must merge it yet. When it is ready, you want the right people to review it.
3 min read
You need:
- A branch that you pushed.
- To change the draft state: you are the author of the pull request, or you have write access.
- To ask for reviews: the triage role or more.
1. Open a draft
In your clone, run:
src pr create --draft --title "Count down to zero" --body "Work in progress"
The pull request opens as a draft:
- Nobody can merge it. Its merge box says This pull request is a draft, and the merge button stays off.
- The factory agents skip it. They start when you mark it ready for review.
Tip
Is the change too big for one review? Split it into a stack. Must only your team see it? Work on it in private.
2. Mark it ready for review
- Open the pull request.
- In its merge box, click Ready for review.
In a terminal:
src pr ready 7
Now people with write access can merge it. If a branch rule blocks the merge, only an admin can merge past it. See Merge without the branch rules.
When the factory is on, its agents now start on the pull request, as on a new one. For example, the Impact tab then shows if the pull request changes the architecture or the public API. See Read the Impact tab.
Note
To make the pull request a draft again, click Convert to draft at the bottom of the Status tab of the right column. In a terminal, run src pr ready 7 --undo.
3. Ask for reviews
When you open the pull request, ask with --reviewer:
src pr create --fill --reviewer ana,ben
Or ask later, on the web:
- Open the pull request.
- On the Status tab of the right column, find the Reviewers row of the Details card. Click its pencil. The list of the people of the repository opens.
- Click a person in the list. For a person who is not in the list, type their username, then click Add.
- Click Apply.
To stop asking a person, click the X next to their name, then click Apply.
In a terminal:
src pr edit 7 --add-reviewer ana --remove-reviewer ben
- Nobody can ask the author to review. The author is not in the list, because they cannot review their own change.
- A pull request has at most 25 review requests at a time.
- A request ends when that person submits a review.
Done
Your pull request was a draft while you worked, and its merge button stayed off. Now it is ready for review. Your reviewers find it with src pr status, under Requesting a code review from you.
What the reviewers do next is in Review a pull request.
Later: REST and MCP
An agent or a script does the same work over REST or MCP, with the same rules. The REST paths are under /api/v1/repos/{owner}/{repo}.
| You want to | REST | MCP tool |
|---|---|---|
| Open a draft, with reviewers | POST /pulls, with "draft": true and "reviewers" | create_pull_request |
| Mark a draft ready, or make it a draft again | PUT or DELETE /pulls/{n}/ready | set_pull_draft |
| Ask for reviews, or stop asking | POST /pulls/{n}/reviewers, with { "add", "remove" } | request_reviewers |