You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* adding docs on score card reports
* add note on empty reports when using this without reading
* fix lang
* adding result and prompt examples for report
* fix bot link
* idiot proof it
Copy file name to clipboardExpand all lines: docs/guides/custom-reports.md
+160Lines changed: 160 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,166 @@ Issues and tickets brings in conversations, descriptions, and comments from Jira
295
295
-`<issue_description>`: markdown - The description of the issue.
296
296
-`<issue_comments>`: array of comment objects - Contains all the comments made on the issue.
297
297
298
+
#### Remove PRs without a "Score Card/Chart" bot comment
299
+
300
+
This option gives you the ability to create a report limited only to pull requests containing a "Score Card" or "Score Chart" bot comment from CodeRabbit or other bots. To enable issues and tickets you must include the tag `<pr_score_card>` in your prompt.
301
+
302
+
> **IMPORTANT:** This will automatically remove any pull requests from your reports if they do not contain a "Score Card" or "Score Chart" bot comment. Using this option without setting up a flow to create these comments will result in `No new pull request activity in the last XYZ hours` errors. Do not enable this option unless you have created a "Score Card" or "Score Chart" bot comment flow.
303
+
304
+
For example you can ask coderabbit to check serveral conditions on a pull request and produce a "Score Chart":
305
+
306
+
<details>
307
+
<summary>Click to view example User Score Card/Chart Comment:</summary>
Use the <overall_instructions> to guide the content of the summary. Use the format shown in <\_example> but do not include or refer to the example's content in the final summary/report.
314
+
315
+
<overall_instructions>
316
+
317
+
**Instructions:**
318
+
Generate a weekly code review report for the author of this pull request only following scoring parameters. Calculate the scores and compile the results into a table so that the team-wise average score can be easily determined.
319
+
**Scoring Parameters:**
320
+
321
+
1. **Basic Code Standards (Score out of 2)**
322
+
323
+
- Avoidance of hard-coded values
324
+
- No repetition of code (DRY principle)
325
+
326
+
2. **Code Readability (Score out of 2)**
327
+
328
+
- Presence of meaningful comments
329
+
- Proper variable declaration using `const` and `let`
- Proper loading state implementation (e.g., button click loading states)
335
+
- Handling edge cases (e.g., checking for undefined or missing values)
336
+
- Input validation (ensuring correct user inputs)
337
+
338
+
4. **Circle CI Check Validation (Score: 0 or 1)**
339
+
- `0` → Not Passed
340
+
- `1` → Passed
341
+
342
+
**Final Score Calculation:**
343
+
Combine the scores from the parameters above to derive the final code quality score (out of 5).
344
+
**Output Format:**
345
+
Provide the final report in a table format with the following columns (use shorthand notations), be sure to include this list at the top above the chart in the "Column Notation" section so users understand what the columns mean:
346
+
347
+
- **User Name (User)**
348
+
- **Basic Code Standards (BCS) (out of 2)**
349
+
- **Code Readability (CR) (out of 2)**
350
+
- **Error Handling (EH) (out of 4)**
351
+
- **Shopify Theme Check (CI) (out of 1)**
352
+
- **Final Code Quality Score (FCQS) (out of 9)**
353
+
354
+
</overall_instructions>
355
+
356
+
<\_example>
357
+
358
+
## Column Notation
359
+
360
+
- **User Name (User)**
361
+
- **Basic Code Standards (BCS) (out of 2)**
362
+
- **Code Readability (CR) (out of 2)**
363
+
- **Error Handling (EH) (out of 4)**
364
+
- **Shopify Theme Check (CI) (out of 1)**
365
+
- **Final Code Quality Score (FCQS) (out of 9)**
366
+
367
+
## Score Chart
368
+
369
+
| User | BCS (2) | CR (3) | EH (2) | CI (1) | FCQS (9) |

395
+
396
+
Prompt Example:
397
+
398
+
```markdown
399
+
Use the <overall_instructions> to guide the content of the summary. Use the format shown in <example> but do not include or refer to the example's content in the final summary/report.
400
+
401
+
<overall_instructions>
402
+
**Instructions:**
403
+
404
+
Locate the score chart comment in the <bot_comments>. There will be a single comment with data on these fields:
405
+
406
+
- **User Name (User)**
407
+
- **Basic Code Standards (BCS) (out of 2)**
408
+
- **Code Readability (CR) (out of 2)**
409
+
- **Error Handling (EH) (out of 4)**
410
+
- **Shopify Theme Check (CI) (out of 1)**
411
+
- **Final Code Quality Score (FCQS) (out of 9)**
412
+
413
+
These details may also be in the form of a chart such as:
414
+
415
+
## Score Chart
416
+
417
+
| User | BCS (2) | CR (3) | EH (2) | CI (1) | FCQS (9) |
You will create a new chart averaging all the values from various pull requests for each author. Only include pull requests with a `Score Chart`. Do not invent or create score charts if none exist.
- The reporting bot only has access to your comments and summary (like a project manager) if you want to make a report looking for these score card/chart comments make sure the reviewer does this ahead of time.
453
+
- Only include checks for very specific scenarios, such as a specific check failing or using tabs vs spaces.
454
+
- Do not use general rules without explaining specifically what they mean. If you add "Insure the pull request follows development best practices" you must define what "development best practices" actually mean or the AI will guess.
455
+
- Make one point for each specific check and make sure its a True/False condition.
456
+
- Instead of manually commenting on pull requests you can use the [Github Actions Bot](https://github.com/marketplace/actions/create-or-update-comment) to automatically comment on pull requests and trigger coderabbit score card/chart comments by including `@coderabbit` in the comment.
0 commit comments