Skip to content

[dead-code] chore: remove dead functions — 5 functions removed - #25630

Merged
pelikhan merged 1 commit into
mainfrom
dead-code/remove-batch-2026-04-10-c23281e6364f2d0e
Apr 10, 2026
Merged

[dead-code] chore: remove dead functions — 5 functions removed#25630
pelikhan merged 1 commit into
mainfrom
dead-code/remove-batch-2026-04-10-c23281e6364f2d0e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Dead Code Removal

This PR removes unreachable Go functions identified by the deadcode static analyzer.

Functions Removed

FunctionFile
estimateTokenspkg/cli/mcp_logs_guardrail.go
WithSafeUpdatepkg/workflow/compiler_types.go
WithPriorManifestpkg/workflow/compiler_types.go
Compiler.SetPriorManifestpkg/workflow/compiler_types.go
marshalStringSliceJSONpkg/workflow/publish_artifacts.go

Tests Removed

  • TestEstimateTokens — exclusively tested the deleted estimateTokens function
  • TestMarshalStringSliceJSON — exclusively tested the deleted marshalStringSliceJSON function

Verification

  • go build ./... — passes
  • go vet ./... — passes
  • go vet -tags=integration ./... — passes
  • make fmt — no changes needed

Dead Function Count

  • Before this batch: ~11 functions (excluding previously cached)
  • Removed in this PR: 5 functions
  • Remaining: ~6 functions (3 are WASM-live: WithSkipValidation, WithNoEmit, WithWorkflowIdentifier; CompileToYAML/ParseWorkflowString confirmed WASM-live)

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

Generated by Dead Code Removal Agent · ● 1.9M ·

  • expires on Apr 13, 2026, 12:11 PM UTC

Remove unreachable functions identified by the deadcode static analyzer:
- estimateTokens (pkg/cli/mcp_logs_guardrail.go)
- WithSafeUpdate (pkg/workflow/compiler_types.go)
- WithPriorManifest (pkg/workflow/compiler_types.go)
- Compiler.SetPriorManifest (pkg/workflow/compiler_types.go)
- marshalStringSliceJSON (pkg/workflow/publish_artifacts.go)
Also remove exclusive test functions TestEstimateTokens and
TestMarshalStringSliceJSON that only tested the deleted functions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review April 10, 2026 12:27
CopilotAI review requested due to automatic review settings April 10, 2026 12:27

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

Removes unreachable Go helpers and their now-obsolete unit tests as identified by the deadcode analyzer.

Changes:

  • Deleted unused helper functions in pkg/cli and pkg/workflow.
  • Removed now-unused imports resulting from the deletions.
  • Removed unit tests that exclusively exercised the deleted helpers.
Show a summary per file
FileDescription
pkg/workflow/publish_artifacts.goRemoves unused JSON helper and corresponding import.
pkg/workflow/publish_artifacts_test.goRemoves test that only covered the deleted helper.
pkg/workflow/compiler_types.goRemoves unused functional options / method related to prior manifests and safe-update option wiring.
pkg/cli/mcp_logs_guardrail.goRemoves unused token estimation helper.
pkg/cli/mcp_logs_guardrail_test.goRemoves test that only covered the deleted token estimation helper.

Copilot's findings

Tip

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

  • Files reviewed: 5/5 changed files
  • Comments generated: 0

@github-actionsgithub-actionsBot mentioned this pull request Apr 10, 2026
@pelikhan
pelikhan merged commit a8dedce into mainApr 10, 2026
79 checks passed
@pelikhan
pelikhan deleted the dead-code/remove-batch-2026-04-10-c23281e6364f2d0e branch April 10, 2026 12: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

@pelikhan