Skip to content

Commit ba610d7

Browse files
add linked issues guide
1 parent d64d6d9 commit ba610d7

File tree

2 files changed

+175
-0
lines changed

2 files changed

+175
-0
lines changed

docs/guides/linked-issues.md

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: Linked Issues
3+
sidebar_label: Linked Issues
4+
description: Learn how to effectively use linked issues with CodeRabbit for better pull request assessments
5+
sidebar_position: 4
6+
---
7+
8+
# Linked Issues
9+
10+
CodeRabbit provides intelligent assessment of linked issues to validate whether pull requests properly address their requirements. This guide explains how to effectively use linked issues and write clear issue descriptions for optimal results.
11+
12+
## Understanding Linked Issues
13+
14+
A linked issue is one that is explicitly referenced in your pull request description using platform-specific syntax:
15+
16+
- GitHub: `fixes #123`, `closes #123`, `resolves #123`
17+
- GitLab: `closes #123`, `fixes #123`, or full URLs
18+
- Jira/Linear: Full URLs to tickets
19+
20+
When CodeRabbit detects linked issues, it analyzes them against your pull request changes to determine if the requirements are met:
21+
22+
![Linked Issue Assessment Example](/img/guides/linked-issue.png)
23+
24+
## Best Practices for Issue Writing
25+
26+
### Issue Titles
27+
28+
Create descriptive, technical titles that clearly state the goal:
29+
30+
✅ Good Examples:
31+
32+
- "Add PrismaLint integration to configuration flow"
33+
- "Fix race condition in user authentication"
34+
- "Implement caching for GraphQL queries"
35+
36+
❌ Poor Examples:
37+
38+
- "Fix bug"
39+
- "Update code"
40+
- "Improve performance"
41+
42+
### Issue Descriptions
43+
44+
Write comprehensive descriptions that provide clear technical context:
45+
46+
1. **Problem Statement**
47+
48+
- Clearly describe what needs to be changed
49+
- Include technical details about affected components
50+
- Reference specific files or functions if known
51+
52+
2. **Expected Solution**
53+
- Outline the desired implementation approach
54+
- Include code examples or pseudo-code when relevant
55+
- List specific acceptance criteria
56+
57+
Example Description:
58+
59+
```markdown
60+
Problem:
61+
The configuration system doesn't validate Prisma schema files before deployment,
62+
leading to potential runtime errors.
63+
64+
Solution:
65+
Integrate PrismaLint into the configuration flow to:
66+
67+
- Validate schema files during PR checks
68+
- Enforce consistent naming conventions
69+
- Prevent common Prisma anti-patterns
70+
71+
Affected Components:
72+
73+
- Configuration validation pipeline
74+
- CI/CD workflow
75+
- Schema validation logic
76+
77+
Acceptance Criteria:
78+
79+
- [ ] PrismaLint runs on all PR checks
80+
- [ ] Failed validations block merging
81+
- [ ] Clear error messages for schema issues
82+
```
83+
84+
### Consistent Terminology
85+
86+
Use consistent terminology between issues and pull requests:
87+
88+
✅ Good:
89+
90+
- Use the same technical terms consistently
91+
- Reference components with their exact names
92+
- Maintain consistent naming patterns
93+
94+
❌ Poor:
95+
96+
- Mixing different terms for the same component
97+
- Using vague or non-technical language
98+
- Inconsistent capitalization or formatting
99+
100+
## Linking Issues Effectively
101+
102+
### In Pull Requests
103+
104+
1. **Direct References**
105+
106+
```markdown
107+
Fixes #123
108+
Resolves organization/repo#456
109+
Closes https://github.com/org/repo/issues/789
110+
```
111+
112+
2. **Multiple Issues**
113+
114+
```markdown
115+
This PR addresses:
116+
117+
- Fixes #123
118+
- Closes #456
119+
- Resolves https://jira.company.com/browse/PROJ-789
120+
```
121+
122+
### Cross-References
123+
124+
For better traceability:
125+
126+
1. Add PR references in issue comments
127+
2. Use complete URLs when linking external systems
128+
3. Maintain bidirectional links between related issues
129+
130+
## How CodeRabbit Assesses Linked Issues
131+
132+
CodeRabbit evaluates linked issues by:
133+
134+
1. Analyzing issue titles and descriptions
135+
2. Comparing changes in the pull request
136+
3. Validating if requirements are met
137+
4. Providing an assessment with:
138+
- ✅ Addressed
139+
- ❌ Not addressed
140+
- Explanation of the assessment
141+
142+
:::note
143+
Only the issue title and description are considered in the assessment. Comments and discussion threads are not currently analyzed.
144+
:::
145+
146+
## Tips for Better Assessments
147+
148+
1. **Be Specific**
149+
150+
- Include clear, measurable objectives
151+
- List specific technical requirements
152+
- Reference affected code components
153+
154+
2. **Provide Context**
155+
156+
- Explain why changes are needed
157+
- Document current behavior
158+
- Describe expected outcomes
159+
160+
3. **Use Technical Details**
161+
162+
- Include file paths when known
163+
- Reference specific functions or classes
164+
- Mention relevant technologies
165+
166+
4. **Keep It Focused**
167+
- One main objective per issue
168+
- Clear scope boundaries
169+
- Specific acceptance criteria
170+
171+
## Related Resources
172+
173+
- [Review Instructions](./review-instructions.md)
174+
- [Issue Chat](./issue-chat.md)
175+
- [Issue Creation](./issue-creation.md)

static/img/guides/linked-issue.png

14.8 KB
Loading

0 commit comments

Comments
 (0)