Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ validate "approve-without-label-actions" '{
"action": "approve",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "Looks good to me."
}' true

Expand All @@ -51,7 +51,7 @@ validate "approve-with-label-actions" '{
"action": "approve",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "Looks good to me.",
"label_actions": {
"reason": "Approved PR, adding reviewed label",
Expand All @@ -66,7 +66,7 @@ validate "request-changes-with-label-actions" '{
"action": "request-changes",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "Please fix the issues.",
"findings": [
{
Expand Down Expand Up @@ -104,7 +104,7 @@ validate "label-actions-missing-reason" '{
"action": "approve",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "LGTM",
"label_actions": {
"actions": [
Expand All @@ -118,7 +118,7 @@ validate "label-actions-empty-actions" '{
"action": "approve",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "LGTM",
"label_actions": {
"reason": "No labels to change",
Expand All @@ -131,7 +131,7 @@ validate "label-actions-invalid-verb" '{
"action": "approve",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "LGTM",
"label_actions": {
"reason": "Replace a label",
Expand All @@ -146,7 +146,7 @@ validate "label-actions-extra-property" '{
"action": "approve",
"pr_number": 42,
"repo": "org/repo",
"head_sha": "abc1234",
"head_sha": "abcdef0123456789abcdef0123456789abcdef01",
"body": "LGTM",
"label_actions": {
"reason": "Adding label",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"pr_number": { "type": "integer", "minimum": 1 },
"repo": { "type": "string", "pattern": "^[^/]+/[^/]+$" },
"head_sha": { "type": "string", "minLength": 7 },
"head_sha": { "type": "string", "pattern": "^[0-9a-fA-F]{40}$|^[0-9a-fA-F]{64}$" },
"body": { "type": "string", "minLength": 1 },
"findings": {
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,25 +347,25 @@ run_test_custom_filename "path-traversal-stripped" \
REVIEW_SCHEMA="${SCRIPT_DIR}/../schemas/review-result.schema.json"

run_test_custom_filename "review-reject-valid" \
'{"action":"reject","pr_number":1,"repo":"org/repo","head_sha":"abc1234","body":"Wrong approach.","findings":[{"severity":"high","category":"intent-alignment","file":"main.go","description":"Wrong design."}]}' \
'{"action":"reject","pr_number":1,"repo":"org/repo","head_sha":"abcdef0123456789abcdef0123456789abcdef01","body":"Wrong approach.","findings":[{"severity":"high","category":"intent-alignment","file":"main.go","description":"Wrong design."}]}' \
"agent-result.json" \
"${REVIEW_SCHEMA}" \
"true"

run_test_custom_filename "review-reject-missing-findings" \
'{"action":"reject","pr_number":1,"repo":"org/repo","head_sha":"abc1234","body":"Wrong approach."}' \
'{"action":"reject","pr_number":1,"repo":"org/repo","head_sha":"abcdef0123456789abcdef0123456789abcdef01","body":"Wrong approach."}' \
"agent-result.json" \
"${REVIEW_SCHEMA}" \
"false"

run_test_custom_filename "review-reject-missing-body" \
'{"action":"reject","pr_number":1,"repo":"org/repo","head_sha":"abc1234","findings":[{"severity":"high","category":"intent-alignment","file":"main.go","description":"Wrong design."}]}' \
'{"action":"reject","pr_number":1,"repo":"org/repo","head_sha":"abcdef0123456789abcdef0123456789abcdef01","findings":[{"severity":"high","category":"intent-alignment","file":"main.go","description":"Wrong design."}]}' \
"agent-result.json" \
"${REVIEW_SCHEMA}" \
"false"

run_test_custom_filename "review-approve-valid" \
'{"action":"approve","pr_number":1,"repo":"org/repo","head_sha":"abc1234","body":"Looks good, only minor nits."}' \
'{"action":"approve","pr_number":1,"repo":"org/repo","head_sha":"abcdef0123456789abcdef0123456789abcdef01","body":"Looks good, only minor nits."}' \
"agent-result.json" \
"${REVIEW_SCHEMA}" \
"true"
Expand Down
Loading