102 lines
2.6 KiB
Markdown
102 lines
2.6 KiB
Markdown
|
|
# AI Code Reviewer — Output Comment Format
|
|||
|
|
|
|||
|
|
## 1. Summary Comment
|
|||
|
|
|
|||
|
|
The summary comment is posted by the bot as a **top-level PR comment** after the review is complete.
|
|||
|
|
It provides a high-level assessment of the entire diff.
|
|||
|
|
|
|||
|
|
### Format
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
🔴 Code quality assessment: <Poor | Acceptable | Excellent>
|
|||
|
|
|
|||
|
|
ℹ️ Conclusion: <Short explanation of the most critical finding and its impact>
|
|||
|
|
|
|||
|
|
❌ Merge: No - <reason>
|
|||
|
|
✅ Merge: Yes
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### Example
|
|||
|
|
|
|||
|
|
> 🔴 Code quality assessment: Poor
|
|||
|
|
>
|
|||
|
|
> ℹ️ Conclusion: The commit introduces a critical bug where `Stopwatch.StartNew()` is called twice on consecutive lines (lines 15–16 in `samples/AR/App.cs`). The duplicate assignment statement must be removed.
|
|||
|
|
>
|
|||
|
|
> ❌ Merge: No - blocking issue must be resolved first
|
|||
|
|
|
|||
|
|
### Quality Levels
|
|||
|
|
|
|||
|
|
| Badge | Label | Meaning |
|
|||
|
|
|---|---|---|
|
|||
|
|
| 🔴 | Poor | Blocking issues found, must not merge |
|
|||
|
|
| 🟡 | Acceptable | Minor suggestions only |
|
|||
|
|
| ✅ | Excellent | No issues found |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 2. Inline Comments
|
|||
|
|
|
|||
|
|
Inline comments are posted **directly on the changed lines** in the diff.
|
|||
|
|
They follow the [**Conventional Comments**](https://conventionalcomments.org/) approach to make severity and intent immediately clear.
|
|||
|
|
|
|||
|
|
### Conventional Comments Format
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
<emoji> <label> (<optional decoration>): <subject>
|
|||
|
|
|
|||
|
|
<body — explanation of the issue>
|
|||
|
|
|
|||
|
|
💻 Suggested Code:
|
|||
|
|
<code block with the fix>
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### Example
|
|||
|
|
|
|||
|
|
Posted inline on line 16 of `samples/AR/App.cs`:
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
> 🔴 Issue (Blocking): Duplicate Stopwatch initialization
|
|||
|
|
>
|
|||
|
|
> The `Stopwatch.StartNew()` call on line 15 is repeated on line 16, which overwrites the first instance. This appears to be an accidental duplicate that should be removed.
|
|||
|
|
>
|
|||
|
|
> 💻 Suggested Code:
|
|||
|
|
> ```csharp
|
|||
|
|
> public void Run(string reportName, Dictionary<string, object[]>? reportParameters)
|
|||
|
|
> {
|
|||
|
|
> var sw = Stopwatch.StartNew();
|
|||
|
|
> Trace.WriteLine($"{sw.ElapsedMilliseconds} : Start { reportName}!");
|
|||
|
|
> _reportExport.Run(reportName, reportParameters, sw);
|
|||
|
|
> sw.Stop();
|
|||
|
|
> Trace.WriteLine($"{sw.ElapsedMilliseconds} : End!");
|
|||
|
|
> }
|
|||
|
|
> ```
|
|||
|
|
|
|||
|
|
|
|||
|
|
## 3. Request Changes or Approve Pull Request
|
|||
|
|
|
|||
|
|
After posting comments, the bot submits a **formal PR review** with one of two states.
|
|||
|
|
|
|||
|
|
### Request Changes
|
|||
|
|
|
|||
|
|
Triggered when one or more **Blocking** issues are found.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
Status: ❌ Request Changes
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
The PR is blocked from merging (if branch protection rules are enabled) until:
|
|||
|
|
- The author fixes the blocking issues
|
|||
|
|
- The bot re-reviews after a new commit (`synchronize` event)
|
|||
|
|
- A human reviewer overrides the block
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Approved
|
|||
|
|
|
|||
|
|
Triggered when no blocking issues are found.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
Status: ✅ Approved
|
|||
|
|
```
|