-
Notifications
You must be signed in to change notification settings - Fork 2
feat(triage): add not-planned action to close out-of-scope issues #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -279,6 +279,31 @@ run_test "question-missing-comment-fails" \ | |
| "" \ | ||
| "true" | ||
|
|
||
| run_test "not-planned-posts-comment" \ | ||
| '{"action":"not-planned","reasoning":"out of scope","comment":"This request is out of scope for the project goals. See docs/scope.md for more details."}' \ | ||
| "gh issue comment 42 --repo test-org/test-repo --body-file -" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [medium] eval-coverage These tests thoroughly cover the post-script mechanics, but no Suggested fix: Add an eval case for a clearly out-of-scope issue expecting |
||
|
|
||
| run_test "not-planned-applies-label" \ | ||
| '{"action":"not-planned","reasoning":"out of scope","comment":"This request is out of scope for the project goals."}' \ | ||
| "gh api repos/test-org/test-repo/issues/42/labels -f labels[]=not-planned --silent" | ||
|
|
||
| run_test "not-planned-removes-blocked-label" \ | ||
| '{"action":"not-planned","reasoning":"out of scope","comment":"This request is out of scope."}' \ | ||
| "gh api repos/test-org/test-repo/issues/42/labels/blocked -X DELETE --silent" | ||
|
|
||
| run_test "not-planned-removes-needs-info-label" \ | ||
| '{"action":"not-planned","reasoning":"out of scope","comment":"This request is out of scope."}' \ | ||
| "gh api repos/test-org/test-repo/issues/42/labels/needs-info -X DELETE --silent" | ||
|
|
||
| run_test "not-planned-closes-issue" \ | ||
| '{"action":"not-planned","reasoning":"out of scope","comment":"This request is out of scope for the project goals."}' \ | ||
| "gh issue close 42 --repo test-org/test-repo --reason not planned" | ||
|
|
||
| run_test "not-planned-missing-comment-fails" \ | ||
| '{"action":"not-planned","reasoning":"out of scope"}' \ | ||
| "" \ | ||
| "true" | ||
|
|
||
| run_test_stdout "question-control-label-refused" \ | ||
| '{"action":"question","reasoning":"issue is asking a question","comment":"Answer here.","label_actions":{"reason":"Tried to set question label.","actions":[{"action":"add","label":"question"}]}}' \ | ||
| "::warning::Refused to add control label 'question' -- control labels are managed by the triage pipeline" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ remove_label() { | |
| # add or remove these via label_actions. This list covers labels that the | ||
| # pipeline itself applies (pre-triage.sh resets the first five; the action | ||
| # handlers apply blocked/triaged/feature). | ||
| CONTROL_LABELS=("needs-info" "ready-to-code" "duplicate" "feature" "blocked" "triaged" "question") | ||
| CONTROL_LABELS=("needs-info" "ready-to-code" "duplicate" "feature" "blocked" "triaged" "question" "not-planned") | ||
|
qodo-code-review[bot] marked this conversation as resolved.
|
||
|
|
||
| is_control_label() { | ||
| local label="$1" | ||
|
|
@@ -341,6 +341,16 @@ ${FAILED_CREATES}" | |
| add_label "question" | ||
| ;; | ||
|
|
||
| not-planned) | ||
| if [[ -z "${COMMENT}" ]]; then | ||
| echo "ERROR: action is 'not-planned' but no comment provided" >&2 | ||
| exit 1 | ||
| fi | ||
| remove_label "blocked" | ||
| remove_label "needs-info" | ||
| add_label "not-planned" | ||
| ;; | ||
|
qodo-code-review[bot] marked this conversation as resolved.
|
||
|
|
||
|
Comment on lines
+344
to
+353
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| *) | ||
| echo "ERROR: unknown action '${ACTION}' — this may be a newer action that post-triage.sh does not handle yet" >&2 | ||
| exit 1 | ||
|
|
@@ -433,10 +443,14 @@ else | |
| printf '%s' "${COMMENT}" | gh issue comment "${ISSUE_NUMBER}" --repo "${REPO}" --body-file - | ||
| fi | ||
|
|
||
| # --- Post-action: close duplicate issues --- | ||
| # --- Post-action: close issues --- | ||
|
|
||
| if [[ "${ACTION}" == "duplicate" ]]; then | ||
| gh issue close "${ISSUE_NUMBER}" --repo "${REPO}" --reason "duplicate" | ||
| fi | ||
|
|
||
| if [[ "${ACTION}" == "not-planned" ]]; then | ||
| gh issue close "${ISSUE_NUMBER}" --repo "${REPO}" --reason "not planned" | ||
| fi | ||
|
|
||
| echo "Post-triage complete." | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[medium] missing-guardrail
not-plannedis the only destructive, hard-to-undo triage outcome (it closes a reporter's issue), yet it's the only action without a HARD CONSTRAINT rule integrating it into the decision framework —sufficient,insufficient,prerequisites, andquestionall have explicit anti-bypass rules (lines 58, 149, 151, 153). Two gaps: (1) nothing biases the agent toward caution when out-of-scope status is ambiguous — the "technical direction counter to documented architectural decisions" criterion is subjective and easy to over-apply to ambitious-but-legitimate feature requests; (2) nothing settles priority againstsufficient/triagedfor a clearly-written but out-of-scope request, or againstinsufficientfor an out-of-scope issue that is also vague.Suggested fix: Add a HARD CONSTRAINT, e.g.: "When uncertain whether an issue is truly out of scope, prefer
insufficient(ask) orsufficient/triaged(let a human decide) overnot-planned. Only usenot-plannedwhen out-of-scope/invalid/spam status is unambiguous, and cite the specific scope doc or ADR in the comment when closing on scope grounds."