Skip to content

[dead-code] chore: remove dead functions — 9 functions removed - #20101

Merged
dsyme merged 2 commits into
mainfrom
dead-code-removal-9523801ae2a8899f
Mar 8, 2026
Merged

[dead-code] chore: remove dead functions — 9 functions removed#20101
dsyme merged 2 commits into
mainfrom
dead-code-removal-9523801ae2a8899f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Dead Code Removal

This PR removes 9 unreachable Go functions identified by the deadcode static analyzer, which are unreachable from all production binary entry points.

Functions Removed

FunctionFile
renderSafeOutputsMCPConfigpkg/workflow/mcp_config_builtin.go
renderCustomMCPConfigWrapperpkg/workflow/mcp_config_custom.go
renderPlaywrightMCPConfigpkg/workflow/mcp_config_playwright_renderer.go
getTypeStringpkg/workflow/mcp_config_validation.go
generatePlaywrightDockerArgspkg/workflow/mcp_playwright_config.go
generateRepoMemoryPushStepspkg/workflow/repo_memory.go
GenerateSafeInputGoToolScriptForInspectorpkg/workflow/safe_inputs_generator.go
IsSafeInputsHTTPModepkg/workflow/safe_inputs_parser.go
getSafeInputsEnvVarspkg/workflow/safe_inputs_renderer.go

Tests Removed

Removed 11 test-only functions that exclusively tested the deleted functions:

  • TestRenderSafeOutputsMCPConfigShared
  • TestRenderCustomMCPConfigWrapperShared
  • BenchmarkRenderPlaywrightMCPConfig
  • BenchmarkGeneratePlaywrightDockerArgs
  • BenchmarkRenderPlaywrightMCPConfig_Complex
  • TestGetTypeString
  • TestGetSafeInputsEnvVars
  • TestGetSafeInputsEnvVarsStability
  • TestRepoMemoryPushStepsGeneration
  • TestParseSafeInputs
  • TestParseSafeInputsAndExtractSafeInputsConfigConsistency

Verification

  • go build ./... — passes
  • go vet ./... — passes
  • go vet -tags=integration ./... — passes
  • make fmt — no changes needed
  • ✅ All unit tests pass

Dead Function Count

  • Before this batch: ~42 functions
  • Removed in this PR: 9 functions
  • Remaining: ~33 functions

Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/22826569281

Generated by Dead Code Removal Agent ·

  • expires on Mar 11, 2026, 6:12 PM UTC

Deleted functions identified by deadcode analyzer as unreachable from production entry points.
Functions removed:
1. renderSafeOutputsMCPConfig (pkg/workflow/mcp_config_builtin.go)
2. renderCustomMCPConfigWrapper (pkg/workflow/mcp_config_custom.go)
3. renderPlaywrightMCPConfig (pkg/workflow/mcp_config_playwright_renderer.go)
4. getTypeString (pkg/workflow/mcp_config_validation.go)
5. generatePlaywrightDockerArgs (pkg/workflow/mcp_playwright_config.go)
6. generateRepoMemoryPushSteps (pkg/workflow/repo_memory.go)
7. GenerateSafeInputGoToolScriptForInspector (pkg/workflow/safe_inputs_generator.go)
8. IsSafeInputsHTTPMode (pkg/workflow/safe_inputs_parser.go)
9. getSafeInputsEnvVars (pkg/workflow/safe_inputs_renderer.go)
Also removed 11 test-only functions that exclusively tested the deleted functions.
Build verification: all tests pass, vet passes, fmt passes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review March 8, 2026 18:19
CopilotAI review requested due to automatic review settings March 8, 2026 18:19

CopilotAI 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

This PR removes 9 dead Go functions identified by the deadcode static analyzer as unreachable from all production binary entry points, along with 11 test functions that exclusively tested those deleted functions.

Changes:

  • Removes 9 unreachable production functions across 8 source files in pkg/workflow
  • Removes 11 test/benchmark functions from 7 test files that exclusively covered the deleted production functions
  • Updates one test (TestSafeInputsTimeoutParsing) to use extractSafeInputsConfig (the surviving method) instead of the now-deleted ParseSafeInputs standalone function

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
pkg/workflow/mcp_config_builtin.goRemoves renderSafeOutputsMCPConfig (dead wrapper for renderSafeOutputsMCPConfigWithOptions)
pkg/workflow/mcp_config_custom.goRemoves renderCustomMCPConfigWrapper (dead wrapper; context-aware version remains)
pkg/workflow/mcp_config_playwright_renderer.goRemoves renderPlaywrightMCPConfig (dead wrapper for renderPlaywrightMCPConfigWithOptions)
pkg/workflow/mcp_config_validation.goRemoves getTypeString (dead helper)
pkg/workflow/mcp_playwright_config.goRemoves generatePlaywrightDockerArgs (dead Docker args factory)
pkg/workflow/repo_memory.goRemoves generateRepoMemoryPushSteps (dead push step generator)
pkg/workflow/safe_inputs_generator.goRemoves GenerateSafeInputGoToolScriptForInspector (dead public wrapper; private impl remains)
pkg/workflow/safe_inputs_parser.goRemoves ParseSafeInputs (dead standalone function) and IsSafeInputsHTTPMode
pkg/workflow/safe_inputs_renderer.goRemoves getSafeInputsEnvVars (dead env-var collector)
pkg/workflow/mcp_config_shared_test.goRemoves tests for renderSafeOutputsMCPConfig and renderCustomMCPConfigWrapper
pkg/workflow/mcp_config_utils_test.goRemoves TestGetTypeString
pkg/workflow/mcp_benchmark_test.goRemoves benchmarks for deleted Playwright functions
pkg/workflow/repo_memory_test.goRemoves TestRepoMemoryPushStepsGeneration
pkg/workflow/safe_inputs_parser_test.goRemoves tests for ParseSafeInputs; leaves orphaned comment
pkg/workflow/safe_inputs_renderer_test.goRemoves tests for getSafeInputsEnvVars
pkg/workflow/safe_inputs_timeout_test.goUpdates test to use extractSafeInputsConfig instead of removed ParseSafeInputs

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

You can also share your feedback on Copilot code review. Take the survey.

Comment threadpkg/workflow/safe_inputs_parser_test.go
@dsyme
dsyme merged commit e43b634 into mainMar 8, 2026
51 checks passed
@dsyme
dsyme deleted the dead-code-removal-9523801ae2a8899f branch March 8, 2026 18:32
Sign up for freeto 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.

2 participants

@dsyme