Skip to content

[dead-code] chore: remove dead functions — 1 function removed#30843

Merged
pelikhan merged 1 commit intomainfrom
chore/remove-dead-code-validatePiEngineRequirements-d10a779a794efd31
May 7, 2026
Merged

[dead-code] chore: remove dead functions — 1 function removed#30843
pelikhan merged 1 commit intomainfrom
chore/remove-dead-code-validatePiEngineRequirements-d10a779a794efd31

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 7, 2026

Dead Code Removal

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

Functions Removed

Function File
Compiler.validatePiEngineRequirements pkg/workflow/engine_validation.go

Tests Removed

  • pkg/workflow/pi_validation_test.go — exclusively tested validatePiEngineRequirements

Verification

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

Dead Function Count

  • Before this batch: 7 functions (2 WASM-live, 3 WASM-live option funcs)
  • Removed in this PR: 1 function
  • Remaining: ~6 functions

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

Generated by Dead Code Removal Agent · ● 10.2M ·

  • expires on May 10, 2026, 3:14 PM UTC

Remove validatePiEngineRequirements which is only reachable from
CompileToYAML, itself unreachable from any production entry point.
Also remove its exclusive test file pi_validation_test.go and the
dead call site in compiler_string_api.go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 7, 2026 17:34
Copilot AI review requested due to automatic review settings May 7, 2026 17:34
@pelikhan pelikhan merged commit 5ad61d8 into main May 7, 2026
20 checks passed
@pelikhan pelikhan deleted the chore/remove-dead-code-validatePiEngineRequirements-d10a779a794efd31 branch May 7, 2026 17:34
@github-actions github-actions Bot mentioned this pull request May 7, 2026
Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /zoom-out — appropriate for a cleanup/dead-code removal PR.

What was reviewed

This PR removes validatePiEngineRequirements: the implementation in engine_validation.go, its call site in compiler_string_api.go, and the corresponding test file pi_validation_test.go.

Assessment

  • Clean and complete removal — all three touch points (call site, implementation, tests) are removed together, leaving no dangling references.
  • Tests deleted with the code — the pi_validation_test.go file is correctly removed; keeping dead tests would be misleading.
  • No collateral damage — the surrounding validation chain in ParseWorkflowString is intact and unaffected.
  • DEADCODE.md pattern — consistent with the project's convention of tracking and pruning dead code.

Verdict

No issues found. This is a straightforward, well-scoped dead-code removal. Approving.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · ● 1.2M

Copy link
Copy Markdown
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

Removes Pi-engine-specific compile-time validation code and its dedicated unit tests as part of a dead-code cleanup pass.

Changes:

  • Removed Compiler.validatePiEngineRequirements from pkg/workflow/engine_validation.go.
  • Removed the ParseWorkflowString invocation of that validation from pkg/workflow/compiler_string_api.go.
  • Deleted pkg/workflow/pi_validation_test.go, which exclusively tested the removed function.
Show a summary per file
File Description
pkg/workflow/compiler_string_api.go Removes the Pi engine requirements validation step from the string-based parsing pipeline.
pkg/workflow/engine_validation.go Deletes the validatePiEngineRequirements helper implementation and its error messages.
pkg/workflow/pi_validation_test.go Removes unit tests that covered only the deleted Pi validation helper.

Copilot's findings

Tip

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

Comments suppressed due to low confidence (1)

pkg/workflow/compiler_string_api.go:151

  • Removing the Pi engine requirement validation here changes ParseWorkflowString behavior (Wasm/browser path) to no longer emit a clear compile-time error when engine: pi is used without tools.github.mode: gh-proxy and tools.cli-proxy: true. If those requirements are still intended, consider keeping this validation (or moving it into the shared validation pipeline so file-based compilation and string-based compilation behave consistently). If they’re no longer required, please update the Pi engine docs/comments that still state they are enforced at compile time (e.g., pkg/workflow/pi_engine.go mentions validatePiEngineRequirements).
	// Validate GitHub tool configuration
	if err := validateGitHubToolConfig(workflowData.ParsedTools, workflowData.Name); err != nil {
		return nil, fmt.Errorf("%s: %w", cleanPath, err)
	}
  • Files reviewed: 3/3 changed files
  • Comments generated: 0

Sign up for free to 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