Centralize safe-output footer configuration#54703
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (60 additions detected).
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ PR Code Quality Reviewer completed the code quality review. Reviewed PR #54703; no actionable changed-line issues found, so no review comments or blocking review were submitted.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Clean, consistent refactor. Moving Footer *string from ~10 individual handler config structs into BaseSafeOutputConfig eliminates duplication and ensures any new handler automatically inherits footer control. All tests updated correctly; promotion through embedded struct chains is idiomatic Go.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 43.1 AIC · ⌖ 8.94 AIC · ⊞ 6.2K
There was a problem hiding this comment.
Pull request overview
Centralizes per-handler footer configuration in BaseSafeOutputConfig.
Changes:
- Adds the shared
Footerfield. - Removes 11 duplicate declarations.
- Updates affected test fixtures.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/safe_outputs_config_types.go |
Adds the shared footer field. |
pkg/workflow/create_issue.go |
Uses the promoted footer field. |
pkg/workflow/create_discussion.go |
Uses the promoted footer field. |
pkg/workflow/create_pull_request.go |
Uses the promoted footer field. |
pkg/workflow/add_comment.go |
Uses the promoted footer field. |
pkg/workflow/comment_memory.go |
Uses the promoted footer field. |
pkg/workflow/reply_to_pr_review_comment.go |
Uses the promoted footer field. |
pkg/workflow/submit_pr_review.go |
Uses the promoted footer field. |
pkg/workflow/update_issue.go |
Uses the promoted footer field. |
pkg/workflow/update_discussion.go |
Uses the promoted footer field. |
pkg/workflow/update_pull_request.go |
Uses the promoted footer field. |
pkg/workflow/update_release.go |
Uses the promoted footer field. |
pkg/workflow/comment_memory_config_test.go |
Updates embedded-base construction. |
pkg/workflow/safe_outputs_config_generation_test.go |
Updates reply configuration construction. |
pkg/workflow/safe_outputs_footer_test.go |
Updates issue configuration construction. |
pkg/workflow/submit_pr_review_footer_test.go |
Updates review configuration construction. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 16/16 changed files
- Comments generated: 1
- Review effort level: Balanced
| GitHubToken string `yaml:"github-token,omitempty"` // GitHub token for this specific output type | ||
| GitHubApp *GitHubAppConfig `yaml:"github-app,omitempty"` // GitHub App credentials for minting a per-handler installation access token | ||
| Staged *TemplatableBool `yaml:"staged,omitempty"` // Templatable preview-only mode for this specific output type | ||
| Footer *string `yaml:"footer,omitempty"` // Controls AI-generated footer behavior. Values vary by handler; false omits the visible footer but keeps XML markers. |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design — COMMENT: refactor is sound with two design notes.
📋 Key Themes & Highlights
Key Themes
-
Divergent value semantics hidden behind one field:
Footer *stringis now shared inBaseSafeOutputConfig, but the acceptable values differ by handler ("true"/"false"for most;"always"/"none"/"if-body"forsubmit_pr_review). The current comment "Values vary by handler" is a breadcrumb, not documentation. -
Parsing not centralized to match the field:
parseBaseSafeOutputConfigcentralizesmax,staged, etc., but footer parsing stays per-handler. A new handler could declareFootervia the base field and then simply forget to parse it — the YAML key would be silently ignored and the field would always be nil.
Positive Highlights
- ✅ Clean deduplication — removing 11 identical field declarations without any behavioral change is the right mechanical move.
- ✅ Test updates correctly reflect the new struct initialization shape.
- ✅
create_pull_request.goalignment-only reformatting is well-contained and doesn't risk merge conflicts.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 45.9 AIC · ⌖ 9.95 AIC · ⊞ 7.6K
Comment /matt to run again
| GitHubToken string `yaml:"github-token,omitempty"` // GitHub token for this specific output type | ||
| GitHubApp *GitHubAppConfig `yaml:"github-app,omitempty"` // GitHub App credentials for minting a per-handler installation access token | ||
| Staged *TemplatableBool `yaml:"staged,omitempty"` // Templatable preview-only mode for this specific output type | ||
| Footer *string `yaml:"footer,omitempty"` // Controls AI-generated footer behavior. Values vary by handler; false omits the visible footer but keeps XML markers. |
There was a problem hiding this comment.
[/codebase-design] The shared Footer field silently accommodates two incompatible value vocabularies: most handlers treat it as a templatable bool ("true"/"false"), while submit_pr_review accepts "always"/"none"/"if-body". The comment "Values vary by handler" flags this but doesn't document the semantic divergence — future authors reading only the base struct will have no signal that some handlers reject the bool semantics.
💡 Suggestion
Tighten the comment to explicitly name the special case:
// Controls AI-generated footer behavior.
// Most handlers: templatable bool — false omits the visible footer but keeps XML markers.
// Exception — submit-pull-request-review: "always" (default), "none", or "if-body".
Footer *string `yaml:"footer,omitempty"`This makes the divergence discoverable without needing to chase individual parsers.
@copilot please address this.
|
@copilot This PR still needs forward progress before maintainer review.
Run: https://github.com/github/gh-aw/actions/runs/32554681386
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed in f79b365. Root cause of Validations rerun locally:
Remaining human follow-up: |
PR Triage
|
PR TriageCategory: Centralizes safe-output footer config (batch-1). CI 2 failures, APPROVED. Automated triage — run 32572524009
|
Footerwas duplicated across 11 safe-output configuration types despite their sharedBaseSafeOutputConfig. This leaves footer behavior prone to per-handler drift.Shared configuration
Footer *stringtoBaseSafeOutputConfig.Duplicate removal
Footerdeclarations from create, update, review, comment, and memory safe-output configs.Coverage