-
Notifications
You must be signed in to change notification settings - Fork 425
Use IssueOrPRNumber for submit_pull_request_review.pull_request_number #39723
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
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 |
|---|---|---|
|
|
@@ -232,7 +232,7 @@ var ValidationConfig = map[string]TypeValidationConfig{ | |
| Fields: map[string]FieldValidation{ | ||
| "body": {Type: "string", Sanitize: true, MaxLength: MaxBodyLength}, | ||
| "event": {Type: "string", Enum: []string{"APPROVE", "REQUEST_CHANGES", "COMMENT"}}, | ||
| "pull_request_number": {OptionalPositiveInteger: true}, | ||
| "pull_request_number": {IssueOrPRNumber: true}, | ||
|
Contributor
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. [/diagnose] This fix aligns 💡 Remaining instances// create_pull_request_review_comment
"pull_request_number": {OptionalPositiveInteger: true}, // line 224
// reply_to_pull_request_review_comment
"pull_request_number": {OptionalPositiveInteger: true}, // line 244
// close_pull_request
"pull_request_number": {OptionalPositiveInteger: true}, // line 284If these also need temp-ID support, they should switch to |
||
| "repo": {Type: "string", MaxLength: 256}, // Optional: target repository in format "owner/repo" | ||
| }, | ||
| }, | ||
|
|
||
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.
[/tdd] Narrowing the invalid-value set silently removes rejection of
0and-1. WithIssueOrPRNumber, these pass validation and reachpr_helpers.cjswhereparseInt(String(0))= 0 — which is notNaN, so the handler accepts it and fires a GitHub API call for PR #0 or #-1. The previousOptionalPositiveIntegercaught these at validation time.💡 Suggested addition to the test
If zero/negative numbers are intentionally allowed (relying on the GitHub API to reject them), a comment explaining that decision would help future readers.