Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/smoke-goose.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion pkg/workflow/behavior_defined_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,24 @@ func (e *BehaviorDefinedEngine) GetSecretValidationStep(workflowData *WorkflowDa

func (e *BehaviorDefinedEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep {
behavior := e.behavior()
if behavior == nil || behavior.Installation == nil {
if behavior == nil {
return nil
}
if workflowData != nil && workflowData.EngineConfig != nil && workflowData.EngineConfig.Command != "" {
return nil
}

// Behavior-defined engines that execute via a harness script (e.g. Goose) run the
// harness through Node.js, so Node.js (and, when the firewall is enabled, the AWF
// binary) must always be installed even when no package-manager based installation
// is declared for the engine's CLI itself.
if behavior.Installation == nil {

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.

Missing test coverage for the new Installation == nil && HarnessScript != "" branch, and the generated smoke-goose.lock.yml wasn't recompiled/committed in this PR (per the PR's own checklist) β€” the fix is unverified end-to-end.

πŸ’‘ Why this matters

This branch changes behavior for every harness-script engine without an explicit installation: block (Goose today, potentially others later). Without a unit test asserting GetInstallationSteps returns Node.js (+ AWF when firewall enabled) for such a config, a future refactor could silently regress this exact bug. Also, since make recompile wasn't run, the actual generated .lock.yml for smoke-goose still lacks the fix β€” so the described root cause is not actually resolved in this PR's committed artifacts, only in source.

Suggested fix: add a test in behavior_defined_engine_harness_test.go similar to newHarnessEngineDefinition() but with Installation: nil, asserting GetInstallationSteps returns Node.js setup (+AWF when firewall enabled), and run/commit make recompile output for smoke-goose.lock.yml.

if behavior.HarnessScript == "" {
return nil
}
return BuildNpmEngineInstallStepsWithAWF([]GitHubActionStep{GenerateNodeJsSetupStep()}, workflowData)
Comment on lines +158 to +162

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.

[/tdd] The new harness-script installation path lacks a regression test β€” without one, a future refactor could silently break Goose (and similar harness-only engines) again.

πŸ’‘ Suggested test skeleton

Add two tests in behavior_defined_engine_harness_test.go:

  1. Harness engine, no installation: block β†’ GetInstallationSteps must return non-empty steps (Node.js setup).
  2. Non-harness engine, no installation: block β†’ GetInstallationSteps must return nil.

The /diagnosing-bugs skill stresses that every root-cause fix needs a regression test to prevent the same symptom recurring silently.

@copilot please address this.

}

install := behavior.Installation
if install.PackageManager != "npm" {
return nil
Expand Down
Loading