Skip to content

Commit 8046f94

Browse files
authored
Merge branch 'main' into worktree-feedback-replies
2 parents 0ef4391 + 99bfcb3 commit 8046f94

File tree

6 files changed

+36
-17
lines changed

6 files changed

+36
-17
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ jobs:
7575
done
7676
7777
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
78-
echo "New version: $NEW_VERSION"
78+
echo "previous=${LATEST_TAG}" >> $GITHUB_OUTPUT
79+
echo "New version: $NEW_VERSION (previous: ${LATEST_TAG:-none})"
7980
8081
# CI cannot push commits to main (branch protection). Instead, we create
8182
# a detached release commit with pinned refs, reachable only via tags.
@@ -128,8 +129,14 @@ jobs:
128129
- name: Create GitHub Release
129130
env:
130131
VERSION: ${{ steps.version.outputs.version }}
132+
PREVIOUS: ${{ steps.version.outputs.previous }}
131133
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
132-
run: gh release create "$VERSION" --generate-notes --latest
134+
run: |
135+
ARGS=(--generate-notes --latest)
136+
if [ -n "$PREVIOUS" ]; then
137+
ARGS+=(--notes-start-tag "$PREVIOUS")
138+
fi
139+
gh release create "$VERSION" "${ARGS[@]}"
133140
134141
- name: Update latest tag
135142
env:

.github/workflows/review-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
manual-review:
195195
if: |
196196
github.event.issue.pull_request &&
197-
contains(github.event.comment.body, '/review') &&
197+
startsWith(github.event.comment.body, '/review') &&
198198
(github.event.comment.user.type != 'Bot' || github.event.comment.user.login == 'docker-agent[bot]')
199199
runs-on: ubuntu-latest
200200
env:

.github/workflows/self-review-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
# Triggers when someone comments /review on a PR
106106
# ==========================================================================
107107
manual-review:
108-
if: github.event.issue.pull_request && contains(github.event.comment.body, '/review')
108+
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/review')
109109
runs-on: ubuntu-latest
110110
env:
111111
HAS_APP_SECRETS: ${{ secrets.CAGENT_REVIEWER_APP_ID != '' }}

action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ runs:
475475
exit 1
476476
fi
477477
echo "verbose-log-file=$VERBOSE_LOG_FILE" >> $GITHUB_OUTPUT
478-
echo "verbose-log-timestamp=$(date +%s%N)" >> $GITHUB_OUTPUT
479478
echo "Verbose log file: $VERBOSE_LOG_FILE"
480479
481480
# Build command arguments array (SECURE: no eval!)
@@ -702,7 +701,7 @@ runs:
702701
if: always() && steps.run-agent.outputs.verbose-log-file != ''
703702
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
704703
with:
705-
name: cagent-verbose-log-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.run-agent.outputs.verbose-log-timestamp }}
704+
name: cagent-verbose-log-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
706705
path: ${{ steps.run-agent.outputs.verbose-log-file }}
707706
retention-days: 14
708707
if-no-files-found: ignore

review-pr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ permissions:
125125
126126
jobs:
127127
review:
128-
if: github.event.issue.pull_request && contains(github.event.comment.body, '/review')
128+
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/review')
129129
runs-on: ubuntu-latest
130130
steps:
131131
- uses: actions/checkout@v4

review-pr/agents/pr-review.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ agents:
126126
You MUST always deliver a review, even if no issues were found.
127127
128128
- **GitHub posting mode**: Post via `gh api` (see Posting format below).
129+
ALWAYS use the `COMMENT` event — never `APPROVE` or `REQUEST_CHANGES`.
130+
This ensures the bot never grants merge authority or blocks merging.
129131
- **Console output mode**: Output markdown (see Console format below). Never call `gh api`.
130132
131133
## Verify Line Numbers (REQUIRED)
@@ -134,33 +136,44 @@ agents:
134136
If grep returns a different number than the drafter, use grep's. If the file is not
135137
found on disk, use diff hunk headers instead. Never read the same file more than twice.
136138
139+
## IMPORTANT: Comment-Only Reviews
140+
141+
This action MUST NEVER use `APPROVE` or `REQUEST_CHANGES` events.
142+
ALWAYS use the `COMMENT` event when posting reviews via `gh api`.
143+
Some repositories lack branch protection rules — using `APPROVE` would let PRs
144+
merge without human review, and `REQUEST_CHANGES` would block merging without
145+
human ability to dismiss. The bot provides feedback only, never merge authority.
146+
137147
## Decision Rules (MANDATORY — strict lookup, not a judgment call)
138148
139149
1. **Filter**: Remove findings where `in_changed_code == false` or `in_diff == false`
140-
2. **Decide** based ONLY on the highest remaining severity. Do NOT override:
141-
- ANY high severity CONFIRMED/LIKELY → `REQUEST_CHANGES`
142-
- ANY medium severity CONFIRMED/LIKELY (but NO high) → `COMMENT`
143-
- Only low/DISMISSED or no findings → `APPROVE`
144-
145-
**Example**: 5 medium-severity CONFIRMED findings → `COMMENT` (NOT REQUEST_CHANGES).
146-
The number of findings does not matter. Only use REQUEST_CHANGES if at least one
147-
finding has severity "high". Do NOT escalate based on quantity or your own judgment.
150+
2. **Classify** (for informational labeling in the review summary):
151+
- CRITICAL = high severity CONFIRMED/LIKELY
152+
- NOTABLE = medium severity CONFIRMED/LIKELY
153+
- MINOR = everything else
154+
3. **Label the assessment** (informational only — does NOT change the event type):
155+
- ANY CRITICAL findings → label as "🔴 CRITICAL" in the summary
156+
- ANY NOTABLE findings (no CRITICAL) → label as "🟡 NEEDS_ATTENTION"
157+
- Only MINOR or no findings → label as "🟢 APPROVE"
158+
4. **Post the review**: The GitHub review event is ALWAYS `COMMENT`,
159+
regardless of the assessment label. Never use `APPROVE` or `REQUEST_CHANGES`.
148160
149161
## Posting Format (GitHub posting mode)
150162
151163
Convert each CONFIRMED/LIKELY finding to an inline comment:
152164
```json
153165
{"path": "file.go", "line": 123, "body": "**ISSUE**\n\nDETAILS\n\n<!-- cagent-review -->"}
154166
```
155-
Post: `echo '{"body":"## Review Summary\n\n...","event":"EVENT","comments":[...]}' | gh api repos/{owner}/{repo}/pulls/{pr}/reviews --input -`
167+
Post: `echo '{"body":"## Review Summary\n\n...","event":"COMMENT","comments":[...]}' | gh api repos/{owner}/{repo}/pulls/{pr}/reviews --input -`
156168
157169
The `<!-- cagent-review -->` marker MUST be on its own line, separated by a blank line
158170
from the content. Do NOT include it in console output mode.
159171
160172
## Console Format
161173
162174
```
163-
## Review: [APPROVE|COMMENT|REQUEST_CHANGES]
175+
## Review: COMMENT
176+
### Assessment: [🟢 APPROVE|🟡 NEEDS_ATTENTION|🔴 CRITICAL]
164177
### Summary
165178
<assessment>
166179
### Findings

0 commit comments

Comments
 (0)