Skip to content

Commit dd90dd5

Browse files
authored
coderabbit review instructions - update to not create additional, follow up comments (RedHatQE#3130)
##### Short description: ##### More details: ##### What this PR does / why we need it: ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: ##### jira-ticket: <!-- full-ticket-url needs to be provided. This would add a link to the pull request to the jira and close it when the pull request is merged If the task is not tracked by a Jira ticket, just write "NONE". --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated automation: review posting now enforces inline review as the visible deliverable and halts after posting. * Adjusted smoke-test labeling: adding/removing the pending label now requires both a smoke-test directive and an accompanying test plan. * Improved workflow diagnostics and retained a pre-run shell script caveat. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 089e38d commit dd90dd5

2 files changed

Lines changed: 53 additions & 33 deletions

File tree

.github/workflows/request-coderabbit-test-instructions.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,23 @@ jobs:
7676
- If a test marker can cover multiple files/tests, provide the marker
7777
- Balance coverage vs over-testing - Keep descriptions minimal
7878
79-
When responding to test execution plan request:
80-
- Post ONLY an inline review comment on the Files Changed tab with the test plan
81-
- ONLY! if you fail to add a review comment, add a comment in the PR discussion thread
82-
- Do NOT add any follow-up comments in the PR discussion thread
83-
- Do not add a follow-up comment in the PR
84-
- Do NOT add acknowledgment comments like "I've successfully posted..."
85-
- After posting the review comment, consider the task complete and do not generate any additional replies
79+
**CRITICAL WORKFLOW COMPLETION RULES:**
80+
81+
When responding to this test execution plan request, you MUST follow these rules EXACTLY:
82+
83+
1. **YOUR ONLY DELIVERABLE**: Post an inline review comment on the Files Changed tab with the test execution plan
84+
2. **THEN STOP IMMEDIATELY** - Do NOT generate any response in this PR discussion thread
85+
3. **FALLBACK ONLY**: If posting the inline review fails after retrying, ONLY then post in the PR discussion thread
86+
4. **SILENCE = SUCCESS**: After successfully posting the inline review comment, your task is complete. No confirmation needed.
87+
88+
**ABSOLUTE PROHIBITIONS** (violating these creates empty/meaningless reviews):
89+
- ❌ Do NOT post acknowledgment messages like "Test execution plan posted", "Review posted successfully", "I've successfully posted"
90+
- ❌ Do NOT mention review IDs, URLs, or confirmation of posting in the PR thread
91+
- ❌ Do NOT add any follow-up comments in the PR discussion thread after posting the inline review
92+
- ❌ Do NOT reply to confirm task completion
93+
- ❌ Do NOT explain what you did - just do it and stop
94+
95+
**Remember**: The inline review comment on Files Changed is visible to users. Additional comments are redundant noise.
8696
8797
CRITICAL: Before setting "Run smoke tests: True", you MUST use shell scripts to:
8898
- Trace the actual fixture dependency chain from smoke tests to changed fixtures

.github/workflows/smoke-tests-label-from-coderabbit.yml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
# Created with Claude Code assistance
33
#
44
# Summary:
5-
# ┌─────────────────────────────────┬───────────────────────┬──────────────────────────────┐
6-
# │ CodeRabbit Comment Contains │ Current Label │ Action │
7-
# ├─────────────────────────────────┼───────────────────────┼──────────────────────────────┤
8-
# │ "Run smoke tests: True" │ None │ ✅ Add 'smoke-tests:pending' │
9-
# │ "Run smoke tests: True" │ Already has label │ ✅ No-op (safe) │
10-
# │ "Run smoke tests: False" │ Has label │ ✅ Remove label │
11-
# │ "Run smoke tests: False" │ None │ ✅ No action │
12-
# │ Neither pattern │ Any │ ⏭️ No action │
13-
# │ Comment not from CodeRabbit │ Any │ ⏭️ Does NOT run │
14-
# └─────────────────────────────────┴───────────────────────┴──────────────────────────────┘
5+
# ┌──────────────────────────────────────────────────────────────┬───────────────────────┬──────────────────────────────┐
6+
# │ CodeRabbit Comment Contains │ Current Label │ Action │
7+
# ├──────────────────────────────────────────────────────────────┼───────────────────────┼──────────────────────────────┤
8+
# │ "Run smoke tests: True" AND "Test Execution Plan" │ None │ ✅ Add 'smoke-tests:pending' │
9+
# │ "Run smoke tests: True" AND "Test Execution Plan" │ Already has label │ ✅ No-op (safe) │
10+
# │ "Run smoke tests: False" AND "Test Execution Plan" │ Has label │ ✅ Remove label │
11+
# │ "Run smoke tests: False" AND "Test Execution Plan" │ None │ ✅ No action │
12+
# │ Missing "Test Execution Plan" │ Any │ ⏭️ No action │
13+
# │ Neither pattern │ Any │ ⏭️ No action │
14+
# │ Comment not from CodeRabbit │ Any │ ⏭️ Does NOT run │
15+
# └──────────────────────────────────────────────────────────────┴───────────────────────┴──────────────────────────────┘
1516

1617
name: "Smoke Tests Label from CodeRabbit"
1718

@@ -43,40 +44,49 @@ jobs:
4344
echo "=========================================="
4445
echo "Comment Author: ${{ github.event.comment.user.login }}"
4546
echo ""
47+
echo "Comment Body (first 100 chars):"
48+
echo "${{ github.event.comment.body }}" | head -c 100
49+
echo ""
4650
echo "=========================================="
4751
echo "Condition Matching Results"
4852
echo "=========================================="
49-
echo "Is author 'coderabbitai'? ${{ github.event.comment.user.login == 'coderabbitai' }}"
50-
echo "Is author 'coderabbitai[bot]'? ${{ github.event.comment.user.login == 'coderabbitai[bot]' }}"
51-
echo "Contains 'coderabbit' in author? ${{ contains(github.event.comment.user.login, 'coderabbit') }}"
52-
echo ""
53+
echo "Contains 'Test Execution Plan'? ${{ contains(github.event.comment.body, 'Test Execution Plan') }}"
5354
echo "Contains 'Run smoke tests: True'? ${{ contains(github.event.comment.body, 'Run smoke tests: True') }}"
5455
echo "Contains 'Run smoke tests: False'? ${{ contains(github.event.comment.body, 'Run smoke tests: False') }}"
56+
echo ""
57+
echo "=========================================="
58+
echo "Action Determination"
5559
echo "=========================================="
60+
HAS_TEST_PLAN="${{ contains(github.event.comment.body, 'Test Execution Plan') }}"
61+
HAS_RUN_TRUE="${{ contains(github.event.comment.body, 'Run smoke tests: True') }}"
62+
HAS_RUN_FALSE="${{ contains(github.event.comment.body, 'Run smoke tests: False') }}"
5663
57-
- name: Add smoke-tests:pending label
58-
if: "contains(github.event.comment.body, 'Run smoke tests: True')"
59-
run: echo "▶️ Adding 'smoke-tests:pending' label (comment indicates smoke tests should run)"
64+
if [ "$HAS_TEST_PLAN" = "true" ] && [ "$HAS_RUN_TRUE" = "true" ]; then
65+
echo "ACTION: ✅ Will ADD smoke-tests:pending label"
66+
elif [ "$HAS_TEST_PLAN" = "true" ] && [ "$HAS_RUN_FALSE" = "true" ]; then
67+
echo "ACTION: ✅ Will REMOVE smoke-tests:pending label"
68+
else
69+
echo "ACTION: ⏭️ No label change (missing Test Execution Plan or smoke test directive)"
70+
fi
71+
echo "=========================================="
6072
61-
- name: Execute add label action
62-
if: "contains(github.event.comment.body, 'Run smoke tests: True')"
73+
- name: Add smoke-tests:pending label
74+
if: "contains(github.event.comment.body, 'Run smoke tests: True') && contains(github.event.comment.body, 'Test Execution Plan')"
6375
uses: actions-ecosystem/action-add-labels@v1
6476
with:
6577
labels: smoke-tests:pending
6678
github_token: ${{ secrets.GITHUB_TOKEN }}
6779

6880
- name: Remove smoke-tests:pending label
69-
if: "contains(github.event.comment.body, 'Run smoke tests: False')"
70-
run: echo "▶️ Removing 'smoke-tests:pending' label (comment indicates smoke tests should NOT run)"
71-
72-
- name: Execute remove label action
73-
if: "contains(github.event.comment.body, 'Run smoke tests: False')"
81+
if: "contains(github.event.comment.body, 'Run smoke tests: False') && contains(github.event.comment.body, 'Test Execution Plan')"
7482
uses: actions-ecosystem/action-remove-labels@v1
7583
continue-on-error: true # Ignore error if label doesn't exist
7684
with:
7785
labels: smoke-tests:pending
7886
github_token: ${{ secrets.GITHUB_TOKEN }}
7987

8088
- name: No action needed
81-
if: "!contains(github.event.comment.body, 'Run smoke tests: True') && !contains(github.event.comment.body, 'Run smoke tests: False')"
82-
run: echo "⏭️ No action needed - comment does not contain smoke test directive"
89+
if: |
90+
!contains(github.event.comment.body, 'Test Execution Plan') ||
91+
(!contains(github.event.comment.body, 'Run smoke tests: True') && !contains(github.event.comment.body, 'Run smoke tests: False'))
92+
run: echo "⏭️ No action needed - comment does not contain smoke test directive or Test Execution Plan"

0 commit comments

Comments
 (0)