Skip to content

Commit 7e8fc46

Browse files
lpcoxCopilot
andcommitted
fix: add granular issue update tools to READ_WRITE_OPERATIONS
The test expected update_issue_assignees etc. to be write operations, but the tools were never added to any classification list. Following the same pattern as granular PR update tools (which are in READ_WRITE_OPERATIONS alongside update_pull_request), add the granular issue update tools to READ_WRITE_OPERATIONS alongside issue_write. Fix the test to check is_read_write_operation() consistently with the PR update tools test pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 08f8a8f commit 7e8fc46

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

  • guards/github-guard/rust-guard/src

guards/github-guard/rust-guard/src/tools.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ pub const READ_WRITE_OPERATIONS: &[&str] = &[
104104
// Deprecated alias coverage
105105
"update_project_item", // deprecated alias for projects_write (updateProjectV2ItemFieldValue)
106106

107+
// Granular issue update tools (alongside issue_write composite)
108+
"update_issue_assignees", // PATCH — modifies issue assignees
109+
"update_issue_body", // PATCH — modifies issue body
110+
"update_issue_labels", // PATCH — modifies issue labels
111+
"update_issue_milestone", // PATCH — modifies issue milestone
112+
"update_issue_state", // PATCH — opens or closes an issue
113+
"update_issue_title", // PATCH — modifies issue title
114+
"update_issue_type", // PATCH — modifies issue type
115+
107116
// Granular PR update tools (alongside update_pull_request composite)
108117
"update_pull_request_body", // PATCH — modifies PR body
109118
"update_pull_request_draft_state", // PATCH — converts to/from draft
@@ -329,7 +338,7 @@ mod tests {
329338
}
330339

331340
#[test]
332-
fn test_granular_issue_update_tools_are_write_operations() {
341+
fn test_granular_issue_update_tools_are_read_write_operations() {
333342
for op in &[
334343
"update_issue_assignees",
335344
"update_issue_body",
@@ -340,8 +349,13 @@ mod tests {
340349
"update_issue_type",
341350
] {
342351
assert!(
343-
is_write_operation(op),
344-
"{} must be classified as a write operation",
352+
is_read_write_operation(op),
353+
"{} must be classified as a read-write operation",
354+
op
355+
);
356+
assert!(
357+
!is_write_operation(op),
358+
"{} should not be in WRITE_OPERATIONS (it is in READ_WRITE_OPERATIONS)",
345359
op
346360
);
347361
}

0 commit comments

Comments
 (0)