Skip to content

chore: remove dead functions (phase 9) — output job builders#19287

Merged
dsyme merged 4 commits intomainfrom
dc-9
Mar 3, 2026
Merged

chore: remove dead functions (phase 9) — output job builders#19287
dsyme merged 4 commits intomainfrom
dc-9

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Mar 3, 2026

Remove 8 dead buildCreateOutput*Job Compiler methods and 2 dead missing-data/tool builders (~480 LOC removed, 85→76 dead functions).

Functions removed:

  • Compiler.buildCreateOutputAddCommentJob (116 LOC, add_comment.go)
  • Compiler.buildCreateOutputDiscussionJob (78 LOC, create_discussion.go)
  • Compiler.buildCreateOutputCodeScanningAlertJob (73 LOC, create_code_scanning_alert.go)
  • Compiler.buildCreateOutputPullRequestReviewCommentJob (63 LOC, create_pr_review_comment.go)
  • Compiler.buildIssueReportingJob (61 LOC, missing_issue_reporting.go)
  • Compiler.buildCreateOutputAgentSessionJob (53 LOC, create_agent_session.go)
  • Compiler.buildCreateOutputMissingDataJob (17 LOC, missing_data.go)
  • Compiler.buildCreateOutputMissingToolJob (17 LOC, missing_tool.go)

Test changes: deleted add_comment_dependencies_test.go; removed dead test functions from create_agent_session_test.go, create_discussion_dependencies_test.go, missing_data_test.go, missing_tool_test.go, security_reports_test.go, safe_output_refactor_test.go.

Copilot AI review requested due to automatic review settings March 3, 2026 00:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes dead safe-output “output job builder” methods from the workflow compiler (and associated tests), continuing the deadcode cleanup plan.

Changes:

  • Deleted several unused Compiler.buildCreateOutput*Job methods (comments/discussions/code-scanning/PR review comments/agent session) plus missing-data/tool job builders.
  • Removed tests that exclusively covered those dead builders (including deleting add_comment_dependencies_test.go).
  • Updated DEADCODE.md planning/tracking content and extended .serena/project.yml configuration.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/security_reports_test.go Removes tests/imports tied to the deleted code-scanning-alert job builder.
pkg/workflow/safe_output_refactor_test.go Drops helper-usage tests that depended on removed standalone builders.
pkg/workflow/missing_tool_test.go Removes job-construction assertions for the deleted missing-tool job builder.
pkg/workflow/missing_tool.go Deletes buildCreateOutputMissingToolJob, leaving config parsing intact.
pkg/workflow/missing_issue_reporting.go Deletes shared job builder + helper (envVarPrefix) used only by removed code.
pkg/workflow/missing_data_test.go Removes tests for the deleted missing-data job builder.
pkg/workflow/missing_data.go Deletes buildCreateOutputMissingDataJob, leaving config parsing intact.
pkg/workflow/create_pr_review_comment.go Deletes dead PR review comment job builder, keeps config parsing.
pkg/workflow/create_discussion_dependencies_test.go Removes job dependency test for deleted discussion job builder.
pkg/workflow/create_discussion.go Deletes dead discussion job builder, keeps config parsing + helpers.
pkg/workflow/create_code_scanning_alert.go Deletes dead code-scanning-alert job builder, keeps config parsing.
pkg/workflow/create_agent_session_test.go Removes tests for the deleted agent session job builder.
pkg/workflow/create_agent_session.go Deletes dead agent session job builder, keeps config parsing.
pkg/workflow/add_comment_dependencies_test.go Deleted file; it only tested the removed add-comment job builder.
pkg/workflow/add_comment.go Deletes dead add-comment job builder, keeps config parsing + permissions helper.
DEADCODE.md Updates deadcode plan content (needs tracker accuracy tweaks per comments).
.serena/project.yml Adds optional Serena config keys (symbol_info_budget, language_backend).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +47 to +55
## Batch plan (85 dead functions as of 2026-03-02, after phases 5–8)

Batches 1–4 have been completed. The original batches 5–16 are superseded by this plan;
many of those functions were removed during prior work, and the remainder (plus newly
discovered dead code) are redistributed below into 30 focused phases.
Phases 5–8 are complete. The original phases 9–34 are superseded by this revised plan,
which groups work by domain, includes LOC estimates, and skips functions too small to
be worth the disruption.

Each phase: delete the dead functions, delete tests that exclusively test them,
run verification, commit, open PR.
run verification, commit, open PR. Branches are stacked: dc-9 based on dc-8, dc-10
based on dc-9, etc.
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

DEADCODE.md is now out of date for this PR: it still says “85 dead functions … after phases 5–8” and “Phases 5–8 are complete”, but this PR is phase 9 and removes additional dead functions (per PR description 85→76). Please update this header/blurb to reflect the post-phase-9 count/status (or explicitly note that the counts are pre-phase-9 if that’s intentional).

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +75
**Not worth deleting (< 10 lines, isolated):**
`envVarPrefix` (2), `GenerateSafeInputGoToolScriptForInspector` (2), `MapToolConfig.GetAny` (3),
`HasErrors` (5), `extractMapFromFrontmatter` (5), `GetDefaultMaxForType` (5),
`GetValidationConfigForType` (6), `getPlaywrightMCPPackageVersion` (6), `RunGit` (6),
`ExecGHWithOutput` (7), `convertGoPatternToJavaScript` (7), `ValidateExpressionSafetyPublic` (7),
`IsSafeInputsHTTPMode` (7), `HasSafeJobsEnabled` (7), `renderSafeOutputsMCPConfig` (8),
`renderPlaywrightMCPConfig` (8), `SecurityFinding.String` (8), `GetAllEngines` (11)
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This “Not worth deleting” list still includes envVarPrefix, but envVarPrefix was deleted in this PR (and no longer exists in the Go codebase). Please remove it from the list (or replace with another still-present skipped function) so the tracker remains accurate.

Copilot uses AI. Check for mistakes.
@dsyme dsyme merged commit 289a8b5 into main Mar 3, 2026
88 checks passed
@dsyme dsyme deleted the dc-9 branch March 3, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants