From f287844070b07ddfe4ef52ff09a185100ed5cb53 Mon Sep 17 00:00:00 2001 From: William Easton Date: Sat, 14 Feb 2026 15:31:58 -0600 Subject: [PATCH] Move if-body setting to submit-pull-request-review --- .github/aw/github-agentic-workflows.md | 8 +- actions/setup/js/pr_review_buffer.cjs | 4 +- .../setup/js/safe_output_handler_manager.cjs | 10 +- .../safe_output_unified_handler_manager.cjs | 10 +- .../setup/js/types/safe-outputs-config.d.ts | 14 +++ docs/src/content/docs/reference/footers.md | 13 ++- .../reference/safe-outputs-specification.md | 1 + pkg/parser/schemas/main_workflow_schema.json | 14 ++- pkg/workflow/compiler_safe_outputs_config.go | 22 ++++- pkg/workflow/create_pr_review_comment.go | 25 ----- pkg/workflow/submit_pr_review.go | 26 ++++- ...est.go => submit_pr_review_footer_test.go} | 98 +++++++++++++++---- 12 files changed, 166 insertions(+), 79 deletions(-) rename pkg/workflow/{create_pr_review_comment_footer_test.go => submit_pr_review_footer_test.go} (58%) diff --git a/.github/aw/github-agentic-workflows.md b/.github/aw/github-agentic-workflows.md index 3a6b9f61f10..a984014524b 100644 --- a/.github/aw/github-agentic-workflows.md +++ b/.github/aw/github-agentic-workflows.md @@ -447,13 +447,15 @@ The YAML frontmatter supports these fields: ```yaml safe-outputs: create-pull-request-review-comment: - max: 3 # Optional: maximum number of review comments (default: 1) + max: 3 # Optional: maximum number of review comments (default: 10) side: "RIGHT" # Optional: side of diff ("LEFT" or "RIGHT", default: "RIGHT") - footer: "always" # Optional: footer control ("always", "none", "if-body", default: "always") target: "*" # Optional: "triggering" (default), "*", or number target-repo: "owner/repo" # Optional: cross-repository + submit-pull-request-review: + max: 1 # Optional: maximum number of reviews to submit (default: 1) + footer: "if-body" # Optional: footer control ("always", "none", "if-body", default: "always") ``` - **Footer Control**: The `footer` field controls when AI-generated footers appear in PR review comments. Values: `"always"` (default, always include footer), `"none"` (never include footer), `"if-body"` (only include footer when review body is non-empty). Boolean values are also supported: `true` maps to `"always"`, `false` maps to `"none"`. + **Footer Control**: The `footer` field on `submit-pull-request-review` controls when AI-generated footers appear in the PR review body. Values: `"always"` (default, always include footer), `"none"` (never include footer), `"if-body"` (only include footer when review body is non-empty). Boolean values are also supported: `true` maps to `"always"`, `false` maps to `"none"`. This is useful for clean approval reviews — with `"if-body"`, approvals without explanatory text appear without a footer. When using `safe-outputs.create-pull-request-review-comment`, the main job does **not** need `pull-requests: write` permission since review comment creation is handled by a separate job with appropriate permissions. - `update-issue:` - Update issue title, body, labels, assignees, or milestone (NOT for closing - use close-issue instead) diff --git a/actions/setup/js/pr_review_buffer.cjs b/actions/setup/js/pr_review_buffer.cjs index 18544fe9057..46271e0ea43 100644 --- a/actions/setup/js/pr_review_buffer.cjs +++ b/actions/setup/js/pr_review_buffer.cjs @@ -128,8 +128,8 @@ function createReviewBuffer() { * Also accepts boolean values for backward compatibility: * - true → "always" * - false → "none" - * Note: create-pull-request-review-comment.footer is converted to a string in Go, - * but submit-pull-request-review.footer and global footer are still emitted as booleans. + * Note: submit-pull-request-review.footer is emitted as a string by the Go compiler. + * The global footer setting is emitted as a boolean and converted by getEffectiveFooterString. * @param {string|boolean} value - Footer mode string or boolean */ function setFooterMode(value) { diff --git a/actions/setup/js/safe_output_handler_manager.cjs b/actions/setup/js/safe_output_handler_manager.cjs index c0c5a43679d..5a269f17ac6 100644 --- a/actions/setup/js/safe_output_handler_manager.cjs +++ b/actions/setup/js/safe_output_handler_manager.cjs @@ -740,14 +740,10 @@ async function main() { const prReviewBuffer = createReviewBuffer(); // Apply footer config with priority: - // 1. create_pull_request_review_comment.footer (highest priority) - // 2. submit_pull_request_review.footer (fallback) - // 3. Default: "always" + // 1. submit_pull_request_review.footer (highest priority — footer controls review body) + // 2. Default: "always" let footerConfig = undefined; - if (config.create_pull_request_review_comment?.footer !== undefined) { - footerConfig = config.create_pull_request_review_comment.footer; - core.info(`Using footer config from create_pull_request_review_comment: ${footerConfig}`); - } else if (config.submit_pull_request_review?.footer !== undefined) { + if (config.submit_pull_request_review?.footer !== undefined) { footerConfig = config.submit_pull_request_review.footer; core.info(`Using footer config from submit_pull_request_review: ${footerConfig}`); } diff --git a/actions/setup/js/safe_output_unified_handler_manager.cjs b/actions/setup/js/safe_output_unified_handler_manager.cjs index 3e9ea2fe278..b9f8a0299de 100644 --- a/actions/setup/js/safe_output_unified_handler_manager.cjs +++ b/actions/setup/js/safe_output_unified_handler_manager.cjs @@ -985,14 +985,10 @@ async function main() { const prReviewBuffer = createReviewBuffer(); // Apply footer config with priority: - // 1. create_pull_request_review_comment.footer (highest priority) - // 2. submit_pull_request_review.footer (fallback) - // 3. Default: "always" + // 1. submit_pull_request_review.footer (highest priority — footer controls review body) + // 2. Default: "always" let footerConfig = undefined; - if (configs.regular?.create_pull_request_review_comment?.footer !== undefined) { - footerConfig = configs.regular.create_pull_request_review_comment.footer; - core.info(`Using footer config from create_pull_request_review_comment: ${footerConfig}`); - } else if (configs.regular?.submit_pull_request_review?.footer !== undefined) { + if (configs.regular?.submit_pull_request_review?.footer !== undefined) { footerConfig = configs.regular.submit_pull_request_review.footer; core.info(`Using footer config from submit_pull_request_review: ${footerConfig}`); } diff --git a/actions/setup/js/types/safe-outputs-config.d.ts b/actions/setup/js/types/safe-outputs-config.d.ts index 602ce200ffa..f22c4e6d252 100644 --- a/actions/setup/js/types/safe-outputs-config.d.ts +++ b/actions/setup/js/types/safe-outputs-config.d.ts @@ -94,6 +94,18 @@ interface CreatePullRequestReviewCommentConfig extends SafeOutputConfig { target?: string; } +/** + * Configuration for submitting a consolidated PR review. + * The footer field controls when AI-generated footer is added to the review body: + * - "always" (default): Always include footer + * - "none": Never include footer + * - "if-body": Only include footer when review has body text + * Boolean values are also supported: true maps to "always", false maps to "none". + */ +interface SubmitPullRequestReviewConfig extends SafeOutputConfig { + footer?: boolean | "always" | "none" | "if-body"; +} + /** * Configuration for replying to pull request review comments. * Inherits common fields (e.g. "github-token") from SafeOutputConfig. @@ -290,6 +302,7 @@ type SpecificSafeOutputConfig = | AddCommentConfig | CreatePullRequestConfig | CreatePullRequestReviewCommentConfig + | SubmitPullRequestReviewConfig | CreateCodeScanningAlertConfig | AutofixCodeScanningAlertConfig | AddLabelsConfig @@ -324,6 +337,7 @@ export { AddCommentConfig, CreatePullRequestConfig, CreatePullRequestReviewCommentConfig, + SubmitPullRequestReviewConfig, CreateCodeScanningAlertConfig, AutofixCodeScanningAlertConfig, AddLabelsConfig, diff --git a/docs/src/content/docs/reference/footers.md b/docs/src/content/docs/reference/footers.md index ce9026b7d55..f992e647e1b 100644 --- a/docs/src/content/docs/reference/footers.md +++ b/docs/src/content/docs/reference/footers.md @@ -42,21 +42,21 @@ safe-outputs: Individual handler settings always take precedence over the global setting. -## PR Review Comment Footer Control +## PR Review Footer Control -For PR review comments (`create-pull-request-review-comment`), the `footer` field supports additional conditional control: +For PR reviews (`submit-pull-request-review`), the `footer` field supports conditional control over when the footer is added to the review body: ```yaml wrap safe-outputs: create-pull-request-review-comment: - footer: "if-body" # conditional footer based on review body submit-pull-request-review: + footer: "if-body" # conditional footer based on review body ``` The `footer` field accepts three string values: -- `"always"` (default) - Always include footer on review comments -- `"none"` - Never include footer on review comments +- `"always"` (default) - Always include footer on the review body +- `"none"` - Never include footer on the review body - `"if-body"` - Only include footer when the review has body text Boolean values are also supported and automatically converted: @@ -70,9 +70,8 @@ This is particularly useful for clean approval reviews without body text. With ` ```yaml wrap safe-outputs: create-pull-request-review-comment: - footer: "if-body" # Show footer only when review has body submit-pull-request-review: - max: 1 + footer: "if-body" # Show footer only when review has body ``` When the agent submits an approval without a body (just "APPROVE" event), no footer appears. When the agent includes explanatory comments in the review body, the footer is included. diff --git a/docs/src/content/docs/reference/safe-outputs-specification.md b/docs/src/content/docs/reference/safe-outputs-specification.md index dc93df7c638..8a8546f8e0b 100644 --- a/docs/src/content/docs/reference/safe-outputs-specification.md +++ b/docs/src/content/docs/reference/safe-outputs-specification.md @@ -2191,6 +2191,7 @@ This section provides complete definitions for all remaining safe output types. **Notes**: - Submits all buffered review comments from `create_pull_request_review_comment` - Review status affects PR merge requirements +- Footer control: `footer` accepts `"always"` (default), `"none"`, or `"if-body"` (only when review body has text); boolean `true`/`false` maps to `"always"`/`"none"` --- diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index c71a9fd39b0..b2eca7a63dc 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -4987,8 +4987,18 @@ "maximum": 10 }, "footer": { - "type": "boolean", - "description": "Controls whether AI-generated footer is added to the review body. When false, the footer is omitted. Defaults to true." + "oneOf": [ + { + "type": "boolean", + "description": "Controls whether AI-generated footer is added to the review body. true maps to 'always', false maps to 'none'." + }, + { + "type": "string", + "enum": ["always", "none", "if-body"], + "description": "Controls when AI-generated footer is added to the review body: 'always' (default), 'none' (never), or 'if-body' (only when review has body text)." + } + ], + "description": "Controls when AI-generated footer is added to the review body. Accepts boolean (true/false) or string ('always', 'none', 'if-body'). The 'if-body' mode is useful for clean approval reviews without body text. Defaults to 'always'." }, "github-token": { "$ref": "#/$defs/github_token", diff --git a/pkg/workflow/compiler_safe_outputs_config.go b/pkg/workflow/compiler_safe_outputs_config.go index b4171d0bc48..a186c0620fd 100644 --- a/pkg/workflow/compiler_safe_outputs_config.go +++ b/pkg/workflow/compiler_safe_outputs_config.go @@ -19,6 +19,25 @@ func getEffectiveFooter(localFooter *bool, globalFooter *bool) *bool { return globalFooter } +// getEffectiveFooterString returns the effective footer string value for a config. +// If the local string footer is set, use it; otherwise convert the global bool footer. +// Returns nil if neither is set (default to "always" in JavaScript). +func getEffectiveFooterString(localFooter *string, globalFooter *bool) *string { + if localFooter != nil { + return localFooter + } + if globalFooter != nil { + var s string + if *globalFooter { + s = "always" + } else { + s = "none" + } + return &s + } + return nil +} + // handlerConfigBuilder provides a fluent API for building handler configurations type handlerConfigBuilder struct { config map[string]any @@ -303,7 +322,6 @@ var handlerRegistry = map[string]handlerBuilder{ AddIfNotEmpty("target", c.Target). AddIfNotEmpty("target-repo", c.TargetRepoSlug). AddStringSlice("allowed_repos", c.AllowedRepos). - AddStringPtr("footer", c.Footer). Build() }, "submit_pull_request_review": func(cfg *SafeOutputsConfig) map[string]any { @@ -313,7 +331,7 @@ var handlerRegistry = map[string]handlerBuilder{ c := cfg.SubmitPullRequestReview return newHandlerConfigBuilder(). AddIfPositive("max", c.Max). - AddBoolPtr("footer", getEffectiveFooter(c.Footer, cfg.Footer)). + AddStringPtr("footer", getEffectiveFooterString(c.Footer, cfg.Footer)). Build() }, "reply_to_pull_request_review_comment": func(cfg *SafeOutputsConfig) map[string]any { diff --git a/pkg/workflow/create_pr_review_comment.go b/pkg/workflow/create_pr_review_comment.go index 18ca8859da9..be6b31400c9 100644 --- a/pkg/workflow/create_pr_review_comment.go +++ b/pkg/workflow/create_pr_review_comment.go @@ -15,7 +15,6 @@ type CreatePullRequestReviewCommentsConfig struct { Target string `yaml:"target,omitempty"` // Target for comments: "triggering" (default), "*" (any PR), or explicit PR number TargetRepoSlug string `yaml:"target-repo,omitempty"` // Target repository in format "owner/repo" for cross-repository PR review comments AllowedRepos []string `yaml:"allowed-repos,omitempty"` // List of additional repositories that PR review comments can be added to (additionally to the target-repo) - Footer *string `yaml:"footer,omitempty"` // Controls when to show footer in PR review: "always" (default), "none", or "if-body" (only when review has body text) } // buildCreateOutputPullRequestReviewCommentJob creates the create_pr_review_comment job @@ -120,30 +119,6 @@ func (c *Compiler) parsePullRequestReviewCommentsConfig(outputMap map[string]any } prReviewCommentsConfig.TargetRepoSlug = targetRepoSlug - // Parse footer configuration - if footer, exists := configMap["footer"]; exists { - switch f := footer.(type) { - case string: - // Validate string values: "always", "none", "if-body" - if f == "always" || f == "none" || f == "if-body" { - prReviewCommentsConfig.Footer = &f - createPRReviewCommentLog.Printf("Footer control: %s", f) - } else { - createPRReviewCommentLog.Printf("Invalid footer value: %s (must be 'always', 'none', or 'if-body')", f) - } - case bool: - // Map boolean to string: true -> "always", false -> "none" - var footerStr string - if f { - footerStr = "always" - } else { - footerStr = "none" - } - prReviewCommentsConfig.Footer = &footerStr - createPRReviewCommentLog.Printf("Footer control (mapped from bool): %s", footerStr) - } - } - // Parse common base fields with default max of 10 c.parseBaseSafeOutputConfig(configMap, &prReviewCommentsConfig.BaseSafeOutputConfig, 10) } else { diff --git a/pkg/workflow/submit_pr_review.go b/pkg/workflow/submit_pr_review.go index 1520a582195..4ce76038570 100644 --- a/pkg/workflow/submit_pr_review.go +++ b/pkg/workflow/submit_pr_review.go @@ -12,7 +12,7 @@ var submitPRReviewLog = logger.New("workflow:submit_pr_review") // If this safe output type is not configured, review comments default to event: "COMMENT". type SubmitPullRequestReviewConfig struct { BaseSafeOutputConfig `yaml:",inline"` - Footer *bool `yaml:"footer,omitempty"` // Controls whether AI-generated footer is added to the review body. When false, footer is omitted. + Footer *string `yaml:"footer,omitempty"` // Controls when to show footer in PR review body: "always" (default), "none", or "if-body" (only when review has body text) } // parseSubmitPullRequestReviewConfig handles submit-pull-request-review configuration @@ -31,11 +31,27 @@ func (c *Compiler) parseSubmitPullRequestReviewConfig(outputMap map[string]any) // Parse common base fields with default max of 1 c.parseBaseSafeOutputConfig(configMap, &config.BaseSafeOutputConfig, 1) - // Parse footer flag + // Parse footer configuration (string: "always"/"none"/"if-body", or bool for backward compat) if footer, exists := configMap["footer"]; exists { - if footerBool, ok := footer.(bool); ok { - config.Footer = &footerBool - submitPRReviewLog.Printf("Footer control: %t", footerBool) + switch f := footer.(type) { + case string: + // Validate string values: "always", "none", "if-body" + if f == "always" || f == "none" || f == "if-body" { + config.Footer = &f + submitPRReviewLog.Printf("Footer control: %s", f) + } else { + submitPRReviewLog.Printf("Invalid footer value: %s (must be 'always', 'none', or 'if-body')", f) + } + case bool: + // Map boolean to string: true -> "always", false -> "none" + var footerStr string + if f { + footerStr = "always" + } else { + footerStr = "none" + } + config.Footer = &footerStr + submitPRReviewLog.Printf("Footer control (mapped from bool): %s", footerStr) } } } else { diff --git a/pkg/workflow/create_pr_review_comment_footer_test.go b/pkg/workflow/submit_pr_review_footer_test.go similarity index 58% rename from pkg/workflow/create_pr_review_comment_footer_test.go rename to pkg/workflow/submit_pr_review_footer_test.go index 1f3a36367d7..17aa4bb2d6b 100644 --- a/pkg/workflow/create_pr_review_comment_footer_test.go +++ b/pkg/workflow/submit_pr_review_footer_test.go @@ -11,7 +11,43 @@ import ( "github.com/stretchr/testify/require" ) -func TestPRReviewCommentFooterConfig(t *testing.T) { +func TestGetEffectiveFooterString(t *testing.T) { + t.Run("returns local footer when set", func(t *testing.T) { + local := "if-body" + result := getEffectiveFooterString(&local, nil) + require.NotNil(t, result, "Should return local footer") + assert.Equal(t, "if-body", *result, "Should return local footer value") + }) + + t.Run("local footer takes precedence over global", func(t *testing.T) { + local := "none" + globalTrue := true + result := getEffectiveFooterString(&local, &globalTrue) + require.NotNil(t, result, "Should return local footer") + assert.Equal(t, "none", *result, "Local should override global") + }) + + t.Run("converts global true to always", func(t *testing.T) { + globalTrue := true + result := getEffectiveFooterString(nil, &globalTrue) + require.NotNil(t, result, "Should convert global bool") + assert.Equal(t, "always", *result, "Global true should map to always") + }) + + t.Run("converts global false to none", func(t *testing.T) { + globalFalse := false + result := getEffectiveFooterString(nil, &globalFalse) + require.NotNil(t, result, "Should convert global bool") + assert.Equal(t, "none", *result, "Global false should map to none") + }) + + t.Run("returns nil when both are nil", func(t *testing.T) { + result := getEffectiveFooterString(nil, nil) + assert.Nil(t, result, "Should return nil when neither is set") + }) +} + +func TestSubmitPRReviewFooterConfig(t *testing.T) { t.Run("parses footer string values", func(t *testing.T) { testCases := []struct { name string @@ -27,12 +63,12 @@ func TestPRReviewCommentFooterConfig(t *testing.T) { t.Run(tc.name, func(t *testing.T) { compiler := NewCompiler() outputMap := map[string]any{ - "create-pull-request-review-comment": map[string]any{ + "submit-pull-request-review": map[string]any{ "footer": tc.value, }, } - config := compiler.parsePullRequestReviewCommentsConfig(outputMap) + config := compiler.parseSubmitPullRequestReviewConfig(outputMap) require.NotNil(t, config, "Config should be parsed") require.NotNil(t, config.Footer, "Footer should be set") assert.Equal(t, tc.expected, *config.Footer, "Footer value should match") @@ -54,14 +90,14 @@ func TestPRReviewCommentFooterConfig(t *testing.T) { t.Run(tc.name, func(t *testing.T) { compiler := NewCompiler() outputMap := map[string]any{ - "create-pull-request-review-comment": map[string]any{ + "submit-pull-request-review": map[string]any{ "footer": tc.value, }, } - config := compiler.parsePullRequestReviewCommentsConfig(outputMap) + config := compiler.parseSubmitPullRequestReviewConfig(outputMap) require.NotNil(t, config, "Config should be parsed") - require.NotNil(t, config.Footer, "Footer should be set") + require.NotNil(t, config.Footer, "Footer value should be set") assert.Equal(t, tc.expected, *config.Footer, "Footer value should be mapped from boolean") }) } @@ -70,17 +106,32 @@ func TestPRReviewCommentFooterConfig(t *testing.T) { t.Run("ignores invalid footer values", func(t *testing.T) { compiler := NewCompiler() outputMap := map[string]any{ - "create-pull-request-review-comment": map[string]any{ + "submit-pull-request-review": map[string]any{ "footer": "invalid-value", }, } - config := compiler.parsePullRequestReviewCommentsConfig(outputMap) + config := compiler.parseSubmitPullRequestReviewConfig(outputMap) require.NotNil(t, config, "Config should be parsed") assert.Nil(t, config.Footer, "Invalid footer value should be ignored") }) t.Run("footer not set when omitted", func(t *testing.T) { + compiler := NewCompiler() + outputMap := map[string]any{ + "submit-pull-request-review": map[string]any{ + "max": 1, + }, + } + + config := compiler.parseSubmitPullRequestReviewConfig(outputMap) + require.NotNil(t, config, "Config should be parsed") + assert.Nil(t, config.Footer, "Footer should be nil when not configured") + }) +} + +func TestCreatePRReviewCommentNoFooter(t *testing.T) { + t.Run("create-pull-request-review-comment does not have footer field", func(t *testing.T) { compiler := NewCompiler() outputMap := map[string]any{ "create-pull-request-review-comment": map[string]any{ @@ -90,21 +141,25 @@ func TestPRReviewCommentFooterConfig(t *testing.T) { config := compiler.parsePullRequestReviewCommentsConfig(outputMap) require.NotNil(t, config, "Config should be parsed") - assert.Nil(t, config.Footer, "Footer should be nil when not configured") + // CreatePullRequestReviewCommentsConfig no longer has a Footer field; + // footer control belongs on submit-pull-request-review }) } -func TestPRReviewCommentFooterInHandlerConfig(t *testing.T) { - t.Run("footer included in handler config", func(t *testing.T) { +func TestSubmitPRReviewFooterInHandlerConfig(t *testing.T) { + t.Run("footer included in submit_pull_request_review handler config", func(t *testing.T) { compiler := NewCompiler() footerValue := "if-body" workflowData := &WorkflowData{ Name: "Test", SafeOutputs: &SafeOutputsConfig{ + SubmitPullRequestReview: &SubmitPullRequestReviewConfig{ + BaseSafeOutputConfig: BaseSafeOutputConfig{Max: 1}, + Footer: &footerValue, + }, CreatePullRequestReviewComments: &CreatePullRequestReviewCommentsConfig{ BaseSafeOutputConfig: BaseSafeOutputConfig{Max: 10}, Side: "RIGHT", - Footer: &footerValue, }, }, } @@ -127,9 +182,15 @@ func TestPRReviewCommentFooterInHandlerConfig(t *testing.T) { err := json.Unmarshal([]byte(jsonStr), &handlerConfig) require.NoError(t, err, "Should unmarshal handler config") + submitConfig, ok := handlerConfig["submit_pull_request_review"].(map[string]any) + require.True(t, ok, "submit_pull_request_review config should exist") + assert.Equal(t, "if-body", submitConfig["footer"], "Footer should be in submit handler config") + + // create_pull_request_review_comment should NOT have footer reviewCommentConfig, ok := handlerConfig["create_pull_request_review_comment"].(map[string]any) require.True(t, ok, "create_pull_request_review_comment config should exist") - assert.Equal(t, "if-body", reviewCommentConfig["footer"], "Footer should be in handler config") + _, hasFooter := reviewCommentConfig["footer"] + assert.False(t, hasFooter, "Footer should not be in review comment handler config") } } } @@ -140,9 +201,8 @@ func TestPRReviewCommentFooterInHandlerConfig(t *testing.T) { workflowData := &WorkflowData{ Name: "Test", SafeOutputs: &SafeOutputsConfig{ - CreatePullRequestReviewComments: &CreatePullRequestReviewCommentsConfig{ - BaseSafeOutputConfig: BaseSafeOutputConfig{Max: 10}, - Side: "RIGHT", + SubmitPullRequestReview: &SubmitPullRequestReviewConfig{ + BaseSafeOutputConfig: BaseSafeOutputConfig{Max: 1}, }, }, } @@ -165,9 +225,9 @@ func TestPRReviewCommentFooterInHandlerConfig(t *testing.T) { err := json.Unmarshal([]byte(jsonStr), &handlerConfig) require.NoError(t, err, "Should unmarshal handler config") - reviewCommentConfig, ok := handlerConfig["create_pull_request_review_comment"].(map[string]any) - require.True(t, ok, "create_pull_request_review_comment config should exist") - _, hasFooter := reviewCommentConfig["footer"] + submitConfig, ok := handlerConfig["submit_pull_request_review"].(map[string]any) + require.True(t, ok, "submit_pull_request_review config should exist") + _, hasFooter := submitConfig["footer"] assert.False(t, hasFooter, "Footer should not be in handler config when not set") } }