1 # Bug Report Triage
2
3 Full flow for triaging bug reports. Follow all steps in order.
4
5 ## Step 1 — Check for Sufficient Details
6
7 A valid bug report needs:
8 - Clear description of what's wrong
9 - Steps to reproduce (or enough context to infer them)
10 - Expected vs actual behavior
11 - Medusa version (or at minimum, the package/feature affected)
12
13 If the report is missing critical details:
14 1. Add comment asking for the missing information (see template below)
15 2. Add label: `requires-more`
16 3. **Stop** — do not proceed to further steps until details are provided
17
18 **Comment template — missing details:**
19 ```
20 Thank you for the report! To help us investigate, could you please provide:
21
22 - [ ] Steps to reproduce the issue
23 - [ ] Expected behavior
24 - [ ] Actual behavior / error message (include full stack trace if available)
25 - [ ] Medusa version (`@medusajs/medusa` version and any relevant package versions)
26 - [ ] Node.js version
27 - [ ] Any relevant configuration or custom code
28
29 Once we have this information, we'll look into it further.
30 ```
31
32 ---
33
34 ## Step 2 — Check Documentation for Intentional Behavior
35
36 > **CRITICAL:** Before treating anything as a bug, check the official Medusa documentation to determine if the reported behavior is **intentional and documented**. Do this actively — search the docs and the codebase for explanations of the feature.
37
38 Read the relevant documentation section (e.g. `www/apps/book/app/learn/fundamentals/`) for the feature mentioned in the issue. Ask: "Is the behavior the user is reporting described as by design anywhere in the docs?"
39
40 **If the behavior is explicitly documented as by design:**
41 1. Add a comment explaining the behavior is intentional, referencing the relevant documentation section
42 2. Close the issue
43 3. **Stop** — this is not a bug
44
45 **Comment template — documented intentional behavior:**
46 ```
47 Thank you for the report! After investigating, the behavior you're describing is actually intentional and documented.
48
49 [Explain the behavior and why it works this way]
50
51 You can find more details in our [documentation](link-to-relevant-docs-section).
52
53 If you'd like a different behavior, we'd suggest [workaround or alternative approach if applicable].
54
55 I'm going to close this issue, but feel free to reopen if your situation differs from what I've described.
56 ```
57
58 Then: `bash scripts/close_issue.sh <issue_number>`
59
60 ---
61
62 **If the behavior is undocumented or the docs are unclear/misleading** (but it still turns out to be by design after codebase review), treat it as a documentation gap — see Step 3 below.
63
64 ---
65
66 **If the behavior is NOT described in the docs at all**, continue to Step 2.5.
67
68 ---
69
70 ## Step 2.5 — Check for User Error
71
72 After verifying it's not documented intentional behavior, assess whether the issue may be caused by the user:
73
74 - Incorrect usage not matching the [Medusa docs](https://docs.medusajs.com)
75 - Custom code that diverges from documented patterns
76 - Misconfiguration or missing setup steps
77 - Using deprecated APIs or patterns from older versions
78
79 If you identify a likely user error:
80 1. Add a comment explaining what the user may be doing incorrectly, with a reference to the relevant docs or correct pattern
81 2. Do **not** close the issue — the user may confirm it's something different
82 3. Continue to Step 3 to still validate whether a real bug exists
83
84 **Comment template — possible user error:**
85 ```
86 Looking at your report, this might be related to how [X] is being used rather than a bug in Medusa itself.
87
88 [Specific explanation of what looks incorrect]
89
90 According to the [documentation](link), the correct approach is:
91
92 [Code example or explanation]
93
94 Could you check if this resolves your issue? If the problem persists after trying this, please let us know and we'll continue investigating.
95 ```
96
97 ---
98
99 ## Step 3 — Validate the Bug in the Codebase
100
101 Search the Medusa codebase to confirm whether the reported behavior is actually a bug.
102
103 **How to investigate:**
104 - Search for the relevant module, service, or API route code
105 - Trace the code path described in the issue
106 - Look for missing validations, incorrect logic, or edge cases not handled
107 - Check recent commits/PRs that may have introduced a regression
108
109 **Outcomes:**
110
111 ### Bug NOT confirmed — documentation gap
112
113 If the code behaves correctly but the documentation is missing, unclear, or misleading in a way that caused the user to believe it was a bug:
114
115 1. Add a comment explaining that the code is working as intended and that the confusion stems from a documentation gap
116 2. Add label: `type: docs`
117 3. Load `reference/docs.md` and continue the docs triage flow for the gap identified
118 4. **Do NOT close the issue** — it remains open as a documentation task
119
120 **Comment template — documentation gap:**
121 ```
122 After investigating this, the code is actually working as intended — the behavior you're seeing is expected.
123
124 However, I agree this isn't well documented, and it's understandable why it looked like a bug. We'll track this as a documentation improvement to make [X] clearer.
125
126 [Optional: briefly explain the correct behavior or link to any existing docs that partially cover it]
127 ```
128
129 ```bash
130 bash scripts/labels.sh <issue_number> add "type: docs"
131 ```
132
133 ### Bug NOT confirmed — expected behavior
134
135 Add a comment explaining why the behavior is expected or what was found, then close the issue.
136
137 **Comment template — not a valid bug:**
138 ```
139 After investigating this, I believe this is the expected behavior because [explanation].
140
141 [Optional: reference to relevant code or docs]
142
143 I'm going to close this issue, but please feel free to reopen it if your situation is different from what I've described, or if you have additional information that suggests otherwise.
144 ```
145
146 Then: `bash scripts/close_issue.sh <issue_number>`
147
148 ### Bug confirmed — continue to Step 4
149
150 ---
151
152 ## Step 4 — Assess Priority
153
154 Assign a priority based on impact:
155
156 | Priority | Criteria |
157 |----------|----------|
158 | `critical` | Data loss, security vulnerability, complete feature unusable for all users, production blocker |
159 | `high` | Major feature broken with no workaround, affects many users |
160 | `medium` | Feature partially broken, workaround exists, or affects a subset of users |
161 | `low` | Minor issue, edge case, cosmetic problem, or easy workaround |
162
163 ---
164
165 ## Step 5 — Add Comment and Labels
166
167 Post a validation comment summarizing the finding, then apply labels.
168
169 **Comment template — bug confirmed (no community label):**
170 ```
171 I was able to reproduce/confirm this issue. [Brief explanation of what's happening and why.]
172
173 [Optional: point to the relevant code location if found]
174
175 We'll track this for a fix. Thank you for the detailed report!
176 ```
177
178 **Comment template — bug confirmed, PR already linked:**
179
180 > Use this when Step 0.5 detected a linked open PR. Do NOT add `good first issue` or `help-wanted`.
181
182 ```
183 I was able to confirm this issue. [Brief explanation of what's happening and why.]
184
185 [Optional: point to the relevant code location if found]
186
187 It looks like #[pr_number] is already addressing this — we'll track progress there. Thank you for the report!
188 ```
189
190 **Comment template — bug confirmed with `good first issue`:**
191 ```
192 I was able to reproduce/confirm this issue. [Brief explanation of what's happening and why.]
193
194 [Optional: point to the relevant code location if found]
195
196 This looks like a good opportunity for a community contribution — the fix should be relatively straightforward. We'd welcome a PR if you or anyone else would like to take a stab at it! Check out our [contribution guidelines](https://github.com/medusajs/medusa/blob/develop/CONTRIBUTING.md) to get started.
197 ```
198
199 **Comment template — bug confirmed with `help-wanted`:**
200 ```
201 I was able to reproduce/confirm this issue. [Brief explanation of what's happening and why.]
202
203 [Optional: point to the relevant code location if found]
204
205 The fix may be a bit involved, but we'd welcome community contributions on this one if anyone wants to dig in! Check out our [contribution guidelines](https://github.com/medusajs/medusa/blob/develop/CONTRIBUTING.md) to get started.
206 ```
207
208 **Label assignment:**
209
210 | Condition | Labels to add |
211 |-----------|---------------|
212 | Bug confirmed (always) | `type: bug` |
213 | Priority is `critical` or `high` | `requires-team` |
214 | Claude couldn't clearly identify root cause despite sufficient details | `requires-team` |
215 | Issue is WWW-related (plugin not featured, etc.) | `requires-team` |
216 | Bug confirmed, fix appears straightforward, **no linked PR** | `good first issue` |
217 | Bug confirmed, fix appears complex, **no linked PR** | `help-wanted` |
218 | Bug confirmed, **open PR already linked** | Do NOT add `good first issue` or `help-wanted` |
219 | Report lacks details (from Step 1) | `requires-more` |
220
221 ```bash
222 bash scripts/labels.sh <issue_number> add <label>
223 ```
224
225 > **Note:** `good first issue` and `help-wanted` are mutually exclusive. Only add one based on estimated fix complexity. Always add `type: bug` when the bug is confirmed.