[dead-code] chore: remove dead functions — 9 functions removed#20101
Merged
[dead-code] chore: remove dead functions — 9 functions removed#20101
Conversation
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>
Contributor
There was a problem hiding this comment.
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 useextractSafeInputsConfig(the surviving method) instead of the now-deletedParseSafeInputsstandalone function
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/mcp_config_builtin.go |
Removes renderSafeOutputsMCPConfig (dead wrapper for renderSafeOutputsMCPConfigWithOptions) |
pkg/workflow/mcp_config_custom.go |
Removes renderCustomMCPConfigWrapper (dead wrapper; context-aware version remains) |
pkg/workflow/mcp_config_playwright_renderer.go |
Removes renderPlaywrightMCPConfig (dead wrapper for renderPlaywrightMCPConfigWithOptions) |
pkg/workflow/mcp_config_validation.go |
Removes getTypeString (dead helper) |
pkg/workflow/mcp_playwright_config.go |
Removes generatePlaywrightDockerArgs (dead Docker args factory) |
pkg/workflow/repo_memory.go |
Removes generateRepoMemoryPushSteps (dead push step generator) |
pkg/workflow/safe_inputs_generator.go |
Removes GenerateSafeInputGoToolScriptForInspector (dead public wrapper; private impl remains) |
pkg/workflow/safe_inputs_parser.go |
Removes ParseSafeInputs (dead standalone function) and IsSafeInputsHTTPMode |
pkg/workflow/safe_inputs_renderer.go |
Removes getSafeInputsEnvVars (dead env-var collector) |
pkg/workflow/mcp_config_shared_test.go |
Removes tests for renderSafeOutputsMCPConfig and renderCustomMCPConfigWrapper |
pkg/workflow/mcp_config_utils_test.go |
Removes TestGetTypeString |
pkg/workflow/mcp_benchmark_test.go |
Removes benchmarks for deleted Playwright functions |
pkg/workflow/repo_memory_test.go |
Removes TestRepoMemoryPushStepsGeneration |
pkg/workflow/safe_inputs_parser_test.go |
Removes tests for ParseSafeInputs; leaves orphaned comment |
pkg/workflow/safe_inputs_renderer_test.go |
Removes tests for getSafeInputsEnvVars |
pkg/workflow/safe_inputs_timeout_test.go |
Updates 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dead Code Removal
This PR removes 9 unreachable Go functions identified by the
deadcodestatic analyzer, which are unreachable from all production binary entry points.Functions Removed
renderSafeOutputsMCPConfigpkg/workflow/mcp_config_builtin.gorenderCustomMCPConfigWrapperpkg/workflow/mcp_config_custom.gorenderPlaywrightMCPConfigpkg/workflow/mcp_config_playwright_renderer.gogetTypeStringpkg/workflow/mcp_config_validation.gogeneratePlaywrightDockerArgspkg/workflow/mcp_playwright_config.gogenerateRepoMemoryPushStepspkg/workflow/repo_memory.goGenerateSafeInputGoToolScriptForInspectorpkg/workflow/safe_inputs_generator.goIsSafeInputsHTTPModepkg/workflow/safe_inputs_parser.gogetSafeInputsEnvVarspkg/workflow/safe_inputs_renderer.goTests Removed
Removed 11 test-only functions that exclusively tested the deleted functions:
TestRenderSafeOutputsMCPConfigSharedTestRenderCustomMCPConfigWrapperSharedBenchmarkRenderPlaywrightMCPConfigBenchmarkGeneratePlaywrightDockerArgsBenchmarkRenderPlaywrightMCPConfig_ComplexTestGetTypeStringTestGetSafeInputsEnvVarsTestGetSafeInputsEnvVarsStabilityTestRepoMemoryPushStepsGenerationTestParseSafeInputsTestParseSafeInputsAndExtractSafeInputsConfigConsistencyVerification
go build ./...— passesgo vet ./...— passesgo vet -tags=integration ./...— passesmake fmt— no changes neededDead Function Count
Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/22826569281