CI / Results on pull requests
Close fixed issues when the fix is live
When a pull request that fixes an issue merges, the issue closes, but your users get the fix only when your deploy job runs. Mark the job that ships, so that each fixed issue closes only when that job succeeds on the default branch.
3 min read
Until then, the issue says "closed", and the bug is still live. With the setting on, the merge marks each fixed issue Staged, and the issue closes when the release job succeeds.
You need:
- Admin access to the repository, for the setting in step 2.
Note
This page is about when the issues close. To link an issue to a pull request, see Link the issues a pull request fixes.
1. Mark the release job
Add release: true to the job that ships the default branch:
import { defineWorkflow, push } from '@tanstack-source/ci'
export default defineWorkflow('deploy', { on: [push({ branches: ['main'] })] })
.job('deploy', {
release: true,
steps: [{ name: 'Deploy', run: './deploy.sh' }],
})
releaseisfalseby default.- Mark only the job that ships. Its success tells the forge that the code of the commit is live.
- Merge this change into the default branch. The forge reads the workflows of the default branch only.
2. Turn on the setting
In a terminal:
src ci settings --close-fixed-issues release
src ci settings now says Close fixed issues: after the release job.
On the web, open the CI settings of the repository. Under Close fixed issues, pick When the release job succeeds.
To close the issues on merge again, run src ci settings --close-fixed-issues merge.
3. Merge a pull request that fixes an issue
When the pull request merges into the default branch, each open issue that it fixes gets Staged:
- The issue stays open. Its timeline says that the pull request merged, and that the issue closes when the release job succeeds.
- The issue list has a Staged tab. The Open tab leaves the staged issues out.
- In a terminal,
src issue list --stagedlists them.
A merge into another branch stages nothing.
4. Let the release job close them
A push run on the default branch ends, and its release job succeeded. The forge then closes each staged issue whose merge commit is in the commit of that run. The timeline of the issue says "closed this with #7".
- If the release job fails, the issues stay staged. The next release job that succeeds closes them.
- One release checks 50 staged merge commits at most. The other issues wait for the next release.
- If a person closes or reopens a staged issue, the issue is no longer staged.
Done
A closed issue now means that the fix is live. Between the merge and the release, the Staged tab shows what waits for the next deploy.
REST and MCP have the same setting: closeFixedIssues in PUT /ci/settings, and the MCP tool set_ci_settings. See CI reference.
When issues close on merge
The forge closes the fixed issues on merge, with no Staged step, when one of these is true:
- The setting is
merge. This is the default. - No workflow of the default branch has a job with
release: true. No job releases the issues, so they close on merge.src ci settingssays so.
A repository synced with GitHub stages nothing and closes nothing itself. GitHub closes the issues on merge. See Issues that a pull request fixes.