Add "lessons/patterns/use-fixes-n-keyword-for-automatic-issue-closing-in-prs"

2026-01-29 01:47:24 +00:00
parent 33475e7b59
commit c2b5997ed2

@@ -0,0 +1,40 @@
## Context
- Created PR #292 with "Partial fix for #290" in the body
- Expected Gitea to link the PR to the issue
- Issue remained open after PR was merged
## Problem
Gitea only auto-closes issues when specific keywords are used:
- `Fixes #N`
- `Closes #N`
- `Resolves #N`
Using "Partial fix for #290" does NOT trigger auto-close because "Partial" is not a recognized keyword.
## Solution
For PRs that fully address an issue:
- Use `Fixes #N` in the PR body or commit message
For PRs that partially address an issue:
- Use `Fixes #N` if you want auto-close anyway
- OR manually close the issue after merge
- Consider creating separate issues for remaining work
## Prevention
When creating PRs:
1. Always use `Fixes #N` format for issue linking
2. If partial fix, decide upfront: auto-close or keep open
3. Add remaining work items to issue comment before closing
4. Or create follow-up issues for remaining criteria
## Related
- Issue: #290
- PR: #292
---
**Tags:** gitea, pr, issue-linking, workflow, auto-close