Skip to content

Centralize safe-output footer configuration - #54703

Open
pelikhan with Copilot wants to merge 5 commits into
mainfrom
copilot/deep-report-extend-base-safe-output-config
Open

Centralize safe-output footer configuration#54703
pelikhan with Copilot wants to merge 5 commits into
mainfrom
copilot/deep-report-extend-base-safe-output-config

Conversation

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Footer was duplicated across 11 safe-output configuration types despite their shared BaseSafeOutputConfig. This leaves footer behavior prone to per-handler drift.

  • Shared configuration

    • Add Footer *string to BaseSafeOutputConfig.
    • Preserve handler-specific footer parsing and serialization behavior.
  • Duplicate removal

    • Remove local Footer declarations from create, update, review, comment, and memory safe-output configs.
  • Coverage

    • Update config-construction tests to initialize the embedded base field.
type BaseSafeOutputConfig struct {
    // ...
    Footer *string `yaml:"footer,omitempty"`
}

type CreateIssuesConfig struct {
    BaseSafeOutputConfig `yaml:",inline"`
    // Footer is promoted from the shared base.
}

Copilot AI and others added 2 commits August 22, 2026 03:08
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend BaseSafeOutputConfig to include Footer field in structs Centralize safe-output footer configuration Aug 22, 2026
Copilot AI requested a review from pelikhan August 22, 2026 03:12
@pelikhan
pelikhan marked this pull request as ready for review August 22, 2026 03:12
Copilot AI balanced review requested due to automatic review settings August 22, 2026 03:12
@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #54703

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-22T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable changed-line regressions found
  - footer field centralized onto BaseSafeOutputConfig
files_reviewed:
  - pkg/workflow/add_comment.go
  - pkg/workflow/comment_memory.go
  - pkg/workflow/comment_memory_config_test.go
  - pkg/workflow/create_discussion.go
  - pkg/workflow/create_issue.go
  - pkg/workflow/create_pull_request.go
  - pkg/workflow/reply_to_pr_review_comment.go
  - pkg/workflow/safe_outputs_config_generation_test.go
  - pkg/workflow/safe_outputs_config_types.go
  - pkg/workflow/safe_outputs_footer_test.go
  - pkg/workflow/submit_pr_review.go
  - pkg/workflow/submit_pr_review_footer_test.go
  - pkg/workflow/update_discussion.go
  - pkg/workflow/update_issue.go
  - pkg/workflow/update_pull_request.go
  - pkg/workflow/update_release.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 31.3 AIC · ⌖ 6.76 AIC · ⊞ 4.6K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot mentioned this pull request Aug 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Centralizes per-handler footer configuration in BaseSafeOutputConfig.

Changes:

  • Adds the shared Footer field.
  • 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 *string is now shared in BaseSafeOutputConfig, but the acceptable values differ by handler ("true"/"false" for most; "always"/"none"/"if-body" for submit_pr_review). The current comment "Values vary by handler" is a breadcrumb, not documentation.

  • Parsing not centralized to match the field: parseBaseSafeOutputConfig centralizes max, staged, etc., but footer parsing stays per-handler. A new handler could declare Footer via 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.go alignment-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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot This PR still needs forward progress before maintainer review.

  • Current head still has failing checks: impacted-go-tests, lint-go-custom, and Unit tests (M-R).
  • Please address the failing checks on the current head, refresh the branch if needed, and run the pr-finisher skill before handing back.
  • Leave a concise maintainer handoff with exact validations rerun and any remaining human follow-up.

Run: https://github.com/github/gh-aw/actions/runs/32554681386

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.9 AIC · ⌖ 8.23 AIC · ⊞ 9.5K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot This PR still needs forward progress before maintainer review.

  • Current head still has failing checks: impacted-go-tests, lint-go-custom, and Unit tests (M-R)....

Addressed in f79b365.

Root cause of Unit tests (M-R): moving Footer into BaseSafeOutputConfig made the update-entity field specs write through the promoted base field, which setUpdateEntityConfig(*baseConfig) then overwrote with nil. TestParseUpdateEntityConfigTypedBaseConfigAssignment failed for update-issue/discussion/pull-request/release. Fixed by adding an AfterBaseParse hook to UpdateEntityParseOptions so parseUpdateEntityConfigTyped copies the base config into the entity struct before entity-specific fields are parsed.

Validations rerun locally:

  • go build ./... — clean
  • go test ./pkg/workflow/ -count=1 — pass (33s, includes the previously failing test)
  • make fmt
  • make agent-report-progress-no-test — no custom-linter findings in the changed file

Remaining human follow-up: impacted-go-tests and lint-go-custom failed on the previous head with unable to determine merge-base from BASE_REF=origin/main; the lint job then fell back to linting all Go files and reported pre-existing errormessage findings in pkg/cli (workflows.go, yamllint.go, zizmor.go, …) that are unrelated to this PR. That is a checkout/merge-base issue in CI, not a code change here — a re-run with origin/main available should scope both jobs back to the changed files.

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: refactor
  • Risk: medium
  • Priority score: 35/100 (impact 10, urgency 10, quality 15)
  • Recommended action: batch_review
  • CI status: no_checks
  • Batch: batch-1

Generated by 🔧 PR Triage Agent · auto · 82.9 AIC · ⌖ 6.65 AIC · ⊞ 8.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: refactor | Risk: medium | Priority: medium | Score: 45/100
Recommended action: batch_review

Centralizes safe-output footer config (batch-1). CI 2 failures, APPROVED.

Automated triage — run 32572524009

Generated by 🔧 PR Triage Agent · auto · 65.4 AIC · ⌖ 6.04 AIC · ⊞ 8.3K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Extend BaseSafeOutputConfig to cover the duplicated Footer field (11 structs)

4 participants