[dead-code] chore: remove dead functions — 2 functions removed#22175
Merged
[dead-code] chore: remove dead functions — 2 functions removed#22175
Conversation
- Remove Compiler.generateUnifiedPromptStep (pkg/workflow/unified_prompt_step.go) - Remove Compiler.GetSharedActionResolverForTest (pkg/workflow/compiler_types.go) - Delete exclusive test functions that tested the removed functions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes dead/unreachable workflow compiler functions identified by deadcode, along with the tests that only exercised those removed paths.
Changes:
- Removed
Compiler.generateUnifiedPromptStepand its direct unit tests. - Removed
Compiler.GetSharedActionResolverForTestand a CLI test that depended on it. - Cleaned up affected test files/imports accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/unified_prompt_step.go | Deletes the dead generateUnifiedPromptStep implementation. |
| pkg/workflow/unified_prompt_step_test.go | Removes tests that exclusively covered the deleted method; keeps tests for remaining helpers/section collection. |
| pkg/workflow/safe_outputs_default_create_issue_test.go | Removes a test that depended on the deleted unified prompt generator; drops now-unused import. |
| pkg/workflow/prompts_test.go | Removes safe-outputs prompt tests that called the deleted unified prompt generator. |
| pkg/workflow/compiler_types.go | Removes exported test-only helper GetSharedActionResolverForTest. |
| pkg/cli/compile_force_refresh_action_pins_test.go | Removes a test that depended on the exported test-only helper and cleans up imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 unreachable Go functions identified by the
deadcodestatic analyzer.Functions Removed
Compiler.generateUnifiedPromptSteppkg/workflow/unified_prompt_step.goCompiler.GetSharedActionResolverForTestpkg/workflow/compiler_types.goTests Removed
The following test functions exclusively tested the removed functions and were deleted:
TestGenerateUnifiedPromptStep_AllSections(unified_prompt_step_test.go)TestGenerateUnifiedPromptStep_MinimalSections(unified_prompt_step_test.go)TestGenerateUnifiedPromptStep_TrialMode(unified_prompt_step_test.go)TestGenerateUnifiedPromptStep_PRContext(unified_prompt_step_test.go)TestGenerateUnifiedPromptStep_NoSections(unified_prompt_step_test.go)TestGenerateUnifiedPromptStep_EnvVarsSorted(unified_prompt_step_test.go)TestAutoInjectedCreateIssuePrompt(safe_outputs_default_create_issue_test.go)TestGenerateSafeOutputsPromptStep_IncludesWhenEnabled(prompts_test.go)TestGenerateSafeOutputsPromptStep_SkippedWhenDisabled(prompts_test.go)TestSafeOutputsPrompt_IncludesPerToolInstructions(prompts_test.go)TestSafeOutputsPrompt_AlwaysIncludesNoop(prompts_test.go)TestForceRefreshActionPins_ClearCache(compile_force_refresh_action_pins_test.go)Note:
collectPromptSections,normalizeLeadingWhitespace, andremoveConsecutiveEmptyLines(also inunified_prompt_step.go) were not removed — they are still called from production code (compiler_yaml.go).Verification
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/23385356391