Skip to content

Commit 5ad61d8

Browse files
chore: remove dead functions — 1 function removed (#30843)
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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ac7efd commit 5ad61d8

3 files changed

Lines changed: 0 additions & 124 deletions

File tree

pkg/workflow/compiler_string_api.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,6 @@ func (c *Compiler) ParseWorkflowString(content string, virtualPath string) (*Wor
145145
return nil, fmt.Errorf("%s: %w", cleanPath, err)
146146
}
147147

148-
// Validate Pi engine requirements (gh-proxy + cli-proxy).
149-
if err := c.validatePiEngineRequirements(workflowData); err != nil {
150-
return nil, fmt.Errorf("%s: %w", cleanPath, err)
151-
}
152-
153148
// Validate GitHub tool configuration
154149
if err := validateGitHubToolConfig(workflowData.ParsedTools, workflowData.Name); err != nil {
155150
return nil, fmt.Errorf("%s: %w", cleanPath, err)

pkg/workflow/engine_validation.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -365,41 +365,6 @@ func (c *Compiler) validateSingleEngineSpecification(mainEngineSetting string, i
365365
return "", fmt.Errorf("invalid engine configuration in included file, missing or invalid 'id' field. Expected string, object with 'id' field, or inline definition with 'runtime.id'.\n\nExample (string):\nengine: copilot\n\nExample (object with id):\nengine:\n id: copilot\n model: gpt-4\n\nExample (inline runtime definition):\nengine:\n runtime:\n id: codex\n\nSee: %s", constants.DocsEnginesURL)
366366
}
367367

368-
// validatePiEngineRequirements validates that workflows using the Pi engine have
369-
// the required configuration: gh-proxy mode and CLI proxy must both be enabled.
370-
//
371-
// Pi's API integration requires:
372-
// - tools.github.mode: gh-proxy — the pre-authenticated gh CLI must be available
373-
// - tools.cli-proxy: true — MCP servers must be mounted as CLI tools on PATH
374-
//
375-
// This requirement cannot be relaxed; the Pi engine communicates with GitHub via
376-
// the gh CLI rather than the GitHub MCP protocol.
377-
func (c *Compiler) validatePiEngineRequirements(workflowData *WorkflowData) error {
378-
if workflowData.EngineConfig == nil || workflowData.EngineConfig.ID != string(constants.PiEngine) {
379-
return nil
380-
}
381-
382-
engineValidationLog.Print("Validating Pi engine requirements: gh-proxy and cli-proxy")
383-
384-
ghProxyEnabled := isGitHubCLIModeEnabled(workflowData)
385-
cliProxyEnabled := workflowData.ParsedTools != nil && workflowData.ParsedTools.CLIProxy
386-
387-
if !ghProxyEnabled && !cliProxyEnabled {
388-
return fmt.Errorf("the Pi engine requires gh-proxy and CLI proxy to be enabled.\n\nAdd the following to your workflow frontmatter:\n\n tools:\n github:\n mode: gh-proxy\n cli-proxy: true\n\nSee: %s", constants.DocsEnginesURL)
389-
}
390-
391-
if !ghProxyEnabled {
392-
return fmt.Errorf("the Pi engine requires gh-proxy to be enabled.\n\nAdd the following to your workflow frontmatter:\n\n tools:\n github:\n mode: gh-proxy\n\nSee: %s", constants.DocsEnginesURL)
393-
}
394-
395-
if !cliProxyEnabled {
396-
return fmt.Errorf("the Pi engine requires CLI proxy to be enabled.\n\nAdd the following to your workflow frontmatter:\n\n tools:\n cli-proxy: true\n\nSee: %s", constants.DocsEnginesURL)
397-
}
398-
399-
engineValidationLog.Print("Pi engine requirements satisfied: gh-proxy and cli-proxy are enabled")
400-
return nil
401-
}
402-
403368
// EngineHasValidateSecretStep checks if the engine provides a validate-secret step.
404369
// This is used to determine whether the secret_verification_result job output should be added.
405370
//

pkg/workflow/pi_validation_test.go

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)