diff --git a/Makefile b/Makefile index 066c70733b..a35dadbc15 100644 --- a/Makefile +++ b/Makefile @@ -449,24 +449,24 @@ fmt: fmt-go fmt-cjs fmt-json .PHONY: fmt-go fmt-go: - @GOPATH=$$(go env GOPATH); \ - if command -v golangci-lint >/dev/null 2>&1 || [ -x "$$GOPATH/bin/golangci-lint" ]; then \ - PATH="$$GOPATH/bin:$$PATH" golangci-lint fmt; \ - else \ - echo "golangci-lint is not installed. Run 'make deps-dev' to install dependencies."; \ - exit 1; \ - fi + @echo "→ Formatting Go code..." + @go fmt ./... + @echo "✓ Go code formatted" # Format JavaScript (.cjs and .js) and JSON files in actions/setup/js directory .PHONY: fmt-cjs fmt-cjs: - cd actions/setup/js && npm run format:cjs - npx prettier --write 'scripts/**/*.js' --ignore-path .prettierignore + @echo "→ Formatting JavaScript files..." + @cd actions/setup/js && npm run format:cjs + @npx prettier --write 'scripts/**/*.js' --ignore-path .prettierignore + @echo "✓ JavaScript files formatted" # Format JSON files in pkg directory (excluding actions/setup/js, which is handled by npm script) .PHONY: fmt-json fmt-json: - cd actions/setup/js && npm run format:pkg-json + @echo "→ Formatting JSON files..." + @cd actions/setup/js && npm run format:pkg-json + @echo "✓ JSON files formatted" # Check formatting .PHONY: fmt-check diff --git a/docs/src/content/docs/setup/quick-start.md b/docs/src/content/docs/setup/quick-start.md index 8db3a63f1d..56b57e97f8 100644 --- a/docs/src/content/docs/setup/quick-start.md +++ b/docs/src/content/docs/setup/quick-start.md @@ -17,13 +17,10 @@ There are hundreds of other ways to use GitHub Agentic Workflows, which you can Before installing, ensure you have: -- ✅ **AI Account** - You need one of the following: - - [GitHub Copilot](https://github.com/features/copilot) subscription - - [Anthropic Claude](https://www.anthropic.com/) API key (recommended for simple setup) - - [OpenAI Codex](https://openai.com/api/) API key -- ✅ **GitHub Repository** - a GitHub repository you are a maintainer on +- ✅ **AI Account** - A [GitHub Copilot](https://github.com/features/copilot) subscription, or a [Anthropic Claude](https://www.anthropic.com/) or [OpenAI Codex](https://openai.com/api/) API key +- ✅ **GitHub Repository** - a GitHub repository you are maintainer on - ✅ **GitHub Actions** enabled in your repository -- ✅ **GitHub CLI** (`gh`) - A command-line tool for GitHub. [Install here](https://cli.github.com) v2.0.0+ and authenticate with `gh auth login` +- ✅ **GitHub CLI** (`gh`) - A command-line tool for GitHub. [Install here](https://cli.github.com) v2.0.0+ - ✅ **Operating System**: Linux, macOS, or Windows with WSL ### Step 1 — Install the extension diff --git a/pkg/cli/add_workflow_compilation.go b/pkg/cli/add_workflow_compilation.go index cedefe9a81..416cab0001 100644 --- a/pkg/cli/add_workflow_compilation.go +++ b/pkg/cli/add_workflow_compilation.go @@ -36,8 +36,12 @@ func compileWorkflow(filePath string, verbose bool, quiet bool, engineOverride s // compileWorkflowWithRefresh compiles a workflow file with optional stop time refresh. // This function handles the compilation process and ensures .gitattributes is updated. func compileWorkflowWithRefresh(filePath string, verbose bool, quiet bool, engineOverride string, refreshStopTime bool) error { - // Create compiler and compile the workflow - compiler := workflow.NewCompiler(verbose, engineOverride, GetVersion()) + // Create compiler with auto-detected version and action mode + compiler := workflow.NewCompiler( + workflow.WithVerbose(verbose), + workflow.WithEngineOverride(engineOverride), + ) + compiler.SetRefreshStopTime(refreshStopTime) compiler.SetQuiet(quiet) if err := CompileWorkflowWithValidation(compiler, filePath, verbose, false, false, false, false, false); err != nil { @@ -100,8 +104,11 @@ func compileWorkflowWithTrackingAndRefresh(filePath string, verbose bool, quiet tracker.TrackCreated(gitAttributesPath) } - // Create compiler and set the file tracker - compiler := workflow.NewCompiler(verbose, engineOverride, GetVersion()) + // Create compiler with auto-detected version and action mode + compiler := workflow.NewCompiler( + workflow.WithVerbose(verbose), + workflow.WithEngineOverride(engineOverride), + ) compiler.SetFileTracker(tracker) compiler.SetRefreshStopTime(refreshStopTime) compiler.SetQuiet(quiet) diff --git a/pkg/cli/commands.go b/pkg/cli/commands.go index 2b5e0bf713..fc4c2ce07f 100644 --- a/pkg/cli/commands.go +++ b/pkg/cli/commands.go @@ -12,6 +12,7 @@ import ( "github.com/githubnext/gh-aw/pkg/console" "github.com/githubnext/gh-aw/pkg/constants" "github.com/githubnext/gh-aw/pkg/logger" + "github.com/githubnext/gh-aw/pkg/workflow" ) var commandsLog = logger.New("cli:commands") @@ -21,6 +22,12 @@ var ( version = "dev" ) +func init() { + // Set the default version in the workflow package + // This allows workflow.NewCompiler() to auto-detect the version + workflow.SetDefaultVersion(version) +} + //go:embed templates/github-agentic-workflows.md var copilotInstructionsTemplate string @@ -57,9 +64,10 @@ var campaignWorkflowExecutionTemplate string //go:embed templates/close-agentic-campaign.md var campaignClosingInstructionsTemplate string -// SetVersionInfo sets the version information for the CLI +// SetVersionInfo sets the version information for the CLI and workflow package func SetVersionInfo(v string) { version = v + workflow.SetDefaultVersion(v) // Keep workflow package in sync } // GetVersion returns the current version diff --git a/pkg/cli/commands_file_watching_test.go b/pkg/cli/commands_file_watching_test.go index 3d7ec990fa..30d0e5a664 100644 --- a/pkg/cli/commands_file_watching_test.go +++ b/pkg/cli/commands_file_watching_test.go @@ -25,7 +25,7 @@ func TestWatchAndCompileWorkflows(t *testing.T) { os.Chdir(tempDir) defer os.Chdir(oldDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() err := watchAndCompileWorkflows("", compiler, false) if err == nil { @@ -50,7 +50,7 @@ func TestWatchAndCompileWorkflows(t *testing.T) { t.Fatalf("Failed to init git repo: %v", initErr) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() err := watchAndCompileWorkflows("", compiler, false) if err == nil { @@ -77,7 +77,7 @@ func TestWatchAndCompileWorkflows(t *testing.T) { workflowsDir := filepath.Join(tempDir, ".github/workflows") os.MkdirAll(workflowsDir, 0755) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() err := watchAndCompileWorkflows("nonexistent.md", compiler, false) if err == nil { @@ -166,7 +166,7 @@ func TestCompileAllWorkflowFiles(t *testing.T) { } // Create a basic compiler - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() stats, err := compileAllWorkflowFiles(compiler, workflowsDir, true) if err != nil { @@ -213,7 +213,7 @@ func TestCompileAllWorkflowFiles(t *testing.T) { invalidContent := "---\nmalformed: yaml: content:\n - missing\n proper: structure\n---\n# Invalid\n\nThis should fail" os.WriteFile(invalidFile, []byte(invalidContent), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // This should not return an error (it prints errors but continues) stats, err := compileAllWorkflowFiles(compiler, workflowsDir, false) @@ -235,7 +235,7 @@ func TestCompileAllWorkflowFiles(t *testing.T) { content := "---\non: push\nengine: claude\n---\n# Verbose Test\n\nTest content for verbose mode" os.WriteFile(testFile, []byte(content), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Test verbose mode (should not error) stats, err := compileAllWorkflowFiles(compiler, workflowsDir, true) @@ -269,7 +269,7 @@ func TestCompileModifiedFiles(t *testing.T) { oldTime := time.Now().Add(-2 * time.Hour) os.Chtimes(file2, oldTime, oldTime) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Test with recent files - compileModifiedFiles takes a slice of files modifiedFiles := []string{file1} // Only include the recent file @@ -284,7 +284,7 @@ func TestCompileModifiedFiles(t *testing.T) { }) t.Run("compile modified files with no files", func(t *testing.T) { - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Test with empty file list (should not error) emptyFiles := []string{} @@ -293,7 +293,7 @@ func TestCompileModifiedFiles(t *testing.T) { }) t.Run("compile modified files with invalid files", func(t *testing.T) { - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Test with invalid file paths invalidFiles := []string{"nonexistent/path/file.md"} @@ -311,7 +311,7 @@ func TestCompileModifiedFiles(t *testing.T) { content := "---\non: push\nengine: claude\n---\n# Recent Test\n\nRecent content" os.WriteFile(recentFile, []byte(content), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Test verbose mode modifiedFiles := []string{recentFile} @@ -414,7 +414,7 @@ func TestCompileSingleFile(t *testing.T) { content := "---\non: push\nengine: claude\n---\n# Test\n\nTest workflow content" os.WriteFile(filePath, []byte(content), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() stats := &CompilationStats{} // Compile without checking existence @@ -449,7 +449,7 @@ func TestCompileSingleFile(t *testing.T) { content := "---\nmalformed: yaml: content:\n - missing\n proper: structure\n---\n# Invalid\n" os.WriteFile(filePath, []byte(content), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() stats := &CompilationStats{} // Compile without checking existence @@ -486,7 +486,7 @@ func TestCompileSingleFile(t *testing.T) { content := "---\non: push\nengine: claude\n---\n# Test\n\nTest workflow content" os.WriteFile(filePath, []byte(content), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() stats := &CompilationStats{} // Compile with existence check @@ -509,7 +509,7 @@ func TestCompileSingleFile(t *testing.T) { // Use a non-existent file path filePath := filepath.Join(workflowsDir, "nonexistent.md") - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() stats := &CompilationStats{} // Compile with existence check - should skip @@ -534,7 +534,7 @@ func TestCompileSingleFile(t *testing.T) { content := "---\non: push\nengine: claude\n---\n# Verbose Test\n\nTest workflow content" os.WriteFile(filePath, []byte(content), 0644) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() stats := &CompilationStats{} // Compile in verbose mode diff --git a/pkg/cli/compile_campaign_orchestrator_test.go b/pkg/cli/compile_campaign_orchestrator_test.go index eda2c9d90f..d61a59aa32 100644 --- a/pkg/cli/compile_campaign_orchestrator_test.go +++ b/pkg/cli/compile_campaign_orchestrator_test.go @@ -23,10 +23,12 @@ func TestGenerateAndCompileCampaignOrchestrator(t *testing.T) { MemoryPaths: []string{"memory/campaigns/test-campaign/**"}, } - compiler := workflow.NewCompiler(false, "", GetVersion()) - compiler.SetSkipValidation(true) - compiler.SetNoEmit(false) - compiler.SetStrictMode(false) + // Compiler with auto-detected version and action mode + compiler := workflow.NewCompiler( + workflow.WithSkipValidation(true), + workflow.WithNoEmit(false), + workflow.WithStrictMode(false), + ) orchestratorPath, err := generateAndCompileCampaignOrchestrator(GenerateCampaignOrchestratorOptions{ Compiler: compiler, @@ -149,10 +151,11 @@ func TestCampaignSourceCommentStability(t *testing.T) { MemoryPaths: []string{"memory/campaigns/test-campaign/**"}, } - compiler := workflow.NewCompiler(false, "", GetVersion()) - compiler.SetSkipValidation(true) - compiler.SetNoEmit(false) - compiler.SetStrictMode(false) + compiler := workflow.NewCompiler( + workflow.WithSkipValidation(true), + workflow.WithNoEmit(false), + workflow.WithStrictMode(false), + ) // Save original working directory originalWd, err := os.Getwd() diff --git a/pkg/cli/compile_command_test.go b/pkg/cli/compile_command_test.go index 4f2fe3feff..f88a06e0fa 100644 --- a/pkg/cli/compile_command_test.go +++ b/pkg/cli/compile_command_test.go @@ -204,7 +204,7 @@ func TestTrackWorkflowFailure(t *testing.T) { // TestCompileWorkflowWithValidation_InvalidFile tests error handling func TestCompileWorkflowWithValidation_InvalidFile(t *testing.T) { - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Try to compile a non-existent file err := CompileWorkflowWithValidation( @@ -369,8 +369,10 @@ This is a test workflow. } // Create compiler with noEmit flag - compiler := workflow.NewCompiler(false, "", "test") - compiler.SetNoEmit(true) + compiler := workflow.NewCompiler( + workflow.WithVersion("test"), + workflow.WithNoEmit(true), + ) // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -426,7 +428,7 @@ This is a test workflow. } // Create compiler - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Compile the workflow err := CompileWorkflowWithValidation( @@ -758,7 +760,7 @@ This is a test workflow. for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Note: SetSkipValidation controls schema validation, which is // different from the validateActionSHAs parameter we're testing. // We skip schema validation here to focus on the security tool independence test. diff --git a/pkg/cli/compile_compiler_setup.go b/pkg/cli/compile_compiler_setup.go index c6ad0cc157..e7d98ad4ec 100644 --- a/pkg/cli/compile_compiler_setup.go +++ b/pkg/cli/compile_compiler_setup.go @@ -88,8 +88,11 @@ func createAndConfigureCompiler(config CompileConfig) *workflow.Compiler { } } - // Create compiler with verbose flag and AI engine override - compiler := workflow.NewCompiler(config.Verbose, config.EngineOverride, GetVersion()) + // Create compiler with auto-detected version and action mode + compiler := workflow.NewCompiler( + workflow.WithVerbose(config.Verbose), + workflow.WithEngineOverride(config.EngineOverride), + ) compileCompilerSetupLog.Print("Created compiler instance") // Configure compiler flags diff --git a/pkg/cli/compile_force_refresh_action_pins_test.go b/pkg/cli/compile_force_refresh_action_pins_test.go index ce7ac630ba..27994333d7 100644 --- a/pkg/cli/compile_force_refresh_action_pins_test.go +++ b/pkg/cli/compile_force_refresh_action_pins_test.go @@ -44,8 +44,10 @@ func TestForceRefreshActionPins_ClearCache(t *testing.T) { assert.Len(t, testCache.Entries, 2, "Cache should have 2 entries before force refresh") // Create compiler with force refresh enabled - compiler := workflow.NewCompiler(false, "", "test") - compiler.SetForceRefreshActionPins(true) + compiler := workflow.NewCompiler( + workflow.WithVersion("test"), + workflow.WithForceRefreshActionPins(true), + ) // Get the shared action resolver - this should skip loading the cache actionCache, _ := compiler.GetSharedActionResolverForTest() diff --git a/pkg/cli/compile_security_benchmark_test.go b/pkg/cli/compile_security_benchmark_test.go index b7b3b2a532..14b167a613 100644 --- a/pkg/cli/compile_security_benchmark_test.go +++ b/pkg/cli/compile_security_benchmark_test.go @@ -51,7 +51,7 @@ PR Number: ${{ github.event.pull_request.number }} b.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -103,7 +103,7 @@ Issue: ${{ needs.activation.outputs.text }} b.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -149,7 +149,7 @@ Repository: ${{ github.repository }} b.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -220,7 +220,7 @@ PR Details: b.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -272,7 +272,7 @@ PR Number: ${{ github.event.pull_request.number }} b.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -318,7 +318,7 @@ Process issue. ` var lockFiles []string - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() // Create 5 workflows for i := 1; i <= 5; i++ { @@ -429,7 +429,7 @@ Triggered by: ${{ github.actor }} b.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() b.ResetTimer() b.ReportAllocs() diff --git a/pkg/cli/dependency_graph_test.go b/pkg/cli/dependency_graph_test.go index ce668c24c7..112e852780 100644 --- a/pkg/cli/dependency_graph_test.go +++ b/pkg/cli/dependency_graph_test.go @@ -104,7 +104,7 @@ description: Standalone workflow // Build dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -192,7 +192,7 @@ imports: // Build dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -281,7 +281,7 @@ imports: // Build dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -337,7 +337,7 @@ imports: // Build dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -408,7 +408,7 @@ imports: // Build dependency graph - should handle circular imports gracefully graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -445,7 +445,7 @@ description: Helper workflow // Build initial dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -522,7 +522,7 @@ func TestDependencyGraph_EmptyGraph(t *testing.T) { // Build dependency graph with no workflows graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -646,7 +646,7 @@ imports: // Build dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } @@ -744,7 +744,7 @@ imports: // Build dependency graph graph := NewDependencyGraph(workflowsDir) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := graph.BuildGraph(compiler); err != nil { t.Fatalf("BuildGraph() error = %v", err) } diff --git a/pkg/cli/error_formatting_test.go b/pkg/cli/error_formatting_test.go index 0bd4bcb882..f07ae6a01f 100644 --- a/pkg/cli/error_formatting_test.go +++ b/pkg/cli/error_formatting_test.go @@ -34,7 +34,7 @@ This is not valid frontmatter os.Stderr = w // Create compiler and attempt to compile - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _ = CompileWorkflowWithValidation(compiler, invalidWorkflow, false, false, false, false, false, false) // Restore stderr and read captured output diff --git a/pkg/cli/init.go b/pkg/cli/init.go index cc3e68a7b9..31d0ff0016 100644 --- a/pkg/cli/init.go +++ b/pkg/cli/init.go @@ -825,14 +825,9 @@ func ensureMaintenanceWorkflow(verbose bool) error { // Filter out README.md files files = filterWorkflowFiles(files) - // Create a compiler to parse workflows - compiler := workflow.NewCompiler(false, "", GetVersion()) - - // Detect and set the action mode (dev/release) based on binary version and GitHub context - // This ensures the maintenance workflow uses the correct action references - mode := workflow.DetectActionMode(GetVersion()) - compiler.SetActionMode(mode) - initLog.Printf("Action mode detected for maintenance workflow: %s", mode) + // Create a compiler to parse workflows (version and action mode auto-detected) + compiler := workflow.NewCompiler() + initLog.Printf("Action mode detected for maintenance workflow: %s", compiler.GetActionMode()) // Parse all workflows to collect WorkflowData var workflowDataList []*workflow.WorkflowData diff --git a/pkg/cli/mcp_add.go b/pkg/cli/mcp_add.go index 53f1a52d0d..19df30a310 100644 --- a/pkg/cli/mcp_add.go +++ b/pkg/cli/mcp_add.go @@ -143,7 +143,10 @@ func AddMCPTool(workflowFile string, mcpServerID string, registryURL string, tra } mcpAddLog.Print("Compiling workflow after adding MCP tool") - compiler := workflow.NewCompiler(verbose, "", "") + compiler := workflow.NewCompiler( + workflow.WithVerbose(verbose), + ) + if err := compiler.CompileWorkflow(workflowPath); err != nil { // Security fix for CWE-312, CWE-315, CWE-359: Avoid logging detailed error messages // that could contain sensitive information from secret references diff --git a/pkg/cli/mcp_inspect.go b/pkg/cli/mcp_inspect.go index 658d8e103b..7b9b20a08b 100644 --- a/pkg/cli/mcp_inspect.go +++ b/pkg/cli/mcp_inspect.go @@ -49,7 +49,9 @@ func InspectWorkflowMCP(workflowFile string, serverFilter string, toolFilter str // Use the compiler to parse the workflow file // This automatically handles imports, merging, and validation - compiler := workflow.NewCompiler(verbose, "", "") + compiler := workflow.NewCompiler( + workflow.WithVerbose(verbose), + ) workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { // Handle shared workflow error separately (not a fatal error for inspection) diff --git a/pkg/cli/mcp_inspect_inspector.go b/pkg/cli/mcp_inspect_inspector.go index ccc230c3e1..8900eebe59 100644 --- a/pkg/cli/mcp_inspect_inspector.go +++ b/pkg/cli/mcp_inspect_inspector.go @@ -45,7 +45,9 @@ func spawnMCPInspector(workflowFile string, serverFilter string, verbose bool) e // Use the compiler to parse the workflow file // This automatically handles imports, merging, and validation - compiler := workflow.NewCompiler(verbose, "", "") + compiler := workflow.NewCompiler( + workflow.WithVerbose(verbose), + ) workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { return err diff --git a/pkg/cli/mcp_inspect_safe_inputs_inspector.go b/pkg/cli/mcp_inspect_safe_inputs_inspector.go index 261b5cbbdb..65c128f68a 100644 --- a/pkg/cli/mcp_inspect_safe_inputs_inspector.go +++ b/pkg/cli/mcp_inspect_safe_inputs_inspector.go @@ -44,7 +44,9 @@ func spawnSafeInputsInspector(workflowFile string, verbose bool) error { // Use the workflow compiler to parse the file and resolve imports // This ensures that imported safe-inputs are properly merged - compiler := workflow.NewCompiler(verbose, "", "") + compiler := workflow.NewCompiler( + workflow.WithVerbose(verbose), + ) workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { return fmt.Errorf("failed to parse workflow file: %w", err) diff --git a/pkg/cli/mcp_inspect_safe_inputs_test.go b/pkg/cli/mcp_inspect_safe_inputs_test.go index 784d69e099..ce43e058e9 100644 --- a/pkg/cli/mcp_inspect_safe_inputs_test.go +++ b/pkg/cli/mcp_inspect_safe_inputs_test.go @@ -96,7 +96,7 @@ This workflow has safe-inputs configuration. // Parse the workflow using the compiler to get safe-inputs config // (including any imported safe-inputs) - compiler := workflow.NewCompiler(false, "", "") + compiler := workflow.NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) @@ -198,7 +198,7 @@ This workflow imports safe-inputs from shared/shared.md. // Parse the workflow using the compiler to get safe-inputs config // This should include both local and imported safe-inputs - compiler := workflow.NewCompiler(false, "", "") + compiler := workflow.NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) diff --git a/pkg/cli/security_regression_test.go b/pkg/cli/security_regression_test.go index 25a0d326e9..0b32b7d69c 100644 --- a/pkg/cli/security_regression_test.go +++ b/pkg/cli/security_regression_test.go @@ -450,7 +450,7 @@ Test content.`, // This test validates the underlying compilation validation, which is the same // validation used by the CLI. The CLI path validation is tested separately in // TestSecurityCLIPathSanitization and TestSecurityCLIOutputDirectorySafety. - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() compileErr := compiler.CompileWorkflow(testFile) if tt.expectError { diff --git a/pkg/workflow/action_reference_test.go b/pkg/workflow/action_reference_test.go index 86a840a2cf..470a95ef35 100644 --- a/pkg/workflow/action_reference_test.go +++ b/pkg/workflow/action_reference_test.go @@ -6,7 +6,7 @@ import ( func TestConvertToRemoteActionRef(t *testing.T) { t.Run("local path with ./ prefix and version tag", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.2.3") + compiler := NewCompilerWithVersion("v1.2.3") data := &WorkflowData{} ref := compiler.convertToRemoteActionRef("./actions/create-issue", data) expected := "githubnext/gh-aw/actions/create-issue@v1.2.3" @@ -16,7 +16,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("local path without ./ prefix and version tag", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") data := &WorkflowData{} ref := compiler.convertToRemoteActionRef("actions/create-issue", data) expected := "githubnext/gh-aw/actions/create-issue@v1.0.0" @@ -26,7 +26,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("nested action path with version tag", func(t *testing.T) { - compiler := NewCompiler(false, "", "v2.0.0") + compiler := NewCompilerWithVersion("v2.0.0") data := &WorkflowData{} ref := compiler.convertToRemoteActionRef("./actions/nested/action", data) expected := "githubnext/gh-aw/actions/nested/action@v2.0.0" @@ -36,7 +36,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("dev version returns empty", func(t *testing.T) { - compiler := NewCompiler(false, "", "dev") + compiler := NewCompilerWithVersion("dev") data := &WorkflowData{} ref := compiler.convertToRemoteActionRef("./actions/create-issue", data) if ref != "" { @@ -45,7 +45,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("empty version returns empty", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() data := &WorkflowData{} ref := compiler.convertToRemoteActionRef("./actions/create-issue", data) if ref != "" { @@ -54,7 +54,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("action-tag overrides version", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") data := &WorkflowData{Features: map[string]any{"action-tag": "latest"}} ref := compiler.convertToRemoteActionRef("./actions/create-issue", data) expected := "githubnext/gh-aw/actions/create-issue@latest" @@ -64,7 +64,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("action-tag with specific SHA", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") data := &WorkflowData{Features: map[string]any{"action-tag": "abc123def456"}} ref := compiler.convertToRemoteActionRef("./actions/setup", data) expected := "githubnext/gh-aw/actions/setup@abc123def456" @@ -74,7 +74,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("action-tag with version tag format", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") data := &WorkflowData{Features: map[string]any{"action-tag": "v2.5.0"}} ref := compiler.convertToRemoteActionRef("./actions/setup", data) expected := "githubnext/gh-aw/actions/setup@v2.5.0" @@ -84,7 +84,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("empty action-tag falls back to version", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.5.0") + compiler := NewCompilerWithVersion("v1.5.0") data := &WorkflowData{Features: map[string]any{"action-tag": ""}} ref := compiler.convertToRemoteActionRef("./actions/create-issue", data) expected := "githubnext/gh-aw/actions/create-issue@v1.5.0" @@ -94,7 +94,7 @@ func TestConvertToRemoteActionRef(t *testing.T) { }) t.Run("nil data falls back to version", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.5.0") + compiler := NewCompilerWithVersion("v1.5.0") ref := compiler.convertToRemoteActionRef("./actions/create-issue", nil) expected := "githubnext/gh-aw/actions/create-issue@v1.5.0" if ref != expected { @@ -169,7 +169,7 @@ func TestResolveActionReference(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", tt.version) + compiler := NewCompilerWithVersion(tt.version) compiler.SetActionMode(tt.actionMode) data := &WorkflowData{} @@ -193,7 +193,7 @@ func TestResolveActionReference(t *testing.T) { func TestCompilerActionTag(t *testing.T) { t.Run("compiler actionTag overrides frontmatter action-tag", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") compiler.SetActionMode(ActionModeRelease) compiler.SetActionTag("v2.0.0") @@ -207,7 +207,7 @@ func TestCompilerActionTag(t *testing.T) { }) t.Run("compiler actionTag overrides version", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") compiler.SetActionMode(ActionModeRelease) compiler.SetActionTag("abc123def456") @@ -220,7 +220,7 @@ func TestCompilerActionTag(t *testing.T) { }) t.Run("compiler actionTag with dev mode forces release behavior", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") // When actionTag is set via --action-tag flag, setupActionMode sets mode to release // So this test should reflect that behavior compiler.SetActionTag("v2.0.0") @@ -235,7 +235,7 @@ func TestCompilerActionTag(t *testing.T) { }) t.Run("empty compiler actionTag falls back to frontmatter", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") compiler.SetActionMode(ActionModeRelease) // Don't set compiler actionTag @@ -248,7 +248,7 @@ func TestCompilerActionTag(t *testing.T) { }) t.Run("empty compiler actionTag and no frontmatter uses version", func(t *testing.T) { - compiler := NewCompiler(false, "", "v1.2.3") + compiler := NewCompilerWithVersion("v1.2.3") compiler.SetActionMode(ActionModeRelease) data := &WorkflowData{} diff --git a/pkg/workflow/action_sha_validation_test.go b/pkg/workflow/action_sha_validation_test.go index 654155f871..8bdac0cbcf 100644 --- a/pkg/workflow/action_sha_validation_test.go +++ b/pkg/workflow/action_sha_validation_test.go @@ -37,7 +37,7 @@ This is a test workflow to verify SHA pinning. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -106,7 +106,7 @@ Create issues based on input. t.Fatalf("Failed to write test workflow: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -164,7 +164,7 @@ Just a simple test workflow. t.Fatalf("Failed to write test workflow: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/activation_checkout_test.go b/pkg/workflow/activation_checkout_test.go index 736ada9373..35254c0fa6 100644 --- a/pkg/workflow/activation_checkout_test.go +++ b/pkg/workflow/activation_checkout_test.go @@ -78,7 +78,7 @@ strict: false t.Fatal(err) } - compiler := NewCompiler(false, "", "dev") + compiler := NewCompilerWithVersion("dev") // Use dev mode to use local action paths compiler.SetActionMode(ActionModeDev) diff --git a/pkg/workflow/activation_outputs_always_declared_test.go b/pkg/workflow/activation_outputs_always_declared_test.go index f55c96d0ea..d319c53197 100644 --- a/pkg/workflow/activation_outputs_always_declared_test.go +++ b/pkg/workflow/activation_outputs_always_declared_test.go @@ -62,7 +62,7 @@ Test workflow content. require.NoError(t, err) // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) require.NoError(t, err) diff --git a/pkg/workflow/add_comment_target_repo_integration_test.go b/pkg/workflow/add_comment_target_repo_integration_test.go index d09772bcb7..3a60133ab1 100644 --- a/pkg/workflow/add_comment_target_repo_integration_test.go +++ b/pkg/workflow/add_comment_target_repo_integration_test.go @@ -99,7 +99,7 @@ func TestAddCommentTargetRepoIntegration(t *testing.T) { } // Create compiler with trial mode if needed - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() if tt.trialLogicalRepoSlug != "" { compiler.SetTrialMode(true) compiler.SetTrialLogicalRepoSlug(tt.trialLogicalRepoSlug) diff --git a/pkg/workflow/add_comment_target_repo_test.go b/pkg/workflow/add_comment_target_repo_test.go index 50567ce3da..b788490a58 100644 --- a/pkg/workflow/add_comment_target_repo_test.go +++ b/pkg/workflow/add_comment_target_repo_test.go @@ -5,7 +5,7 @@ import ( ) func TestAddCommentsConfigTargetRepo(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() tests := []struct { name string @@ -91,7 +91,7 @@ func TestAddCommentsConfigTargetRepo(t *testing.T) { } func TestAddCommentsConfigHideOlderComments(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() tests := []struct { name string @@ -157,7 +157,7 @@ func TestAddCommentsConfigHideOlderComments(t *testing.T) { } func TestAddCommentsConfigAllowedReasons(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/agent_job_id_test.go b/pkg/workflow/agent_job_id_test.go index c5735fdf93..64687700e5 100644 --- a/pkg/workflow/agent_job_id_test.go +++ b/pkg/workflow/agent_job_id_test.go @@ -70,7 +70,7 @@ Test workflow that creates issues.`, } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowFile) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/agentic_output_test.go b/pkg/workflow/agentic_output_test.go index 68cb0eddc9..8b876d97fc 100644 --- a/pkg/workflow/agentic_output_test.go +++ b/pkg/workflow/agentic_output_test.go @@ -46,7 +46,7 @@ This workflow tests the agentic output collection functionality. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -147,7 +147,7 @@ This workflow tests that Codex engine gets GH_AW_SAFE_OUTPUTS but not engine out t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -269,7 +269,7 @@ This workflow tests that /tmp/gh-aw/ files are excluded from cleanup. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -583,7 +583,7 @@ This workflow tests that the redacted URLs log file is included in artifact uplo t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/agentic_workflow_test.go b/pkg/workflow/agentic_workflow_test.go index ebcb39d8dd..12d762427e 100644 --- a/pkg/workflow/agentic_workflow_test.go +++ b/pkg/workflow/agentic_workflow_test.go @@ -12,7 +12,7 @@ import ( // testCompiler creates a test compiler with validation skipped func testCompiler() *Compiler { - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetSkipValidation(true) return c } diff --git a/pkg/workflow/agentic_workflows_permission_test.go b/pkg/workflow/agentic_workflows_permission_test.go index cca3248e83..513a687a65 100644 --- a/pkg/workflow/agentic_workflows_permission_test.go +++ b/pkg/workflow/agentic_workflows_permission_test.go @@ -93,7 +93,7 @@ tools: } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowPath) if tt.expectError { diff --git a/pkg/workflow/allow_github_references_env_test.go b/pkg/workflow/allow_github_references_env_test.go index 1ff145a8d1..c8b4e95f6b 100644 --- a/pkg/workflow/allow_github_references_env_test.go +++ b/pkg/workflow/allow_github_references_env_test.go @@ -168,7 +168,7 @@ Test workflow with only specific repos allowed. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/allow_github_references_test.go b/pkg/workflow/allow_github_references_test.go index bbbdbed98b..6f1f85d2ef 100644 --- a/pkg/workflow/allow_github_references_test.go +++ b/pkg/workflow/allow_github_references_test.go @@ -96,7 +96,7 @@ func TestAllowGitHubReferencesConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "1.0.0") + c := NewCompilerWithVersion("1.0.0") config := c.extractSafeOutputsConfig(tt.frontmatter) require.NotNil(t, config, "extractSafeOutputsConfig() should not return nil") diff --git a/pkg/workflow/allowed_domains_sanitization_test.go b/pkg/workflow/allowed_domains_sanitization_test.go index a6a2cb3798..b7835415e0 100644 --- a/pkg/workflow/allowed_domains_sanitization_test.go +++ b/pkg/workflow/allowed_domains_sanitization_test.go @@ -185,7 +185,7 @@ Test workflow with ecosystem identifiers. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -315,7 +315,7 @@ Test that empty allowed-domains falls back to network config. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -433,7 +433,7 @@ func TestComputeAllowedDomainsForSanitization(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create a compiler and workflow data - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ EngineConfig: &EngineConfig{ ID: tt.engineID, diff --git a/pkg/workflow/artifact_manager_integration_test.go b/pkg/workflow/artifact_manager_integration_test.go index ec52df7165..a14b6e4c44 100644 --- a/pkg/workflow/artifact_manager_integration_test.go +++ b/pkg/workflow/artifact_manager_integration_test.go @@ -35,7 +35,7 @@ This test verifies that the artifact manager is integrated into the compiler. require.NoError(t, err) // Create compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Verify artifact manager is initialized artifactManager := compiler.GetArtifactManager() @@ -89,7 +89,7 @@ This workflow has safe outputs configured. err := os.WriteFile(workflowFile, []byte(workflowContent), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err = compiler.CompileWorkflow(workflowFile) @@ -155,7 +155,7 @@ Test workflow 3. }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() artifactManager := compiler.GetArtifactManager() for i, wf := range workflows { @@ -234,7 +234,7 @@ Test lazy initialization. // artifact dependencies in a workflow func TestArtifactManagerValidationExample(t *testing.T) { // Create a compiler with artifact manager - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() artifactManager := compiler.GetArtifactManager() // Simulate job 1 uploading an artifact diff --git a/pkg/workflow/artifact_manager_workflows_test.go b/pkg/workflow/artifact_manager_workflows_test.go index b1d571c94b..c4fb5a5d4b 100644 --- a/pkg/workflow/artifact_manager_workflows_test.go +++ b/pkg/workflow/artifact_manager_workflows_test.go @@ -50,7 +50,7 @@ func TestGenerateArtifactsReference(t *testing.T) { // Compile each workflow and extract artifact information // Use dry-run mode (noEmit) so we don't write lock.yml files - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetNoEmit(true) // Enable dry-run mode - validate without generating lock files successCount := 0 diff --git a/pkg/workflow/aw_info_agent_version_test.go b/pkg/workflow/aw_info_agent_version_test.go index c0fad9c3f4..fc8a9bd134 100644 --- a/pkg/workflow/aw_info_agent_version_test.go +++ b/pkg/workflow/aw_info_agent_version_test.go @@ -75,7 +75,7 @@ func TestAgentVersionInAwInfo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() registry := GetGlobalEngineRegistry() engine, err := registry.GetEngine(tt.engineID) if err != nil { diff --git a/pkg/workflow/aw_info_steps_test.go b/pkg/workflow/aw_info_steps_test.go index 756c3451ec..78bd7b8b7b 100644 --- a/pkg/workflow/aw_info_steps_test.go +++ b/pkg/workflow/aw_info_steps_test.go @@ -91,7 +91,7 @@ This workflow tests that Claude has firewall enabled by default when network is } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/aw_info_tmp_test.go b/pkg/workflow/aw_info_tmp_test.go index ef0a2d1f40..dea30f80f8 100644 --- a/pkg/workflow/aw_info_tmp_test.go +++ b/pkg/workflow/aw_info_tmp_test.go @@ -41,7 +41,7 @@ This workflow tests that aw_info.json is generated in /tmp directory. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/aw_info_versions_test.go b/pkg/workflow/aw_info_versions_test.go index 01f8f34901..a6a6c79cbd 100644 --- a/pkg/workflow/aw_info_versions_test.go +++ b/pkg/workflow/aw_info_versions_test.go @@ -123,7 +123,7 @@ func TestCLIVersionInAwInfo(t *testing.T) { // Set the release flag for this test SetIsRelease(tt.isRelease) - compiler := NewCompiler(false, "", tt.cliVersion) + compiler := NewCompilerWithVersion(tt.cliVersion) registry := GetGlobalEngineRegistry() engine, err := registry.GetEngine(tt.engineID) if err != nil { @@ -190,7 +190,7 @@ func TestAwfVersionInAwInfo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") registry := GetGlobalEngineRegistry() engine, err := registry.GetEngine("copilot") if err != nil { @@ -232,7 +232,7 @@ func TestBothVersionsInAwInfo(t *testing.T) { SetIsRelease(true) // Test that both CLI version and AWF version are present simultaneously - compiler := NewCompiler(false, "", "2.0.0-beta.5") + compiler := NewCompilerWithVersion("2.0.0-beta.5") registry := GetGlobalEngineRegistry() engine, err := registry.GetEngine("copilot") if err != nil { @@ -295,7 +295,7 @@ func TestAwmgVersionInAwInfo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") registry := GetGlobalEngineRegistry() engine, err := registry.GetEngine("copilot") if err != nil { @@ -336,7 +336,7 @@ func TestAllVersionsInAwInfo(t *testing.T) { SetIsRelease(true) // Test that CLI version, AWF version, and AWMG version are present simultaneously - compiler := NewCompiler(false, "", "2.0.0-beta.5") + compiler := NewCompilerWithVersion("2.0.0-beta.5") registry := GetGlobalEngineRegistry() engine, err := registry.GetEngine("copilot") if err != nil { diff --git a/pkg/workflow/bash_defaults_consistency_test.go b/pkg/workflow/bash_defaults_consistency_test.go index 6c4d69cd22..51ef3f75f7 100644 --- a/pkg/workflow/bash_defaults_consistency_test.go +++ b/pkg/workflow/bash_defaults_consistency_test.go @@ -7,7 +7,7 @@ import ( // TestBashDefaultsConsistency tests that Claude and Copilot engines handle default bash tools consistently func TestBashDefaultsConsistency(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() claudeEngine := NewClaudeEngine() copilotEngine := NewCopilotEngine() diff --git a/pkg/workflow/bash_merge_test.go b/pkg/workflow/bash_merge_test.go index 82022bfb7b..48e4c2acbb 100644 --- a/pkg/workflow/bash_merge_test.go +++ b/pkg/workflow/bash_merge_test.go @@ -6,7 +6,7 @@ import ( // TestBashToolsMergeCustomWithDefaults tests that custom bash tools get merged with defaults func TestBashToolsMergeCustomWithDefaults(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/blocked_domains_integration_test.go b/pkg/workflow/blocked_domains_integration_test.go index d558855728..6baaa481c6 100644 --- a/pkg/workflow/blocked_domains_integration_test.go +++ b/pkg/workflow/blocked_domains_integration_test.go @@ -48,7 +48,7 @@ Test workflow with blocked domains. } // Compile the workflow - compiler := NewCompiler(false, "", "test-blocked-domains") + compiler := NewCompilerWithVersion("test-blocked-domains") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -124,7 +124,7 @@ Test workflow with blocked ecosystem. } // Compile the workflow - compiler := NewCompiler(false, "", "test-blocked-ecosystem") + compiler := NewCompilerWithVersion("test-blocked-ecosystem") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -193,7 +193,7 @@ Test workflow without blocked domains. } // Compile the workflow - compiler := NewCompiler(false, "", "test-no-blocked") + compiler := NewCompilerWithVersion("test-no-blocked") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -255,7 +255,7 @@ Test Claude workflow with blocked domains. } // Compile the workflow - compiler := NewCompiler(false, "", "test-claude-blocked") + compiler := NewCompilerWithVersion("test-claude-blocked") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -317,7 +317,7 @@ Test Codex workflow with blocked domains. } // Compile the workflow - compiler := NewCompiler(false, "", "test-codex-blocked") + compiler := NewCompilerWithVersion("test-codex-blocked") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { diff --git a/pkg/workflow/bots_test.go b/pkg/workflow/bots_test.go index 42e3419e79..5d25f4ec02 100644 --- a/pkg/workflow/bots_test.go +++ b/pkg/workflow/bots_test.go @@ -13,7 +13,7 @@ import ( func TestBotsFieldExtraction(t *testing.T) { tmpDir := testutil.TempDir(t, "workflow-bots-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -101,7 +101,7 @@ Test workflow content.`, func TestBotsEnvironmentVariableGeneration(t *testing.T) { tmpDir := testutil.TempDir(t, "workflow-bots-env-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: @@ -150,7 +150,7 @@ Test workflow content.` func TestBotsWithDefaultRoles(t *testing.T) { tmpDir := testutil.TempDir(t, "workflow-bots-default-roles-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: @@ -198,7 +198,7 @@ Test workflow content with bot and default roles.` func TestBotsWithRolesAll(t *testing.T) { tmpDir := testutil.TempDir(t, "workflow-bots-roles-all-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: diff --git a/pkg/workflow/branch_normalize_integration_test.go b/pkg/workflow/branch_normalize_integration_test.go index 57c694ce62..8d6d7a2424 100644 --- a/pkg/workflow/branch_normalize_integration_test.go +++ b/pkg/workflow/branch_normalize_integration_test.go @@ -7,7 +7,7 @@ import ( func TestBranchNormalizationInlinedInMainJob(t *testing.T) { // Test that normalization logic is inlined in upload_assets.cjs when upload-assets is configured - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Create test workflow data with upload-assets configured data := &WorkflowData{ @@ -48,7 +48,7 @@ func TestBranchNormalizationInlinedInMainJob(t *testing.T) { func TestBranchNormalizationStepNotAddedWhenNoUploadAssets(t *testing.T) { // Test that no normalization-related content appears when upload-assets is not configured - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Create test workflow data WITHOUT upload-assets data := &WorkflowData{ diff --git a/pkg/workflow/cache_memory_import_test.go b/pkg/workflow/cache_memory_import_test.go index f1bdd26f64..40786b5b5b 100644 --- a/pkg/workflow/cache_memory_import_test.go +++ b/pkg/workflow/cache_memory_import_test.go @@ -64,7 +64,7 @@ Test cache-memory import without local definition. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mainPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/cache_memory_integration_test.go b/pkg/workflow/cache_memory_integration_test.go index 6969d91a4b..0c84f9e9c2 100644 --- a/pkg/workflow/cache_memory_integration_test.go +++ b/pkg/workflow/cache_memory_integration_test.go @@ -143,7 +143,7 @@ tools: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/cache_memory_restore_only_test.go b/pkg/workflow/cache_memory_restore_only_test.go index abec212933..78402e7257 100644 --- a/pkg/workflow/cache_memory_restore_only_test.go +++ b/pkg/workflow/cache_memory_restore_only_test.go @@ -131,7 +131,7 @@ tools: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/cache_memory_syntax_test.go b/pkg/workflow/cache_memory_syntax_test.go index 3a5c2f6949..f2b127e922 100644 --- a/pkg/workflow/cache_memory_syntax_test.go +++ b/pkg/workflow/cache_memory_syntax_test.go @@ -98,7 +98,7 @@ func TestCacheMemorySyntaxVariations(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tools := map[string]any{ "cache-memory": tt.cacheValue, } diff --git a/pkg/workflow/cache_memory_threat_detection_test.go b/pkg/workflow/cache_memory_threat_detection_test.go index 9ee6a7640f..03145d1c5d 100644 --- a/pkg/workflow/cache_memory_threat_detection_test.go +++ b/pkg/workflow/cache_memory_threat_detection_test.go @@ -192,7 +192,7 @@ Test workflow with restore-only cache-memory and threat detection enabled.`, } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/cache_retention_days_validation_test.go b/pkg/workflow/cache_retention_days_validation_test.go index 9098305c87..a7d7a22822 100644 --- a/pkg/workflow/cache_retention_days_validation_test.go +++ b/pkg/workflow/cache_retention_days_validation_test.go @@ -67,7 +67,7 @@ func TestCacheMemoryRetentionDaysValidationObject(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractCacheMemoryConfig(toolsConfig) if tt.wantError { @@ -145,7 +145,7 @@ func TestCacheMemoryRetentionDaysValidationArray(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractCacheMemoryConfig(toolsConfig) if tt.wantError { @@ -188,7 +188,7 @@ func TestCacheMemoryRetentionDaysNoValue(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractCacheMemoryConfig(toolsConfig) if err != nil { diff --git a/pkg/workflow/campaign_trigger_test.go b/pkg/workflow/campaign_trigger_test.go index a46e502c18..6fe6b78a54 100644 --- a/pkg/workflow/campaign_trigger_test.go +++ b/pkg/workflow/campaign_trigger_test.go @@ -16,7 +16,7 @@ import ( // and labeled (when GitHub applies labels from issue forms). func TestCampaignTriggerEvents(t *testing.T) { tmpDir := testutil.TempDir(t, "campaign-trigger-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -108,7 +108,7 @@ tools: // The workflow uses 'labeled' event with the 'create-agentic-campaign' label filter // to trigger campaign creation. func TestCampaignGeneratorWorkflow(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test compilation of the actual agentic-campaign-generator workflow workflowPath := "../../.github/workflows/agentic-campaign-generator.md" diff --git a/pkg/workflow/check_workflow_timestamp_js_test.go b/pkg/workflow/check_workflow_timestamp_js_test.go index 8dc089bd3d..905fc93673 100644 --- a/pkg/workflow/check_workflow_timestamp_js_test.go +++ b/pkg/workflow/check_workflow_timestamp_js_test.go @@ -15,7 +15,7 @@ import ( func TestWorkflowTimestampCheckUsesJavaScript(t *testing.T) { tmpDir := testutil.TempDir(t, "workflow-timestamp-js-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowContent := `--- on: diff --git a/pkg/workflow/checkout_optimization_test.go b/pkg/workflow/checkout_optimization_test.go index 60eaa420a4..647f238390 100644 --- a/pkg/workflow/checkout_optimization_test.go +++ b/pkg/workflow/checkout_optimization_test.go @@ -225,7 +225,7 @@ strict: false t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -360,7 +360,7 @@ func TestShouldAddCheckoutStep(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/pkg/workflow/checkout_persist_credentials_test.go b/pkg/workflow/checkout_persist_credentials_test.go index 7fa2808448..a5cf7f5fb4 100644 --- a/pkg/workflow/checkout_persist_credentials_test.go +++ b/pkg/workflow/checkout_persist_credentials_test.go @@ -140,7 +140,7 @@ strict: false t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/checkout_runtime_order_test.go b/pkg/workflow/checkout_runtime_order_test.go index 7f07580046..260c8cea02 100644 --- a/pkg/workflow/checkout_runtime_order_test.go +++ b/pkg/workflow/checkout_runtime_order_test.go @@ -52,7 +52,7 @@ steps: } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() compiler.SetActionMode(ActionModeDev) // Use dev mode with local action paths if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -221,7 +221,7 @@ Run node --version to check the Node.js version. } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() compiler.SetActionMode(ActionModeDev) // Use dev mode with local action paths if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/claude_engine_tools_test.go b/pkg/workflow/claude_engine_tools_test.go index cc15580be7..601eec94c9 100644 --- a/pkg/workflow/claude_engine_tools_test.go +++ b/pkg/workflow/claude_engine_tools_test.go @@ -291,7 +291,7 @@ func TestClaudeEngineComputeAllowedTools(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Extract cache-memory config from tools if present - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() cacheMemoryConfig, _ := compiler.extractCacheMemoryConfigFromMap(tt.tools) result := engine.computeAllowedClaudeToolsString(tt.tools, nil, cacheMemoryConfig) @@ -411,7 +411,7 @@ func TestClaudeEngineComputeAllowedToolsWithSafeOutputs(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Extract cache-memory config from tools if present - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() cacheMemoryConfig, _ := compiler.extractCacheMemoryConfigFromMap(tt.tools) result := engine.computeAllowedClaudeToolsString(tt.tools, tt.safeOutputs, cacheMemoryConfig) diff --git a/pkg/workflow/command_precision_test.go b/pkg/workflow/command_precision_test.go index 427160f85b..511b54b25d 100644 --- a/pkg/workflow/command_precision_test.go +++ b/pkg/workflow/command_precision_test.go @@ -15,7 +15,7 @@ import ( func TestCommandConditionPrecision(t *testing.T) { tmpDir := testutil.TempDir(t, "workflow-command-precision-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/command_test.go b/pkg/workflow/command_test.go index 1a4eff13d4..7e7628c83d 100644 --- a/pkg/workflow/command_test.go +++ b/pkg/workflow/command_test.go @@ -109,7 +109,7 @@ func TestEventAwareCommandConditions(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-event-aware-command-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -281,7 +281,7 @@ func TestCommandEventsFiltering(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-command-events-filtering-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/compile_config_test.go b/pkg/workflow/compile_config_test.go index c387a861bd..3df8c22124 100644 --- a/pkg/workflow/compile_config_test.go +++ b/pkg/workflow/compile_config_test.go @@ -54,7 +54,7 @@ func TestAllowedDomainsParsing(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() config := c.extractSafeOutputsConfig(tt.frontmatter) if tt.expectedDomains == nil { @@ -89,7 +89,7 @@ func TestAllowedDomainsParsing(t *testing.T) { func TestAllowedDomainsInWorkflow(t *testing.T) { // Create a test compiler with verbose output to check generated workflow - c := NewCompiler(true, "", "test") + c := NewCompiler() // Test workflow with allowed domains frontmatter := map[string]any{ @@ -186,7 +186,7 @@ func TestSafeOutputsConfigGeneration(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := compiler.extractSafeOutputsConfig(tt.frontmatter) // Test the config generation in generateOutputCollectionStep by creating a mock workflow data @@ -317,7 +317,7 @@ func TestCreateDiscussionConfigParsing(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() config := c.extractSafeOutputsConfig(tt.frontmatter) if !tt.expectConfig { diff --git a/pkg/workflow/compile_outputs_allowed_labels_test.go b/pkg/workflow/compile_outputs_allowed_labels_test.go index 63b3b7ceb5..a03406c267 100644 --- a/pkg/workflow/compile_outputs_allowed_labels_test.go +++ b/pkg/workflow/compile_outputs_allowed_labels_test.go @@ -133,7 +133,7 @@ This workflow tests allowed-labels for all safe outputs. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -237,7 +237,7 @@ This workflow tests that allowed-labels are passed to safe output jobs. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -301,7 +301,7 @@ This workflow tests that allowed-labels are included in safe outputs config JSON t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse workflow workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/compile_outputs_comment_test.go b/pkg/workflow/compile_outputs_comment_test.go index 742ca4edae..a646c1587f 100644 --- a/pkg/workflow/compile_outputs_comment_test.go +++ b/pkg/workflow/compile_outputs_comment_test.go @@ -40,7 +40,7 @@ This workflow tests the output.add-comment configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -89,7 +89,7 @@ This workflow tests the output.add-comment configuration parsing with null value t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -139,7 +139,7 @@ This workflow tests the output.add-comment target configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -194,7 +194,7 @@ This workflow tests the add-comment max and target configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -254,7 +254,7 @@ This workflow tests the safe_outputs job generation. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -349,7 +349,7 @@ This workflow tests that issue comment job is skipped for non-issue/PR events. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/compile_outputs_issue_test.go b/pkg/workflow/compile_outputs_issue_test.go index a49dc0b2e8..dc7e67c006 100644 --- a/pkg/workflow/compile_outputs_issue_test.go +++ b/pkg/workflow/compile_outputs_issue_test.go @@ -40,7 +40,7 @@ This workflow tests the output configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -103,7 +103,7 @@ This workflow has no output configuration. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -149,7 +149,7 @@ This workflow tests the null output configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -235,7 +235,7 @@ This workflow tests the create-issue job generation. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/compile_outputs_label_test.go b/pkg/workflow/compile_outputs_label_test.go index eee49b0e5b..a1d3ab1c2c 100644 --- a/pkg/workflow/compile_outputs_label_test.go +++ b/pkg/workflow/compile_outputs_label_test.go @@ -43,7 +43,7 @@ This workflow tests the output labels configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -108,7 +108,7 @@ This workflow tests the safe_outputs job generation. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -216,7 +216,7 @@ Write your labels to ${{ env.GH_AW_SAFE_OUTPUTS }}, one per line. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -295,7 +295,7 @@ Write your labels to ${{ env.GH_AW_SAFE_OUTPUTS }}, one per line. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -378,7 +378,7 @@ This workflow tests the output labels null configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -439,7 +439,7 @@ This workflow tests the output labels max configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -507,7 +507,7 @@ This workflow tests the default max behavior. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -557,7 +557,7 @@ This workflow tests the safe_outputs job generation with max. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -629,7 +629,7 @@ This workflow tests the safe_outputs job generation with default max. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -692,7 +692,7 @@ This workflow tests validation of empty allowed labels. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should fail with empty allowed labels err := compiler.CompileWorkflow(testFile) @@ -736,7 +736,7 @@ This workflow tests that missing allowed field is now optional. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should now succeed with missing allowed labels if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/compile_outputs_pr_test.go b/pkg/workflow/compile_outputs_pr_test.go index 5e057d5ee0..a105520593 100644 --- a/pkg/workflow/compile_outputs_pr_test.go +++ b/pkg/workflow/compile_outputs_pr_test.go @@ -42,7 +42,7 @@ This workflow tests the output pull request configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -112,7 +112,7 @@ This workflow tests the create_pull_request job generation. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -221,7 +221,7 @@ This workflow tests the create_pull_request job generation with draft: false. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -297,7 +297,7 @@ This workflow tests the create_pull_request job generation with draft: true. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -369,7 +369,7 @@ This workflow tests the create-pull-request if-no-changes configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -479,7 +479,7 @@ This test verifies that the aw.patch artifact is downloaded in the safe_outputs } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -560,7 +560,7 @@ This test verifies that auto-merge configuration is properly handled. } // Create compiler and parse the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(mdFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) diff --git a/pkg/workflow/compiler_action_mode_test.go b/pkg/workflow/compiler_action_mode_test.go index 0e9bdafff1..0417a1556c 100644 --- a/pkg/workflow/compiler_action_mode_test.go +++ b/pkg/workflow/compiler_action_mode_test.go @@ -340,7 +340,7 @@ Test workflow with release mode. }() // Compile - should auto-detect release mode from GITHUB_REF - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Don't set action mode explicitly - let it auto-detect compiler.SetActionMode(DetectActionMode("1.0.0")) compiler.SetNoEmit(false) @@ -421,7 +421,7 @@ Test } }() - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") compiler.SetActionMode(DetectActionMode("dev")) compiler.SetNoEmit(false) diff --git a/pkg/workflow/compiler_activation_jobs_test.go b/pkg/workflow/compiler_activation_jobs_test.go index b9a10db11e..69d474270c 100644 --- a/pkg/workflow/compiler_activation_jobs_test.go +++ b/pkg/workflow/compiler_activation_jobs_test.go @@ -11,7 +11,7 @@ import ( // TestBuildPreActivationJob_WithPermissionCheck tests building pre-activation job with permission checks func TestBuildPreActivationJob_WithPermissionCheck(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -40,7 +40,7 @@ func TestBuildPreActivationJob_WithPermissionCheck(t *testing.T) { // TestBuildPreActivationJob_WithoutPermissionCheck tests building pre-activation job without permission checks func TestBuildPreActivationJob_WithoutPermissionCheck(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -59,7 +59,7 @@ func TestBuildPreActivationJob_WithoutPermissionCheck(t *testing.T) { // TestBuildPreActivationJob_WithStopTime tests building pre-activation job with stop-time validation func TestBuildPreActivationJob_WithStopTime(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -83,7 +83,7 @@ func TestBuildPreActivationJob_WithStopTime(t *testing.T) { // TestBuildPreActivationJob_WithReaction tests building pre-activation job with reaction func TestBuildPreActivationJob_WithReaction(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -148,7 +148,7 @@ func TestBuildPreActivationJob_WithReaction(t *testing.T) { // TestBuildPreActivationJob_WithCustomStepsAndOutputs tests custom steps/outputs extraction func TestBuildPreActivationJob_WithCustomStepsAndOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create workflow data with custom pre-activation job workflowData := &WorkflowData{ @@ -184,7 +184,7 @@ func TestBuildPreActivationJob_WithCustomStepsAndOutputs(t *testing.T) { // TestBuildActivationJob_Basic tests building a basic activation job func TestBuildActivationJob_Basic(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -202,7 +202,7 @@ func TestBuildActivationJob_Basic(t *testing.T) { // TestBuildActivationJob_WithPreActivation tests activation job when pre-activation exists func TestBuildActivationJob_WithPreActivation(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -221,7 +221,7 @@ func TestBuildActivationJob_WithPreActivation(t *testing.T) { // TestBuildActivationJob_WithReaction tests activation job with reaction configuration func TestBuildActivationJob_WithReaction(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -242,7 +242,7 @@ func TestBuildActivationJob_WithReaction(t *testing.T) { // TestBuildMainJob_Basic tests building a basic main job func TestBuildMainJob_Basic(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -261,7 +261,7 @@ func TestBuildMainJob_Basic(t *testing.T) { // TestBuildMainJob_WithActivation tests main job when activation job exists func TestBuildMainJob_WithActivation(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -281,7 +281,7 @@ func TestBuildMainJob_WithActivation(t *testing.T) { // TestBuildMainJob_WithPermissions tests main job permission handling func TestBuildMainJob_WithPermissions(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -303,7 +303,7 @@ func TestBuildMainJob_WithPermissions(t *testing.T) { // TestExtractPreActivationCustomFields_NoCustomJob tests extraction when no custom job exists func TestExtractPreActivationCustomFields_NoCustomJob(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() jobs := map[string]any{ "other-job": map[string]any{ @@ -319,7 +319,7 @@ func TestExtractPreActivationCustomFields_NoCustomJob(t *testing.T) { // TestExtractPreActivationCustomFields_WithCustomFields tests extraction with custom fields func TestExtractPreActivationCustomFields_WithCustomFields(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() jobs := map[string]any{ "pre-activation": map[string]any{ @@ -352,7 +352,7 @@ func TestExtractPreActivationCustomFields_WithCustomFields(t *testing.T) { // TestExtractPreActivationCustomFields_InvalidSteps tests error handling for invalid steps func TestExtractPreActivationCustomFields_InvalidSteps(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() jobs := map[string]any{ "pre-activation": map[string]any{ @@ -369,7 +369,7 @@ func TestExtractPreActivationCustomFields_InvalidSteps(t *testing.T) { // TestBuildPreActivationJob_Integration tests complete pre-activation job with multiple features func TestBuildPreActivationJob_Integration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Integration Test Workflow", @@ -404,7 +404,7 @@ func TestBuildPreActivationJob_Integration(t *testing.T) { // TestBuildActivationJob_WithWorkflowRunRepoSafety tests activation with workflow_run repo safety func TestBuildActivationJob_WithWorkflowRunRepoSafety(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -444,7 +444,7 @@ func TestBuildMainJob_EngineSpecific(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", diff --git a/pkg/workflow/compiler_additional_simple_test.go b/pkg/workflow/compiler_additional_simple_test.go index 584d36e5a6..b6fe7c256f 100644 --- a/pkg/workflow/compiler_additional_simple_test.go +++ b/pkg/workflow/compiler_additional_simple_test.go @@ -6,7 +6,7 @@ import ( func TestCompiler_SetFileTracker_Basic(t *testing.T) { // Create compiler - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Initial state should have nil tracker if compiler.fileTracker != nil { diff --git a/pkg/workflow/compiler_artifacts_test.go b/pkg/workflow/compiler_artifacts_test.go index c940734cdc..94f3a109a6 100644 --- a/pkg/workflow/compiler_artifacts_test.go +++ b/pkg/workflow/compiler_artifacts_test.go @@ -12,7 +12,7 @@ import ( ) func TestAccessLogUploadConditional(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -141,7 +141,7 @@ Test post-steps indentation fix. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -251,7 +251,7 @@ This workflow should generate a unified artifact upload step that includes the p t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/compiler_benchmark_test.go b/pkg/workflow/compiler_benchmark_test.go index 9adfd694a7..21413b4fad 100644 --- a/pkg/workflow/compiler_benchmark_test.go +++ b/pkg/workflow/compiler_benchmark_test.go @@ -45,7 +45,7 @@ Issue details: ${{ needs.activation.outputs.text }} b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -94,7 +94,7 @@ Review the pull request changes and provide feedback. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -153,7 +153,7 @@ Research latest developments and create a summary. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -196,8 +196,10 @@ Analyze the issue with strict validation enabled. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") - compiler.SetStrictMode(true) + compiler := NewCompiler( + WithVersion("test"), + WithStrictMode(true), + ) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -271,7 +273,7 @@ Repository: ${{ github.repository }} b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -310,8 +312,10 @@ Analyze repository commits. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") - compiler.SetNoEmit(true) // Don't write files + compiler := NewCompiler( + WithVersion("test"), + WithNoEmit(true), // Don't write files + ) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -398,8 +402,10 @@ Debug mode: ${{ github.event.inputs.debug }} b.Fatal(err) } - compiler := NewCompiler(false, "", "test") - compiler.SetNoEmit(true) // Don't write files + compiler := NewCompiler( + WithVersion("test"), + WithNoEmit(true), // Don't write files + ) b.ResetTimer() for i := 0; i < b.N; i++ { diff --git a/pkg/workflow/compiler_cache_test.go b/pkg/workflow/compiler_cache_test.go index dc23afddb4..6782ae0c22 100644 --- a/pkg/workflow/compiler_cache_test.go +++ b/pkg/workflow/compiler_cache_test.go @@ -160,7 +160,7 @@ tools: } // Compile the workflow - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -219,7 +219,7 @@ This workflow should get default permissions applied automatically. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -337,7 +337,7 @@ This workflow has custom permissions that should override defaults. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/compiler_compilation_test.go b/pkg/workflow/compiler_compilation_test.go index ba6d6d8329..47e97f3ed1 100644 --- a/pkg/workflow/compiler_compilation_test.go +++ b/pkg/workflow/compiler_compilation_test.go @@ -44,7 +44,7 @@ This is a test workflow for compilation. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -93,7 +93,7 @@ func TestEmptyMarkdownContentError(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "empty-markdown-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -309,7 +309,7 @@ This is a test workflow with a colon in the header. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test compilation if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/compiler_container_validation_test.go b/pkg/workflow/compiler_container_validation_test.go index 9562882805..34ec511bb4 100644 --- a/pkg/workflow/compiler_container_validation_test.go +++ b/pkg/workflow/compiler_container_validation_test.go @@ -51,8 +51,10 @@ This workflow has an invalid container image. } // Create compiler with validation enabled (default behavior) - compiler := NewCompiler(false, "", "test") - compiler.SetSkipValidation(false) // Ensure validation is enabled + compiler := NewCompiler( + WithVersion("test"), + WithSkipValidation(false), // Ensure validation is enabled + ) // Compile the workflow - this should succeed with a warning, not fail with an error err := compiler.CompileWorkflow(workflowFile) @@ -103,7 +105,7 @@ This workflow has an invalid container image. } // Create compiler with validation disabled - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Disable validation // Compile the workflow - this should succeed without validation diff --git a/pkg/workflow/compiler_custom_actions_test.go b/pkg/workflow/compiler_custom_actions_test.go index ce70e43b39..deee6237f4 100644 --- a/pkg/workflow/compiler_custom_actions_test.go +++ b/pkg/workflow/compiler_custom_actions_test.go @@ -53,7 +53,7 @@ func TestActionModeString(t *testing.T) { // TestCompilerActionModeDefault tests that the compiler defaults to dev mode func TestCompilerActionModeDefault(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") if compiler.GetActionMode() != ActionModeDev { t.Errorf("Default action mode should be dev, got %s", compiler.GetActionMode()) } @@ -61,7 +61,7 @@ func TestCompilerActionModeDefault(t *testing.T) { // TestCompilerSetActionMode tests setting the action mode func TestCompilerSetActionMode(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") compiler.SetActionMode(ActionModeRelease) if compiler.GetActionMode() != ActionModeRelease { @@ -185,7 +185,7 @@ core.info('Creating issue'); }() // Compile with dev action mode - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") compiler.SetActionMode(ActionModeDev) compiler.SetNoEmit(false) @@ -246,7 +246,7 @@ Test workflow with dev mode. } // Compile with dev mode (default) - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") compiler.SetActionMode(ActionModeDev) compiler.SetNoEmit(false) @@ -323,7 +323,7 @@ Test fallback to inline mode. }() // Compile with dev action mode - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") compiler.SetActionMode(ActionModeDev) compiler.SetNoEmit(false) @@ -370,7 +370,7 @@ Test workflow with script mode. } // Compile with script mode (will be overridden by feature flag) - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") compiler.SetNoEmit(false) if err := compiler.CompileWorkflow(workflowPath); err != nil { diff --git a/pkg/workflow/compiler_customsteps_test.go b/pkg/workflow/compiler_customsteps_test.go index 535195d9dd..8c71447ac4 100644 --- a/pkg/workflow/compiler_customsteps_test.go +++ b/pkg/workflow/compiler_customsteps_test.go @@ -80,7 +80,7 @@ strict: false t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -190,7 +190,7 @@ strict: false t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError && err == nil { diff --git a/pkg/workflow/compiler_draft_test.go b/pkg/workflow/compiler_draft_test.go index f2821698bb..405ffa28b1 100644 --- a/pkg/workflow/compiler_draft_test.go +++ b/pkg/workflow/compiler_draft_test.go @@ -15,7 +15,7 @@ func TestPullRequestDraftFilter(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "draft-filter-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -212,7 +212,7 @@ This is a test workflow for draft filtering. // TestDraftFieldCommentingInOnSection specifically tests that the draft field is commented out in the on section func TestCommentOutProcessedFieldsInOnSection(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/compiler_events_test.go b/pkg/workflow/compiler_events_test.go index 04ea7d0e99..5f25e93844 100644 --- a/pkg/workflow/compiler_events_test.go +++ b/pkg/workflow/compiler_events_test.go @@ -15,7 +15,7 @@ func TestOnSection(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-on-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -129,7 +129,7 @@ func TestCommandSection(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-command-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -250,7 +250,7 @@ func TestCommandWithOtherEvents(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-command-merge-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/compiler_expression_size_test.go b/pkg/workflow/compiler_expression_size_test.go index 3e12e4755a..f94bdb425e 100644 --- a/pkg/workflow/compiler_expression_size_test.go +++ b/pkg/workflow/compiler_expression_size_test.go @@ -46,7 +46,7 @@ The content is reasonable and won't generate overly long environment variables. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Errorf("Expected no error for workflow with normal expressions, got: %v", err) @@ -92,7 +92,7 @@ safe-outputs: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(false) // Enable validation to test expression size limits err := compiler.CompileWorkflow(testFile) @@ -140,7 +140,7 @@ safe-outputs: // Create compiler without calling SetSkipValidation(false) - expression size // validation should still run because it's a mandatory GitHub Actions limit - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) // This should fail with an expression size validation error even without explicit validation enablement diff --git a/pkg/workflow/compiler_file_size_test.go b/pkg/workflow/compiler_file_size_test.go index 29d258e742..544dba2a1a 100644 --- a/pkg/workflow/compiler_file_size_test.go +++ b/pkg/workflow/compiler_file_size_test.go @@ -45,7 +45,7 @@ This is a normal workflow that should compile successfully. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Errorf("Expected no error for normal workflow, got: %v", err) @@ -90,7 +90,7 @@ This workflow tests the file size validation logic. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Errorf("Expected no error for normal workflow, got: %v", err) diff --git a/pkg/workflow/compiler_forks_test.go b/pkg/workflow/compiler_forks_test.go index 8bcbab068e..6e68b36c5f 100644 --- a/pkg/workflow/compiler_forks_test.go +++ b/pkg/workflow/compiler_forks_test.go @@ -14,7 +14,7 @@ func TestPullRequestForksArrayFilter(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "forks-array-filter-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -343,7 +343,7 @@ func TestForksArrayFieldCommentingInOnSection(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "forks-array-commenting-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -617,7 +617,7 @@ tools: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/compiler_generation_test.go b/pkg/workflow/compiler_generation_test.go index e76036e88c..1e96d51557 100644 --- a/pkg/workflow/compiler_generation_test.go +++ b/pkg/workflow/compiler_generation_test.go @@ -5,111 +5,9 @@ import ( "testing" ) -// Test NewCompilerWithCustomOutput function -func TestNewCompilerWithCustomOutput(t *testing.T) { - tests := []struct { - name string - verbose bool - engineOverride string - customOutput string - version string - expectedFields map[string]any - }{ - { - name: "create compiler with basic custom output", - verbose: false, - engineOverride: "", - customOutput: "/custom/output/path.yml", - version: "1.0.0", - expectedFields: map[string]any{ - "verbose": false, - "engineOverride": "", - "customOutput": "/custom/output/path.yml", - "version": "1.0.0", - "skipValidation": true, - }, - }, - { - name: "create compiler with verbose and engine override", - verbose: true, - engineOverride: "codex", - customOutput: "/tmp/gh-aw/th-aw/test.yml", - version: "v2.1.3", - expectedFields: map[string]any{ - "verbose": true, - "engineOverride": "codex", - "customOutput": "/tmp/gh-aw/th-aw/test.yml", - "version": "v2.1.3", - "skipValidation": true, - }, - }, - { - name: "create compiler with empty values", - verbose: false, - engineOverride: "", - customOutput: "", - version: "", - expectedFields: map[string]any{ - "verbose": false, - "engineOverride": "", - "customOutput": "", - "version": "", - "skipValidation": true, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - compiler := NewCompilerWithCustomOutput(tt.verbose, tt.engineOverride, tt.customOutput, tt.version) - - // Check that compiler is not nil - if compiler == nil { - t.Errorf("NewCompilerWithCustomOutput() returned nil") - return - } - - // Check verbose setting - if compiler.verbose != tt.expectedFields["verbose"] { - t.Errorf("NewCompilerWithCustomOutput() verbose = %v, expected %v", - compiler.verbose, tt.expectedFields["verbose"]) - } - - // Check engineOverride setting - if compiler.engineOverride != tt.expectedFields["engineOverride"] { - t.Errorf("NewCompilerWithCustomOutput() engineOverride = %v, expected %v", - compiler.engineOverride, tt.expectedFields["engineOverride"]) - } - - // Check customOutput setting - if compiler.customOutput != tt.expectedFields["customOutput"] { - t.Errorf("NewCompilerWithCustomOutput() customOutput = %v, expected %v", - compiler.customOutput, tt.expectedFields["customOutput"]) - } - - // Check version setting - if compiler.version != tt.expectedFields["version"] { - t.Errorf("NewCompilerWithCustomOutput() version = %v, expected %v", - compiler.version, tt.expectedFields["version"]) - } - - // Check skipValidation is properly set to true - if compiler.skipValidation != tt.expectedFields["skipValidation"] { - t.Errorf("NewCompilerWithCustomOutput() skipValidation = %v, expected %v", - compiler.skipValidation, tt.expectedFields["skipValidation"]) - } - - // Check that jobManager is initialized - if compiler.jobManager == nil { - t.Errorf("NewCompilerWithCustomOutput() jobManager should not be nil") - } - }) - } -} - // Test convertStepToYAML function func TestConvertStepToYAML(t *testing.T) { - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/compiler_jobs_test.go b/pkg/workflow/compiler_jobs_test.go index 63e84b4ad5..caf6a4dc00 100644 --- a/pkg/workflow/compiler_jobs_test.go +++ b/pkg/workflow/compiler_jobs_test.go @@ -16,7 +16,7 @@ import ( // TestExtractJobsFromFrontmatter tests the extractJobsFromFrontmatter method func TestExtractJobsFromFrontmatter(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -70,7 +70,7 @@ func TestExtractJobsFromFrontmatter(t *testing.T) { // TestBuildPreActivationJobWithPermissionCheck tests building a pre-activation job with permission checks func TestBuildPreActivationJobWithPermissionCheck(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -107,7 +107,7 @@ func TestBuildPreActivationJobWithPermissionCheck(t *testing.T) { // TestBuildPreActivationJobWithStopTime tests building a pre-activation job with stop-time func TestBuildPreActivationJobWithStopTime(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -129,7 +129,7 @@ func TestBuildPreActivationJobWithStopTime(t *testing.T) { // TestBuildActivationJob tests building an activation job func TestBuildActivationJob(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -154,7 +154,7 @@ func TestBuildActivationJob(t *testing.T) { // TestBuildActivationJobWithReaction tests building an activation job with AI reaction func TestBuildActivationJobWithReaction(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -182,7 +182,7 @@ func TestBuildActivationJobWithReaction(t *testing.T) { // TestBuildActivationJobCampaignOrchestratorFilename tests that campaign orchestrator // workflows (.campaign.g.md) generate correct GH_AW_WORKFLOW_FILE (.campaign.lock.yml) func TestBuildActivationJobCampaignOrchestratorFilename(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Campaign", @@ -208,7 +208,7 @@ func TestBuildActivationJobCampaignOrchestratorFilename(t *testing.T) { // TestBuildMainJobWithActivation tests building the main job with activation dependency func TestBuildMainJobWithActivation(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Initialize stepOrderTracker compiler.stepOrderTracker = NewStepOrderTracker() @@ -272,7 +272,7 @@ Test content` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -327,7 +327,7 @@ Test content` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -402,7 +402,7 @@ Test content` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -455,7 +455,7 @@ Test content` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -507,7 +507,7 @@ Test content` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -556,7 +556,7 @@ Test content` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } diff --git a/pkg/workflow/compiler_orchestrator_test.go b/pkg/workflow/compiler_orchestrator_test.go index 1c21440cbb..84b483dd8e 100644 --- a/pkg/workflow/compiler_orchestrator_test.go +++ b/pkg/workflow/compiler_orchestrator_test.go @@ -33,7 +33,7 @@ This is a valid main workflow with an 'on' field. testFile := filepath.Join(tmpDir, "main-workflow.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err, "Valid main workflow should parse successfully") require.NotNil(t, workflowData, "WorkflowData should not be nil") @@ -61,7 +61,7 @@ This can be imported by other workflows. testFile := filepath.Join(tmpDir, "shared-workflow.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) // Should return SharedWorkflowError @@ -86,7 +86,7 @@ This file has no frontmatter section. testFile := filepath.Join(tmpDir, "no-frontmatter.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.Error(t, err, "Should error when frontmatter is missing") @@ -112,7 +112,7 @@ Content testFile := filepath.Join(tmpDir, "invalid-yaml.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.Error(t, err, "Should error with invalid YAML") @@ -121,7 +121,7 @@ Content // TestParseWorkflowFile_PathTraversal tests path traversal protection func TestParseWorkflowFile_PathTraversal(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Try various path traversal patterns pathsToTest := []string{ @@ -151,7 +151,7 @@ engine: copilot testFile := filepath.Join(tmpDir, "no-markdown.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.Error(t, err, "Main workflow without markdown content should error") @@ -199,7 +199,7 @@ on: push testFile := filepath.Join(tmpDir, "engine-test-"+tt.name+".md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -233,7 +233,9 @@ Content require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) // Create compiler with engine override - compiler := NewCompiler(false, "claude", "test") + compiler := NewCompiler( + WithEngineOverride("claude"), + ) workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -282,7 +284,7 @@ network: testFile := filepath.Join(tmpDir, "network-test-"+tt.name+".md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -353,7 +355,7 @@ func TestParseWorkflowFile_StrictMode(t *testing.T) { testFile := filepath.Join(tmpDir, "strict-test-"+tt.name+".md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(tt.cliStrict, "", "test") + compiler := NewCompiler() _, err := compiler.ParseWorkflowFile(testFile) if tt.expectError { @@ -372,7 +374,7 @@ func ptrBool(b bool) *bool { // TestCopyFrontmatterWithoutInternalMarkers tests internal marker removal func TestCopyFrontmatterWithoutInternalMarkers(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -445,7 +447,7 @@ func TestCopyFrontmatterWithoutInternalMarkers(t *testing.T) { // TestDetectTextOutputUsageInOrchestrator tests text output detection in markdown func TestDetectTextOutputUsageInOrchestrator(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -523,7 +525,7 @@ Test content testFile := filepath.Join(tmpDir, "yaml-test.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -568,7 +570,7 @@ post-steps: testFile := filepath.Join(tmpDir, "post-steps.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -603,7 +605,7 @@ bots: testFile := filepath.Join(tmpDir, "configs.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -631,7 +633,7 @@ engine: copilot testFile := filepath.Join(tmpDir, "filters.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -662,7 +664,7 @@ Test content testFile := filepath.Join(tmpDir, "initial.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) diff --git a/pkg/workflow/compiler_performance_benchmark_test.go b/pkg/workflow/compiler_performance_benchmark_test.go index eee715d00f..e421532e81 100644 --- a/pkg/workflow/compiler_performance_benchmark_test.go +++ b/pkg/workflow/compiler_performance_benchmark_test.go @@ -38,7 +38,7 @@ Analyze the issue: ${{ needs.activation.outputs.text }} b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -99,7 +99,7 @@ Review the pull request: ${{ github.event.pull_request.number }} b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -150,7 +150,7 @@ Review and test the pull request with multiple tools. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -203,7 +203,7 @@ Standard workflow for memory profiling. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -244,7 +244,7 @@ Test parsing performance. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() b.ReportAllocs() @@ -289,7 +289,7 @@ Test validation performance. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) b.ResetTimer() @@ -326,7 +326,7 @@ Test YAML generation. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetNoEmit(true) b.ResetTimer() diff --git a/pkg/workflow/compiler_permissions_test.go b/pkg/workflow/compiler_permissions_test.go index e8c0460c4a..e936fd69a9 100644 --- a/pkg/workflow/compiler_permissions_test.go +++ b/pkg/workflow/compiler_permissions_test.go @@ -15,7 +15,7 @@ func TestRunsOnSection(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-runs-on-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -105,7 +105,7 @@ This is a test workflow. } func TestNetworkPermissionsDefaultBehavior(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tmpDir := testutil.TempDir(t, "test-*") diff --git a/pkg/workflow/compiler_poststeps_test.go b/pkg/workflow/compiler_poststeps_test.go index 82c85cf876..a6ffd7bd97 100644 --- a/pkg/workflow/compiler_poststeps_test.go +++ b/pkg/workflow/compiler_poststeps_test.go @@ -53,7 +53,7 @@ This workflow tests the post-steps functionality. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -138,7 +138,7 @@ This workflow tests post-steps without pre-steps. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -182,7 +182,7 @@ func TestStopAfterCompiledAway(t *testing.T) { // Test that stop-after is properly compiled away and doesn't appear in final YAML tmpDir := testutil.TempDir(t, "stop-after-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/compiler_reactions_numeric_test.go b/pkg/workflow/compiler_reactions_numeric_test.go index 70955e0c0a..7dbf275362 100644 --- a/pkg/workflow/compiler_reactions_numeric_test.go +++ b/pkg/workflow/compiler_reactions_numeric_test.go @@ -40,7 +40,7 @@ Test workflow with invalid reaction value. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow - should fail with validation error var err error @@ -123,7 +123,7 @@ Test workflow with numeric reaction value. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) if err != nil { @@ -168,7 +168,7 @@ Test workflow with invalid numeric reaction value. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow - should fail with validation error _, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/compiler_safe_outputs_config_test.go b/pkg/workflow/compiler_safe_outputs_config_test.go index 04c55fdb77..63fb131b72 100644 --- a/pkg/workflow/compiler_safe_outputs_config_test.go +++ b/pkg/workflow/compiler_safe_outputs_config_test.go @@ -214,7 +214,7 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -262,7 +262,7 @@ func TestAddHandlerManagerConfigEnvVar(t *testing.T) { // TestHandlerConfigMaxValues tests max value configuration func TestHandlerConfigMaxValues(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -304,7 +304,7 @@ func TestHandlerConfigMaxValues(t *testing.T) { // TestHandlerConfigAllowedLabels tests allowed labels configuration func TestHandlerConfigAllowedLabels(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -397,7 +397,7 @@ func TestHandlerConfigBooleanFields(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -468,7 +468,7 @@ func TestHandlerConfigUpdateFields(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -509,7 +509,7 @@ func TestHandlerConfigUpdateFields(t *testing.T) { // TestEmptySafeOutputsConfig tests behavior with no safe outputs func TestEmptySafeOutputsConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -525,7 +525,7 @@ func TestEmptySafeOutputsConfig(t *testing.T) { // TestHandlerConfigTargetRepo tests target-repo configuration func TestHandlerConfigTargetRepo(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -584,7 +584,7 @@ func TestHandlerConfigPatchSize(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -715,7 +715,7 @@ func TestAutoEnabledHandlers(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", diff --git a/pkg/workflow/compiler_safe_outputs_env_test.go b/pkg/workflow/compiler_safe_outputs_env_test.go index 3ac25a7cca..31855ed029 100644 --- a/pkg/workflow/compiler_safe_outputs_env_test.go +++ b/pkg/workflow/compiler_safe_outputs_env_test.go @@ -146,7 +146,7 @@ func TestAddAllSafeOutputConfigEnvVars(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if tt.trialMode { compiler.SetTrialMode(true) } @@ -174,7 +174,7 @@ func TestAddAllSafeOutputConfigEnvVars(t *testing.T) { // TestStagedFlagOnlyAddedOnce tests that staged flag is not duplicated func TestStagedFlagOnlyAddedOnce(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -206,7 +206,7 @@ func TestStagedFlagOnlyAddedOnce(t *testing.T) { // TestNoEnvVarsWhenNoSafeOutputs tests empty output when safe outputs is nil func TestNoEnvVarsWhenNoSafeOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -241,7 +241,7 @@ func TestStagedFlagWithTargetRepo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -269,7 +269,7 @@ func TestStagedFlagWithTargetRepo(t *testing.T) { // TestTrialModeOverridesStagedFlag tests that trial mode prevents staged flag func TestTrialModeOverridesStagedFlag(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetTrialMode(true) compiler.SetTrialLogicalRepoSlug("org/trial-repo") @@ -294,7 +294,7 @@ func TestTrialModeOverridesStagedFlag(t *testing.T) { // TestEnvVarsWithMultipleSafeOutputTypes tests comprehensive env var generation func TestEnvVarsWithMultipleSafeOutputTypes(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -333,7 +333,7 @@ func TestEnvVarsWithMultipleSafeOutputTypes(t *testing.T) { // TestEnvVarsWithNoStagedConfig tests that no staged flag is added when staged is false func TestEnvVarsWithNoStagedConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -361,7 +361,7 @@ func TestEnvVarsWithNoStagedConfig(t *testing.T) { // TestEnvVarFormatting tests that environment variables are correctly formatted func TestEnvVarFormatting(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -433,7 +433,7 @@ func TestStagedFlagPrecedence(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if tt.trialMode { compiler.SetTrialMode(true) } @@ -464,7 +464,7 @@ func TestStagedFlagPrecedence(t *testing.T) { // TestAddCommentsTargetRepoStagedBehavior tests staged flag behavior for add_comments with target-repo func TestAddCommentsTargetRepoStagedBehavior(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -490,7 +490,7 @@ func TestAddCommentsTargetRepoStagedBehavior(t *testing.T) { // TestAddLabelsTargetRepoStagedBehavior tests staged flag behavior for add_labels with target-repo func TestAddLabelsTargetRepoStagedBehavior(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", diff --git a/pkg/workflow/compiler_safe_outputs_job_test.go b/pkg/workflow/compiler_safe_outputs_job_test.go index ee3739041c..0a04463530 100644 --- a/pkg/workflow/compiler_safe_outputs_job_test.go +++ b/pkg/workflow/compiler_safe_outputs_job_test.go @@ -113,7 +113,7 @@ func TestBuildConsolidatedSafeOutputsJob(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ @@ -273,7 +273,7 @@ func TestBuildJobLevelSafeOutputEnvVars(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if tt.trialMode { compiler.SetTrialMode(true) } @@ -314,7 +314,7 @@ func TestBuildDetectionSuccessCondition(t *testing.T) { // TestJobConditionWithThreatDetection tests job condition building with threat detection func TestJobConditionWithThreatDetection(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ @@ -342,7 +342,7 @@ func TestJobConditionWithThreatDetection(t *testing.T) { // TestJobWithGitHubApp tests job building with GitHub App configuration func TestJobWithGitHubApp(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ @@ -374,7 +374,7 @@ func TestJobWithGitHubApp(t *testing.T) { // TestJobOutputs tests that job outputs are correctly configured func TestJobOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ @@ -441,7 +441,7 @@ func TestJobDependencies(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ diff --git a/pkg/workflow/compiler_safe_outputs_steps_test.go b/pkg/workflow/compiler_safe_outputs_steps_test.go index ba6aa5cca2..67c79a2990 100644 --- a/pkg/workflow/compiler_safe_outputs_steps_test.go +++ b/pkg/workflow/compiler_safe_outputs_steps_test.go @@ -112,7 +112,7 @@ func TestBuildConsolidatedSafeOutputStep(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -210,7 +210,7 @@ func TestBuildSharedPRCheckoutSteps(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if tt.trialMode { compiler.SetTrialMode(true) } @@ -266,7 +266,7 @@ func TestBuildSharedPRCheckoutStepsConditions(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() safeOutputs := &SafeOutputsConfig{} if tt.createPR { @@ -342,7 +342,7 @@ func TestBuildHandlerManagerStep(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -421,7 +421,7 @@ func TestBuildProjectHandlerManagerStep(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", @@ -443,7 +443,7 @@ func TestBuildProjectHandlerManagerStep(t *testing.T) { // TestStepOrderInConsolidatedJob tests that steps appear in correct order func TestStepOrderInConsolidatedJob(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ @@ -490,7 +490,7 @@ func TestStepOrderInConsolidatedJob(t *testing.T) { // TestHandlerManagerOrderWithProjects tests that project handler manager comes before general handler manager func TestHandlerManagerOrderWithProjects(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() workflowData := &WorkflowData{ @@ -535,7 +535,7 @@ func TestHandlerManagerOrderWithProjects(t *testing.T) { // TestStepWithoutCondition tests step building without condition func TestStepWithoutCondition(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := SafeOutputStepConfig{ StepName: "Test Step", @@ -591,7 +591,7 @@ func TestGitHubTokenPrecedence(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := SafeOutputStepConfig{ StepName: "Test Step", @@ -618,7 +618,7 @@ func TestGitHubTokenPrecedence(t *testing.T) { // TestScriptNameVsInlineScript tests the two modes of script inclusion func TestScriptNameVsInlineScript(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", diff --git a/pkg/workflow/compiler_shared_cache_test.go b/pkg/workflow/compiler_shared_cache_test.go index ea3c8ea06b..40d5c8ea17 100644 --- a/pkg/workflow/compiler_shared_cache_test.go +++ b/pkg/workflow/compiler_shared_cache_test.go @@ -16,7 +16,7 @@ func TestCompilerSharedActionCache(t *testing.T) { t.Chdir(tmpDir) // Create a compiler instance - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Get the shared action resolver (first time - should initialize) cache1, resolver1 := compiler.getSharedActionResolver() @@ -92,7 +92,7 @@ Test content } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) compiler.SetNoEmit(true) @@ -134,7 +134,7 @@ func TestCompilerForceRefreshClearsOnlyOnce(t *testing.T) { t.Chdir(tmpDir) // Create a compiler with forceRefreshActionPins enabled - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetForceRefreshActionPins(true) // Get the shared action resolver (first time - should initialize empty) diff --git a/pkg/workflow/compiler_template_validation_test.go b/pkg/workflow/compiler_template_validation_test.go index dbe28ca367..5073d6af95 100644 --- a/pkg/workflow/compiler_template_validation_test.go +++ b/pkg/workflow/compiler_template_validation_test.go @@ -114,7 +114,7 @@ Second template } // Try to compile the workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() _, err = compiler.ParseWorkflowFile(workflowPath) if tt.shouldError { diff --git a/pkg/workflow/compiler_test.go b/pkg/workflow/compiler_test.go index 4cce69f53c..5f8f46f0a5 100644 --- a/pkg/workflow/compiler_test.go +++ b/pkg/workflow/compiler_test.go @@ -40,7 +40,7 @@ This is a test workflow for compilation. testFile := filepath.Join(tmpDir, "test-workflow.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.NoError(t, err, "Valid workflow should compile without errors") @@ -62,7 +62,7 @@ This is a test workflow for compilation. // TestCompileWorkflow_NonexistentFile tests error handling for missing files func TestCompileWorkflow_NonexistentFile(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow("/nonexistent/file.md") require.Error(t, err, "Should error with nonexistent file") assert.Contains(t, err.Error(), "failed to read file", "Error should mention file read failure") @@ -70,7 +70,7 @@ func TestCompileWorkflow_NonexistentFile(t *testing.T) { // TestCompileWorkflow_EmptyPath tests error handling for empty path func TestCompileWorkflow_EmptyPath(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow("") require.Error(t, err, "Should error with empty path") } @@ -88,7 +88,7 @@ This workflow has no frontmatter. testFile := filepath.Join(tmpDir, "no-frontmatter.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.Error(t, err, "Should error when frontmatter is missing") assert.Contains(t, err.Error(), "frontmatter", "Error should mention frontmatter") @@ -112,7 +112,7 @@ Content here. testFile := filepath.Join(tmpDir, "invalid-frontmatter.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.Error(t, err, "Should error with invalid YAML frontmatter") } @@ -131,7 +131,7 @@ engine: copilot testFile := filepath.Join(tmpDir, "no-markdown.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.Error(t, err, "Should error when markdown content is missing") assert.Contains(t, err.Error(), "markdown content", "Error should mention markdown content") @@ -158,7 +158,7 @@ Campaign orchestrator workflow. testFile := filepath.Join(tmpDir, "test.campaign.g.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.NoError(t, err, "Campaign orchestrator should compile") @@ -192,7 +192,7 @@ Test content ` require.NoError(t, os.WriteFile(markdownPath, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflowData(workflowData, markdownPath) require.NoError(t, err, "CompileWorkflowData should succeed with valid data") @@ -222,7 +222,7 @@ This is a normal workflow that should generate a reasonable-sized lock file. testFile := filepath.Join(tmpDir, "size-test.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.NoError(t, err, "Workflow should compile") @@ -253,7 +253,7 @@ This workflow is missing the required 'on' field. testFile := filepath.Join(tmpDir, "invalid.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) require.Error(t, err, "Should error with validation issues") @@ -265,7 +265,7 @@ This workflow is missing the required 'on' field. // TestCompileWorkflow_PathTraversal tests that path traversal attempts are handled safely func TestCompileWorkflow_PathTraversal(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Try a path with traversal elements err := compiler.CompileWorkflow("../../etc/passwd") @@ -293,7 +293,7 @@ engine: copilot ` require.NoError(t, os.WriteFile(markdownPath, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // First compilation err := compiler.CompileWorkflowData(workflowData, markdownPath) diff --git a/pkg/workflow/compiler_timeout_default_test.go b/pkg/workflow/compiler_timeout_default_test.go index 3c911bfca3..90b47e30ad 100644 --- a/pkg/workflow/compiler_timeout_default_test.go +++ b/pkg/workflow/compiler_timeout_default_test.go @@ -72,7 +72,7 @@ strict: false } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/compiler_types.go b/pkg/workflow/compiler_types.go index 94f469e63d..1c10078fab 100644 --- a/pkg/workflow/compiler_types.go +++ b/pkg/workflow/compiler_types.go @@ -9,11 +9,84 @@ import ( var logTypes = logger.New("workflow:compiler_types") +// CompilerOption is a functional option for configuring a Compiler +type CompilerOption func(*Compiler) + +// WithVerbose sets the verbose logging flag +func WithVerbose(verbose bool) CompilerOption { + return func(c *Compiler) { c.verbose = verbose } +} + +// WithEngineOverride sets the AI engine override +func WithEngineOverride(engine string) CompilerOption { + return func(c *Compiler) { c.engineOverride = engine } +} + +// WithCustomOutput sets a custom output path for the compiled workflow +func WithCustomOutput(path string) CompilerOption { + return func(c *Compiler) { c.customOutput = path } +} + +// WithVersion overrides the auto-detected version +func WithVersion(version string) CompilerOption { + return func(c *Compiler) { c.version = version } +} + +// WithActionMode overrides the auto-detected action mode +func WithActionMode(mode ActionMode) CompilerOption { + return func(c *Compiler) { c.actionMode = mode } +} + +// WithSkipValidation configures whether to skip schema validation +func WithSkipValidation(skip bool) CompilerOption { + return func(c *Compiler) { c.skipValidation = skip } +} + +// WithNoEmit configures whether to validate without generating lock files +func WithNoEmit(noEmit bool) CompilerOption { + return func(c *Compiler) { c.noEmit = noEmit } +} + +// WithStrictMode configures whether to enable strict validation mode +func WithStrictMode(strict bool) CompilerOption { + return func(c *Compiler) { c.strictMode = strict } +} + +// WithForceRefreshActionPins configures whether to force refresh of action pins +func WithForceRefreshActionPins(force bool) CompilerOption { + return func(c *Compiler) { c.forceRefreshActionPins = force } +} + +// WithWorkflowIdentifier sets the identifier for the current workflow being compiled +func WithWorkflowIdentifier(identifier string) CompilerOption { + return func(c *Compiler) { c.workflowIdentifier = identifier } +} + +// WithRepositorySlug sets the repository slug for schedule scattering +func WithRepositorySlug(slug string) CompilerOption { + return func(c *Compiler) { c.repositorySlug = slug } +} + // FileTracker interface for tracking files created during compilation type FileTracker interface { TrackCreated(filePath string) } +// defaultVersion holds the version string for compiler creation +// This is set by the CLI package during initialization +var defaultVersion = "dev" + +// SetDefaultVersion sets the default version for compiler creation +// This should be called once during CLI initialization +func SetDefaultVersion(version string) { + defaultVersion = version +} + +// GetDefaultVersion returns the default version +func GetDefaultVersion() string { + return defaultVersion +} + // Compiler handles converting markdown workflows to GitHub Actions YAML type Compiler struct { verbose bool @@ -48,14 +121,20 @@ type Compiler struct { scheduleFriendlyFormats map[int]string // Maps schedule item index to friendly format string for current workflow } -// NewCompiler creates a new workflow compiler with optional configuration -func NewCompiler(verbose bool, engineOverride string, version string) *Compiler { +// NewCompiler creates a new workflow compiler with functional options. +// By default, it auto-detects the version and action mode. +// Common options: WithVerbose, WithEngineOverride, WithCustomOutput, WithVersion, WithActionMode +func NewCompiler(opts ...CompilerOption) *Compiler { + // Get default version + version := defaultVersion + + // Create compiler with defaults c := &Compiler{ - verbose: verbose, - engineOverride: engineOverride, + verbose: false, + engineOverride: "", version: version, - skipValidation: true, // Skip validation by default for now since existing workflows don't fully comply - actionMode: ActionModeDev, // Default to dev mode (local action paths) + skipValidation: true, // Skip validation by default for now since existing workflows don't fully comply + actionMode: DetectActionMode(version), // Auto-detect action mode based on version jobManager: NewJobManager(), engineRegistry: GetGlobalEngineRegistry(), stepOrderTracker: NewStepOrderTracker(), @@ -63,28 +142,25 @@ func NewCompiler(verbose bool, engineOverride string, version string) *Compiler actionPinWarnings: make(map[string]bool), // Initialize warning cache } - return c -} - -// NewCompilerWithCustomOutput creates a new workflow compiler with custom output path -func NewCompilerWithCustomOutput(verbose bool, engineOverride string, customOutput string, version string) *Compiler { - c := &Compiler{ - verbose: verbose, - engineOverride: engineOverride, - customOutput: customOutput, - version: version, - skipValidation: true, // Skip validation by default for now since existing workflows don't fully comply - actionMode: ActionModeDev, // Default to dev mode (local action paths) - jobManager: NewJobManager(), - engineRegistry: GetGlobalEngineRegistry(), - stepOrderTracker: NewStepOrderTracker(), - artifactManager: NewArtifactManager(), - actionPinWarnings: make(map[string]bool), // Initialize warning cache + // Apply functional options + for _, opt := range opts { + opt(c) } + // Auto-detect action mode based on version in case version has been update + c.actionMode = DetectActionMode(c.version) return c } +// NewCompilerWithVersion creates a new workflow compiler with the legacy signature. +// Deprecated: Use NewCompiler with functional options instead. +// This function is kept for backward compatibility during migration. +func NewCompilerWithVersion(version string) *Compiler { + return NewCompiler( + WithVersion(version), + ) +} + // SetSkipValidation configures whether to skip schema validation func (c *Compiler) SetSkipValidation(skip bool) { c.skipValidation = skip diff --git a/pkg/workflow/compiler_validation_test.go b/pkg/workflow/compiler_validation_test.go index f9498d9600..19ffa63bd4 100644 --- a/pkg/workflow/compiler_validation_test.go +++ b/pkg/workflow/compiler_validation_test.go @@ -15,7 +15,7 @@ import ( func TestExtractTopLevelYAMLSection_NestedEnvIssue(t *testing.T) { // This test verifies the fix for the nested env issue where // tools.mcps.*.env was being confused with top-level env - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create frontmatter with nested env under tools.notionApi.env // but NO top-level env section @@ -146,7 +146,7 @@ This is a test workflow with nested env. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) } @@ -227,7 +227,7 @@ This is a test workflow. } // Compile the workflow - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -293,7 +293,7 @@ This is a test workflow. } func TestValidateWorkflowSchema(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(false) // Enable validation for testing tests := []struct { @@ -404,7 +404,7 @@ jobs: } } func TestValidationCanBeSkipped(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test via CompileWorkflow - should succeed because validation is skipped by default tmpDir := testutil.TempDir(t, "validation-skip-test") @@ -455,7 +455,7 @@ This workflow tests that frontmatter is NOT embedded in the lock file (removed p t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -485,7 +485,7 @@ This workflow tests that frontmatter is NOT embedded in the lock file (removed p func TestDescriptionFieldRendering(t *testing.T) { tmpDir := testutil.TempDir(t, "description-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -649,7 +649,7 @@ This is a test workflow to verify description field rendering. } func TestGenerateJobName(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/compiler_yaml_helpers_test.go b/pkg/workflow/compiler_yaml_helpers_test.go index 4cc173780a..f390401fb1 100644 --- a/pkg/workflow/compiler_yaml_helpers_test.go +++ b/pkg/workflow/compiler_yaml_helpers_test.go @@ -71,7 +71,7 @@ func TestBuildJobsAndValidate(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := tt.setupData() err := compiler.buildJobsAndValidate(data, "test.md") @@ -183,7 +183,7 @@ func TestGenerateWorkflowHeader(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() var yaml strings.Builder compiler.generateWorkflowHeader(&yaml, tt.data) @@ -259,7 +259,7 @@ func TestGenerateWorkflowBody(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.jobManager = NewJobManager() if tt.setupJobs != nil { @@ -317,7 +317,7 @@ func TestGenerateYAMLRefactored(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() result, err := compiler.generateYAML(tt.data, "test.md") diff --git a/pkg/workflow/compiler_yaml_logo_test.go b/pkg/workflow/compiler_yaml_logo_test.go index 279ae187c6..3faf45eb8a 100644 --- a/pkg/workflow/compiler_yaml_logo_test.go +++ b/pkg/workflow/compiler_yaml_logo_test.go @@ -8,7 +8,7 @@ import ( // TestASCIILogoAlignment verifies that the ASCII logo in generated YAML // preserves leading spaces on the first line for proper alignment func TestASCIILogoAlignment(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create a minimal workflow for testing data := &WorkflowData{ diff --git a/pkg/workflow/compiler_yaml_test.go b/pkg/workflow/compiler_yaml_test.go index 4fc4278a27..d24a4dc791 100644 --- a/pkg/workflow/compiler_yaml_test.go +++ b/pkg/workflow/compiler_yaml_test.go @@ -302,7 +302,7 @@ YAML error that demonstrates column position handling.`, } // Create compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Attempt compilation - should fail with proper error formatting err := compiler.CompileWorkflow(testFile) @@ -427,7 +427,7 @@ Test content.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err == nil { t.Errorf("%s: expected compilation to fail", tt.description) @@ -474,7 +474,7 @@ Test content.`, // TestConvertGoPatternToJavaScript tests the convertGoPatternToJavaScript method func TestConvertGoPatternToJavaScript(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -520,7 +520,7 @@ func TestConvertGoPatternToJavaScript(t *testing.T) { } func TestAddCustomStepsAsIsBasic(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -600,7 +600,7 @@ This is a test workflow.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -652,7 +652,7 @@ Test content.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -693,7 +693,7 @@ Test content.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -738,7 +738,7 @@ Test content.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -782,7 +782,7 @@ Test content.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -825,7 +825,7 @@ Test content.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -886,7 +886,7 @@ Test content.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("CompileWorkflow() error: %v", err) } @@ -916,7 +916,7 @@ func TestGenerateYAMLStripsANSIFromImportedFiles(t *testing.T) { // Create a workflow that will have imported files // We'll create it manually by modifying WorkflowData - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create a simple workflow file first frontmatter := `--- @@ -987,7 +987,7 @@ func TestGenerateYAMLStripsANSIFromStopTimeAndManualApproval(t *testing.T) { tmpDir := testutil.TempDir(t, "yaml-ansi-stoptime-test") // Create workflow with stop-time and manual-approval containing ANSI codes - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- name: Test Workflow @@ -1050,7 +1050,7 @@ Test content.` func TestGenerateYAMLStripsANSIMultilineDescription(t *testing.T) { tmpDir := testutil.TempDir(t, "yaml-ansi-multiline-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create workflow with simple description first frontmatter := `--- diff --git a/pkg/workflow/compute_text_lazy_test.go b/pkg/workflow/compute_text_lazy_test.go index 3c7cd3e750..71767f3a50 100644 --- a/pkg/workflow/compute_text_lazy_test.go +++ b/pkg/workflow/compute_text_lazy_test.go @@ -77,7 +77,7 @@ Create a report based on repository analysis.` t.Fatalf("Failed to write workflow without text: %v", err) } - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Test workflow WITH text usage t.Run("workflow_with_text_usage", func(t *testing.T) { @@ -149,7 +149,7 @@ Create a report based on repository analysis.` } func TestDetectTextOutputUsage(t *testing.T) { - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/concurrency_test.go b/pkg/workflow/concurrency_test.go index 4203ef1881..b88d623b2a 100644 --- a/pkg/workflow/concurrency_test.go +++ b/pkg/workflow/concurrency_test.go @@ -13,7 +13,7 @@ func TestConcurrencyRules(t *testing.T) { // Test the new concurrency rules for pull_request and alias workflows tmpDir := testutil.TempDir(t, "concurrency-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/container_services_test.go b/pkg/workflow/container_services_test.go index 8dce9cfd48..b843ebf610 100644 --- a/pkg/workflow/container_services_test.go +++ b/pkg/workflow/container_services_test.go @@ -105,7 +105,7 @@ This is a test without container.`, } // Parse the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) @@ -262,7 +262,7 @@ This is a test without services.`, } // Parse the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) @@ -355,7 +355,7 @@ This workflow uses both container and services.` } // Parse and generate YAML - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) diff --git a/pkg/workflow/copilot_engine_test.go b/pkg/workflow/copilot_engine_test.go index 95b583b5be..a252a9e942 100644 --- a/pkg/workflow/copilot_engine_test.go +++ b/pkg/workflow/copilot_engine_test.go @@ -931,7 +931,7 @@ This workflow tests that Copilot log parsing uses the correct log file path. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/copilot_git_commands_integration_test.go b/pkg/workflow/copilot_git_commands_integration_test.go index 946876d981..7a9fa230ca 100644 --- a/pkg/workflow/copilot_git_commands_integration_test.go +++ b/pkg/workflow/copilot_git_commands_integration_test.go @@ -23,7 +23,7 @@ safe-outputs: This is a test workflow that should automatically get Git commands when create-pull-request is enabled. ` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow content and get both result and allowed tools arguments for Copilot _, allowedToolArgs, err := compiler.parseCopilotWorkflowMarkdownContentWithToolArgs(workflowContent) @@ -75,7 +75,7 @@ safe-outputs: This workflow should NOT get Git commands since it doesn't use create-pull-request or push-to-pull-request-branch. ` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow content and get allowed tool arguments _, allowedToolArgs, err := compiler.parseCopilotWorkflowMarkdownContentWithToolArgs(workflowContent) diff --git a/pkg/workflow/copy_project_test.go b/pkg/workflow/copy_project_test.go index 679d282fc3..e1c6d622cc 100644 --- a/pkg/workflow/copy_project_test.go +++ b/pkg/workflow/copy_project_test.go @@ -67,7 +67,7 @@ func TestCopyProjectConfiguration(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse frontmatter config := compiler.extractSafeOutputsConfig(tt.frontmatter) @@ -153,7 +153,7 @@ func TestCopyProjectGitHubTokenEnvVar(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse frontmatter workflowData := &WorkflowData{ @@ -195,7 +195,7 @@ func TestCopyProjectGitHubTokenEnvVar(t *testing.T) { // TestCopyProjectStepCondition verifies that the copy_project step has the correct condition func TestCopyProjectStepCondition(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := map[string]any{ "name": "Test Workflow", @@ -301,7 +301,7 @@ func TestCopyProjectSourceAndTargetConfiguration(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse frontmatter config := compiler.extractSafeOutputsConfig(tt.frontmatter) diff --git a/pkg/workflow/create_agent_session_test.go b/pkg/workflow/create_agent_session_test.go index 3120c37782..706e33f682 100644 --- a/pkg/workflow/create_agent_session_test.go +++ b/pkg/workflow/create_agent_session_test.go @@ -74,7 +74,7 @@ func TestParseAgentTaskConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := compiler.parseAgentSessionConfig(tt.outputMap) if (config != nil) != tt.wantConfig { @@ -98,7 +98,7 @@ func TestParseAgentTaskConfig(t *testing.T) { } func TestBuildCreateOutputAgentTaskJob(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", SafeOutputs: &SafeOutputsConfig{ @@ -151,7 +151,7 @@ func TestBuildCreateOutputAgentTaskJob(t *testing.T) { } func TestExtractSafeOutputsConfigWithAgentTask(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := map[string]any{ "safe-outputs": map[string]any{ "create-agent-session": map[string]any{ diff --git a/pkg/workflow/create_issue_assignees_integration_test.go b/pkg/workflow/create_issue_assignees_integration_test.go index 4fadffb8cb..eefead3471 100644 --- a/pkg/workflow/create_issue_assignees_integration_test.go +++ b/pkg/workflow/create_issue_assignees_integration_test.go @@ -42,7 +42,7 @@ This is a test workflow that should create an issue and assign it to multiple us } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -118,7 +118,7 @@ This workflow should compile successfully without assignees configuration. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -177,7 +177,7 @@ Create an issue and assign to copilot. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -239,7 +239,7 @@ Create an issue with a single assignee. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/create_issue_backward_compat_test.go b/pkg/workflow/create_issue_backward_compat_test.go index 3d7afbb6d4..690bb26eca 100644 --- a/pkg/workflow/create_issue_backward_compat_test.go +++ b/pkg/workflow/create_issue_backward_compat_test.go @@ -44,7 +44,7 @@ This workflow uses the old format without assignees and should continue to work. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Legacy workflow should compile without errors: %v", err) } @@ -118,7 +118,7 @@ Create an issue with minimal configuration. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Minimal workflow should compile without errors: %v", err) } diff --git a/pkg/workflow/create_issue_group_test.go b/pkg/workflow/create_issue_group_test.go index bc3194d242..42de7f6fef 100644 --- a/pkg/workflow/create_issue_group_test.go +++ b/pkg/workflow/create_issue_group_test.go @@ -75,7 +75,7 @@ Test content`, testFile := filepath.Join(tmpDir, "test-workflow.md") require.NoError(t, os.WriteFile(testFile, []byte(tt.frontmatter), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() require.NoError(t, compiler.CompileWorkflow(testFile)) // Parse the workflow to check the config @@ -113,7 +113,7 @@ Create test issues with grouping. require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() require.NoError(t, compiler.CompileWorkflow(testFile)) // Read the compiled output @@ -153,7 +153,7 @@ Test grouping without explicit issues permission. require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) // Compile the workflow - should succeed (safe-outputs doesn't require explicit permission) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() require.NoError(t, compiler.CompileWorkflow(testFile)) // Read the compiled output @@ -193,7 +193,7 @@ Test grouping with title prefix. require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() require.NoError(t, compiler.CompileWorkflow(testFile)) // Read the compiled output @@ -231,7 +231,7 @@ Test MCP config with group. require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() require.NoError(t, compiler.CompileWorkflow(testFile)) // Read the compiled output diff --git a/pkg/workflow/create_issue_handler_config_test.go b/pkg/workflow/create_issue_handler_config_test.go index f0a7c2faf4..20af61abee 100644 --- a/pkg/workflow/create_issue_handler_config_test.go +++ b/pkg/workflow/create_issue_handler_config_test.go @@ -38,7 +38,7 @@ Create an issue with title "Test" and body "Test body". } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -149,7 +149,7 @@ Create an issue. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -231,7 +231,7 @@ Create an issue. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/create_project_status_update_handler_config_test.go b/pkg/workflow/create_project_status_update_handler_config_test.go index a8b3dc79c6..312d9eb050 100644 --- a/pkg/workflow/create_project_status_update_handler_config_test.go +++ b/pkg/workflow/create_project_status_update_handler_config_test.go @@ -36,7 +36,7 @@ Test workflow require.NoError(t, err, "Failed to write test markdown file") // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err = compiler.CompileWorkflow(mdFile) require.NoError(t, err, "Failed to compile workflow") @@ -86,7 +86,7 @@ Test workflow require.NoError(t, err, "Failed to write test markdown file") // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err = compiler.CompileWorkflow(mdFile) require.NoError(t, err, "Failed to compile workflow") @@ -148,7 +148,7 @@ Test workflow require.NoError(t, err, "Failed to write test markdown file") // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err = compiler.CompileWorkflow(mdFile) require.NoError(t, err, "Failed to compile workflow") diff --git a/pkg/workflow/create_project_test.go b/pkg/workflow/create_project_test.go index c53f630f15..b126d4f593 100644 --- a/pkg/workflow/create_project_test.go +++ b/pkg/workflow/create_project_test.go @@ -177,7 +177,7 @@ func TestParseCreateProjectsConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := compiler.parseCreateProjectsConfig(tt.outputMap) if tt.expectedNil { @@ -212,7 +212,7 @@ func TestParseCreateProjectsConfig(t *testing.T) { } func TestCreateProjectsConfig_DefaultMax(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() outputMap := map[string]any{ "create-project": map[string]any{ @@ -228,7 +228,7 @@ func TestCreateProjectsConfig_DefaultMax(t *testing.T) { } func TestCreateProjectsConfig_ViewsParsing(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() outputMap := map[string]any{ "create-project": map[string]any{ @@ -263,7 +263,7 @@ func TestCreateProjectsConfig_ViewsParsing(t *testing.T) { } func TestCreateProjectsConfig_FieldDefinitionsParsing(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() outputMap := map[string]any{ "create-project": map[string]any{ @@ -307,7 +307,7 @@ func TestCreateProjectsConfig_FieldDefinitionsParsing(t *testing.T) { } func TestCreateProjectsConfig_FieldDefinitionsWithUnderscores(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test underscore variant of field-definitions and data-type outputMap := map[string]any{ @@ -331,7 +331,7 @@ func TestCreateProjectsConfig_FieldDefinitionsWithUnderscores(t *testing.T) { } func TestCreateProjectsConfig_ViewsAndFieldDefinitions(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() outputMap := map[string]any{ "create-project": map[string]any{ diff --git a/pkg/workflow/create_project_token_test.go b/pkg/workflow/create_project_token_test.go index ec4d02ee25..0cb074135e 100644 --- a/pkg/workflow/create_project_token_test.go +++ b/pkg/workflow/create_project_token_test.go @@ -68,7 +68,7 @@ func TestCreateProjectGitHubTokenEnvVar(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse frontmatter workflowData := &WorkflowData{ diff --git a/pkg/workflow/create_pull_request_reviewers_integration_test.go b/pkg/workflow/create_pull_request_reviewers_integration_test.go index dcba6ea177..e0ce52793e 100644 --- a/pkg/workflow/create_pull_request_reviewers_integration_test.go +++ b/pkg/workflow/create_pull_request_reviewers_integration_test.go @@ -43,7 +43,7 @@ Create a pull request with reviewers. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -109,7 +109,7 @@ Create a pull request with a single reviewer. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -170,7 +170,7 @@ Create a pull request without reviewers. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/custom_action_copilot_token_test.go b/pkg/workflow/custom_action_copilot_token_test.go index 7c586903c5..945f5176ce 100644 --- a/pkg/workflow/custom_action_copilot_token_test.go +++ b/pkg/workflow/custom_action_copilot_token_test.go @@ -11,7 +11,7 @@ import ( // TestCustomActionCopilotTokenFallback tests that custom actions use the correct // Copilot token fallback when no custom token is provided func TestCustomActionCopilotTokenFallback(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Register a test custom action testScript := `console.log('test');` diff --git a/pkg/workflow/custom_engine_awinfo_test.go b/pkg/workflow/custom_engine_awinfo_test.go index b6237a5adb..8eeb722183 100644 --- a/pkg/workflow/custom_engine_awinfo_test.go +++ b/pkg/workflow/custom_engine_awinfo_test.go @@ -9,7 +9,7 @@ import ( func TestGenerateCreateAwInfoCustomEngine(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() t.Run("custom engine with explicit model", func(t *testing.T) { workflowData := &WorkflowData{ diff --git a/pkg/workflow/custom_engine_integration_test.go b/pkg/workflow/custom_engine_integration_test.go index d2cab7cd4f..e7782d1011 100644 --- a/pkg/workflow/custom_engine_integration_test.go +++ b/pkg/workflow/custom_engine_integration_test.go @@ -98,7 +98,7 @@ Simple custom workflow with one step.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Skip validation for test simplicity err := compiler.CompileWorkflow(testFile) @@ -159,7 +159,7 @@ This workflow uses the custom engine but doesn't define any steps.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/dependabot_test.go b/pkg/workflow/dependabot_test.go index 3fa8b12d86..d55e26e513 100644 --- a/pkg/workflow/dependabot_test.go +++ b/pkg/workflow/dependabot_test.go @@ -71,7 +71,7 @@ func TestParseNpmPackage(t *testing.T) { } func TestCollectNpmDependencies(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -148,7 +148,7 @@ func TestCollectNpmDependencies(t *testing.T) { } func TestGeneratePackageJSON(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") packageJSONPath := filepath.Join(tempDir, "package.json") @@ -200,7 +200,7 @@ func TestGeneratePackageJSON(t *testing.T) { } func TestGeneratePackageJSON_MergeExisting(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") packageJSONPath := filepath.Join(tempDir, "package.json") @@ -258,7 +258,7 @@ func TestGeneratePackageJSON_MergeExisting(t *testing.T) { } func TestGenerateDependabotConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") dependabotPath := filepath.Join(tempDir, "dependabot.yml") @@ -307,7 +307,7 @@ func TestGenerateDependabotConfig(t *testing.T) { } func TestGenerateDependabotConfig_PreserveExisting(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") dependabotPath := filepath.Join(tempDir, "dependabot.yml") @@ -343,7 +343,7 @@ func TestGenerateDependabotConfig_PreserveExisting(t *testing.T) { } func TestGenerateDependabotManifests_NoDependencies(t *testing.T) { - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") // Workflow with no npm dependencies @@ -366,7 +366,7 @@ func TestGenerateDependabotManifests_NoDependencies(t *testing.T) { } func TestGenerateDependabotManifests_WithDependencies(t *testing.T) { - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") workflowDir := filepath.Join(tempDir, ".github", "workflows") os.MkdirAll(workflowDir, 0755) @@ -402,7 +402,7 @@ func TestGenerateDependabotManifests_WithDependencies(t *testing.T) { } func TestGenerateDependabotManifests_StrictMode(t *testing.T) { - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) tempDir := testutil.TempDir(t, "test-*") workflowDir := filepath.Join(tempDir, ".github", "workflows") @@ -484,7 +484,7 @@ func TestParsePipPackage(t *testing.T) { } func TestCollectPipDependencies(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -561,7 +561,7 @@ func TestCollectPipDependencies(t *testing.T) { } func TestGenerateRequirementsTxt(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") requirementsPath := filepath.Join(tempDir, "requirements.txt") @@ -639,7 +639,7 @@ func TestParseGoPackage(t *testing.T) { } func TestCollectGoDependencies(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -716,7 +716,7 @@ func TestCollectGoDependencies(t *testing.T) { } func TestGenerateGoMod(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") goModPath := filepath.Join(tempDir, "go.mod") @@ -760,7 +760,7 @@ func TestGenerateGoMod(t *testing.T) { // Tests for multi-ecosystem support func TestGenerateDependabotConfig_MultipleEcosystems(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") dependabotPath := filepath.Join(tempDir, "dependabot.yml") @@ -820,7 +820,7 @@ func TestGenerateDependabotConfig_MultipleEcosystems(t *testing.T) { } func TestGenerateDependabotManifests_AllEcosystems(t *testing.T) { - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() tempDir := testutil.TempDir(t, "test-*") workflowDir := filepath.Join(tempDir, ".github", "workflows") os.MkdirAll(workflowDir, 0755) diff --git a/pkg/workflow/detection_success_test.go b/pkg/workflow/detection_success_test.go index 7935a86084..09f1dc5fb0 100644 --- a/pkg/workflow/detection_success_test.go +++ b/pkg/workflow/detection_success_test.go @@ -34,7 +34,7 @@ Create an issue. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile: %v", err) } @@ -102,7 +102,7 @@ Create outputs. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile: %v", err) } diff --git a/pkg/workflow/docker_predownload_test.go b/pkg/workflow/docker_predownload_test.go index 78e0ffcb8d..97c5a843df 100644 --- a/pkg/workflow/docker_predownload_test.go +++ b/pkg/workflow/docker_predownload_test.go @@ -196,7 +196,7 @@ Test workflow - safe outputs MCP server without GitHub tool.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -252,7 +252,7 @@ Test workflow.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/domains_protocol_integration_test.go b/pkg/workflow/domains_protocol_integration_test.go index 581b5ffd57..446f6fa8e5 100644 --- a/pkg/workflow/domains_protocol_integration_test.go +++ b/pkg/workflow/domains_protocol_integration_test.go @@ -111,7 +111,7 @@ Test protocol-specific domains in safe-outputs. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -227,7 +227,7 @@ Test valid HTTPS protocol. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if tt.wantErr && err == nil { @@ -268,7 +268,7 @@ Test backward compatibility with domains without protocols. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/duplicate_step_validation_integration_test.go b/pkg/workflow/duplicate_step_validation_integration_test.go index d717af6801..58ce2c9341 100644 --- a/pkg/workflow/duplicate_step_validation_integration_test.go +++ b/pkg/workflow/duplicate_step_validation_integration_test.go @@ -41,7 +41,7 @@ This workflow tests that duplicate checkout steps are properly deduplicated. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(mdFile) if err != nil { // The error should NOT be about duplicate steps since we fixed the bug diff --git a/pkg/workflow/engine_agent_import_test.go b/pkg/workflow/engine_agent_import_test.go index cb10d95b1e..8c99c148ed 100644 --- a/pkg/workflow/engine_agent_import_test.go +++ b/pkg/workflow/engine_agent_import_test.go @@ -223,7 +223,7 @@ This is a test agent file. // Test 1: Valid agent file t.Run("valid_agent_file", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", @@ -240,7 +240,7 @@ This is a test agent file. // Test 2: Non-existent agent file t.Run("nonexistent_agent_file", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", @@ -259,7 +259,7 @@ This is a test agent file. // Test 3: No agent file specified t.Run("no_agent_file", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", @@ -275,7 +275,7 @@ This is a test agent file. // Test 4: Nil engine config t.Run("nil_engine_config", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{} workflowPath := filepath.Join(workflowsDir, "test.md") @@ -289,7 +289,7 @@ This is a test agent file. // TestCheckoutWithAgentFromImports tests that checkout step is added when agent file is imported func TestCheckoutWithAgentFromImports(t *testing.T) { t.Run("checkout_added_with_agent", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", @@ -305,7 +305,7 @@ func TestCheckoutWithAgentFromImports(t *testing.T) { }) t.Run("checkout_added_with_agent_no_contents_permission", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", @@ -321,7 +321,7 @@ func TestCheckoutWithAgentFromImports(t *testing.T) { }) t.Run("no_checkout_without_agent_and_permissions", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", @@ -336,7 +336,7 @@ func TestCheckoutWithAgentFromImports(t *testing.T) { }) t.Run("checkout_with_custom_steps_containing_checkout", func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ EngineConfig: &EngineConfig{ ID: "copilot", diff --git a/pkg/workflow/engine_args_integration_test.go b/pkg/workflow/engine_args_integration_test.go index b415283dce..075447aff9 100644 --- a/pkg/workflow/engine_args_integration_test.go +++ b/pkg/workflow/engine_args_integration_test.go @@ -33,7 +33,7 @@ This is a test workflow to verify engine args injection. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -87,7 +87,7 @@ This is a test workflow to verify multiple engine args injection. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -143,7 +143,7 @@ This is a test workflow without engine args. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -192,7 +192,7 @@ This is a test workflow to verify claude engine args injection. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -239,7 +239,7 @@ This is a test workflow to verify codex engine args injection. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/engine_args_test.go b/pkg/workflow/engine_args_test.go index 13e44b6143..1201f47db0 100644 --- a/pkg/workflow/engine_args_test.go +++ b/pkg/workflow/engine_args_test.go @@ -6,7 +6,7 @@ import ( ) func TestEngineArgsFieldExtraction(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("Engine args field extraction with []any", func(t *testing.T) { frontmatter := map[string]any{ diff --git a/pkg/workflow/engine_concurrency_integration_test.go b/pkg/workflow/engine_concurrency_integration_test.go index fc1664e577..f03949fa92 100644 --- a/pkg/workflow/engine_concurrency_integration_test.go +++ b/pkg/workflow/engine_concurrency_integration_test.go @@ -136,7 +136,7 @@ Test content`, } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/engine_concurrency_test.go b/pkg/workflow/engine_concurrency_test.go index c2ced91fcb..b27e1afaac 100644 --- a/pkg/workflow/engine_concurrency_test.go +++ b/pkg/workflow/engine_concurrency_test.go @@ -5,7 +5,7 @@ import ( ) func TestExtractEngineConcurrencyField(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/engine_config_test.go b/pkg/workflow/engine_config_test.go index f0140d3f17..d24d47d2a7 100644 --- a/pkg/workflow/engine_config_test.go +++ b/pkg/workflow/engine_config_test.go @@ -11,7 +11,7 @@ import ( ) func TestExtractEngineConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -399,7 +399,7 @@ This is a test workflow.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) diff --git a/pkg/workflow/engine_firewall_support_test.go b/pkg/workflow/engine_firewall_support_test.go index d2cf80fa80..92b7922e1e 100644 --- a/pkg/workflow/engine_firewall_support_test.go +++ b/pkg/workflow/engine_firewall_support_test.go @@ -72,7 +72,7 @@ func TestHasNetworkRestrictions(t *testing.T) { } func TestCheckNetworkSupport_NoRestrictions(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("no restrictions with copilot engine", func(t *testing.T) { engine := NewCopilotEngine() @@ -103,7 +103,7 @@ func TestCheckNetworkSupport_NoRestrictions(t *testing.T) { func TestCheckNetworkSupport_WithRestrictions(t *testing.T) { t.Run("copilot engine with restrictions - no warning", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCopilotEngine() perms := &NetworkPermissions{ Allowed: []string{"example.com", "api.github.com"}, @@ -120,7 +120,7 @@ func TestCheckNetworkSupport_WithRestrictions(t *testing.T) { }) t.Run("claude engine with restrictions - no warning (supports firewall)", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewClaudeEngine() perms := &NetworkPermissions{ Allowed: []string{"example.com"}, @@ -137,7 +137,7 @@ func TestCheckNetworkSupport_WithRestrictions(t *testing.T) { }) t.Run("codex engine with restrictions - no warning", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCodexEngine() perms := &NetworkPermissions{ Allowed: []string{"api.openai.com"}, @@ -154,7 +154,7 @@ func TestCheckNetworkSupport_WithRestrictions(t *testing.T) { }) t.Run("custom engine with restrictions - warning emitted", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCustomEngine() perms := &NetworkPermissions{ Allowed: []string{"example.com"}, @@ -173,7 +173,7 @@ func TestCheckNetworkSupport_WithRestrictions(t *testing.T) { func TestCheckNetworkSupport_StrictMode(t *testing.T) { t.Run("strict mode: copilot engine with restrictions - no error", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewCopilotEngine() perms := &NetworkPermissions{ @@ -187,7 +187,7 @@ func TestCheckNetworkSupport_StrictMode(t *testing.T) { }) t.Run("strict mode: claude engine with restrictions - no error (claude supports firewall)", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewClaudeEngine() perms := &NetworkPermissions{ @@ -201,7 +201,7 @@ func TestCheckNetworkSupport_StrictMode(t *testing.T) { }) t.Run("strict mode: codex engine with restrictions - no error", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewCodexEngine() perms := &NetworkPermissions{ @@ -215,7 +215,7 @@ func TestCheckNetworkSupport_StrictMode(t *testing.T) { }) t.Run("strict mode: custom engine with restrictions - error", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewCustomEngine() perms := &NetworkPermissions{ @@ -229,7 +229,7 @@ func TestCheckNetworkSupport_StrictMode(t *testing.T) { }) t.Run("strict mode: no restrictions - no error", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewClaudeEngine() perms := &NetworkPermissions{Allowed: []string{"defaults"}} @@ -243,7 +243,7 @@ func TestCheckNetworkSupport_StrictMode(t *testing.T) { func TestCheckFirewallDisable(t *testing.T) { t.Run("firewall enabled - no validation", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCopilotEngine() perms := &NetworkPermissions{ Allowed: []string{"example.com"}, @@ -259,7 +259,7 @@ func TestCheckFirewallDisable(t *testing.T) { }) t.Run("firewall disabled with no restrictions - no warning", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCopilotEngine() perms := &NetworkPermissions{ Firewall: &FirewallConfig{ @@ -278,7 +278,7 @@ func TestCheckFirewallDisable(t *testing.T) { }) t.Run("firewall disabled with restrictions - warning emitted", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCopilotEngine() perms := &NetworkPermissions{ Allowed: []string{"example.com"}, @@ -298,7 +298,7 @@ func TestCheckFirewallDisable(t *testing.T) { }) t.Run("strict mode: firewall disabled with restrictions - error", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewCopilotEngine() perms := &NetworkPermissions{ @@ -318,7 +318,7 @@ func TestCheckFirewallDisable(t *testing.T) { }) t.Run("strict mode: firewall disabled with unsupported engine - error", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true engine := NewCustomEngine() // Custom engine doesn't support firewall perms := &NetworkPermissions{ @@ -336,7 +336,7 @@ func TestCheckFirewallDisable(t *testing.T) { }) t.Run("nil firewall config - no validation", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewCopilotEngine() perms := &NetworkPermissions{ Allowed: []string{"example.com"}, diff --git a/pkg/workflow/engine_includes_test.go b/pkg/workflow/engine_includes_test.go index 4f70b46997..f2f25ed21b 100644 --- a/pkg/workflow/engine_includes_test.go +++ b/pkg/workflow/engine_includes_test.go @@ -52,7 +52,7 @@ This should inherit the engine from the included file. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err != nil { t.Fatalf("Expected successful compilation, got error: %v", err) @@ -121,7 +121,7 @@ This should fail due to multiple engine specifications. } // Compile the workflow - should fail - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err == nil { t.Fatal("Expected compilation to fail due to multiple engine specifications") @@ -177,7 +177,7 @@ This should inherit the claude engine from the included file. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err != nil { t.Fatalf("Expected successful compilation, got error: %v", err) @@ -229,7 +229,7 @@ This should use the default engine. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err != nil { t.Fatalf("Expected successful compilation, got error: %v", err) @@ -284,7 +284,7 @@ This workflow specifies claude engine directly without any includes. } // Compile the workflow (no includes, so no conflict) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err != nil { t.Fatalf("Expected successful compilation, got error: %v", err) @@ -363,7 +363,7 @@ This should fail due to multiple engine specifications in includes. } // Compile the workflow - should fail - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err == nil { t.Fatal("Expected compilation to fail due to multiple engine specifications") @@ -432,7 +432,7 @@ This workflow imports a custom engine with steps. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err != nil { t.Fatalf("Expected successful compilation, got error: %v", err) @@ -515,7 +515,7 @@ This workflow imports a custom engine with env vars. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainFile) if err != nil { t.Fatalf("Expected successful compilation, got error: %v", err) @@ -545,7 +545,7 @@ This workflow imports a custom engine with env vars. // TestExtractEngineConfigFromJSON tests the extractEngineConfigFromJSON function func TestExtractEngineConfigFromJSON(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/engine_parsing_simple_test.go b/pkg/workflow/engine_parsing_simple_test.go index 8fbc98cd5a..903fc087a6 100644 --- a/pkg/workflow/engine_parsing_simple_test.go +++ b/pkg/workflow/engine_parsing_simple_test.go @@ -337,7 +337,7 @@ Line 5`, func TestCompiler_SetFileTracker_Simple(t *testing.T) { // Create compiler - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Initial state should have nil tracker if compiler.fileTracker != nil { diff --git a/pkg/workflow/engine_test.go b/pkg/workflow/engine_test.go index d8799138fa..c77487fe98 100644 --- a/pkg/workflow/engine_test.go +++ b/pkg/workflow/engine_test.go @@ -85,7 +85,7 @@ func TestEngineVersionTypeHandling(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -125,7 +125,7 @@ func TestEngineVersionNotProvided(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -156,7 +156,7 @@ func TestEngineVersionWithOtherFields(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() _, config := compiler.ExtractEngineConfig(frontmatter) if config == nil { @@ -232,7 +232,7 @@ func TestEngineCommandField(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/pkg/workflow/engine_validation_test.go b/pkg/workflow/engine_validation_test.go index 027cb50713..abf394256b 100644 --- a/pkg/workflow/engine_validation_test.go +++ b/pkg/workflow/engine_validation_test.go @@ -54,7 +54,7 @@ func TestValidateEngine(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err := compiler.validateEngine(tt.engineID) if tt.expectError && err == nil { @@ -72,7 +72,7 @@ func TestValidateEngine(t *testing.T) { // TestValidateEngineErrorMessageQuality verifies that error messages follow the style guide func TestValidateEngineErrorMessageQuality(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err := compiler.validateEngine("invalid-engine") if err == nil { @@ -196,7 +196,7 @@ func TestValidateSingleEngineSpecification(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() result, err := compiler.validateSingleEngineSpecification(tt.mainEngineSetting, tt.includedEnginesJSON) if tt.expectError && err == nil { @@ -218,7 +218,7 @@ func TestValidateSingleEngineSpecification(t *testing.T) { // TestValidateSingleEngineSpecificationErrorMessageQuality verifies error messages follow the style guide func TestValidateSingleEngineSpecificationErrorMessageQuality(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() t.Run("multiple engines error includes example", func(t *testing.T) { _, err := compiler.validateSingleEngineSpecification("copilot", []string{`"claude"`}) diff --git a/pkg/workflow/environment_test.go b/pkg/workflow/environment_test.go index 1c77491f58..9364428761 100644 --- a/pkg/workflow/environment_test.go +++ b/pkg/workflow/environment_test.go @@ -98,7 +98,7 @@ This is a test.`, } // Parse the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) @@ -198,7 +198,7 @@ This is a test.` } // Parse and generate YAML - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowFile) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) diff --git a/pkg/workflow/error_message_quality_test.go b/pkg/workflow/error_message_quality_test.go index 1967063cca..0af8974c59 100644 --- a/pkg/workflow/error_message_quality_test.go +++ b/pkg/workflow/error_message_quality_test.go @@ -22,7 +22,7 @@ func TestErrorMessageQuality(t *testing.T) { { name: "manual-approval type error includes example", testFunc: func() error { - c := NewCompiler(false, "", "") + c := NewCompiler() frontmatter := map[string]any{ "on": map[string]any{ "manual-approval": 123, // Wrong type @@ -41,7 +41,7 @@ func TestErrorMessageQuality(t *testing.T) { { name: "invalid on section format includes example", testFunc: func() error { - c := NewCompiler(false, "", "") + c := NewCompiler() frontmatter := map[string]any{ "on": []string{"invalid"}, // Wrong type } @@ -58,7 +58,7 @@ func TestErrorMessageQuality(t *testing.T) { { name: "invalid engine includes valid options and example", testFunc: func() error { - c := NewCompiler(false, "", "") + c := NewCompiler() return c.validateEngine("invalid-engine") }, shouldContain: []string{ @@ -153,7 +153,7 @@ func TestErrorMessageQuality(t *testing.T) { { name: "tracker-id type error shows actual type and example", testFunc: func() error { - c := NewCompiler(false, "", "") + c := NewCompiler() frontmatter := map[string]any{ "tracker-id": 12345678, // Wrong type: integer instead of string } @@ -171,7 +171,7 @@ func TestErrorMessageQuality(t *testing.T) { { name: "stop-after type error shows actual type and example", testFunc: func() error { - c := NewCompiler(false, "", "") + c := NewCompiler() frontmatter := map[string]any{ "on": map[string]any{ "stop-after": 123, // Wrong type: integer instead of string @@ -254,7 +254,7 @@ func TestErrorMessageQuality(t *testing.T) { // TestMultipleEngineErrorMessage tests the specific error when multiple engines are defined func TestMultipleEngineErrorMessage(t *testing.T) { - c := NewCompiler(false, "", "") + c := NewCompiler() err := c.validateEngine("invalid") require.Error(t, err) diff --git a/pkg/workflow/error_wrapping_test.go b/pkg/workflow/error_wrapping_test.go index 47e96ead55..74e22b131c 100644 --- a/pkg/workflow/error_wrapping_test.go +++ b/pkg/workflow/error_wrapping_test.go @@ -52,7 +52,7 @@ on: require.NoError(t, err, "Failed to write test file") // Try to compile the invalid workflow - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") err = compiler.CompileWorkflow(testFile) return err }, @@ -65,7 +65,7 @@ on: name: "workflow file read error", operation: func() error { // Try to compile a non-existent file - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") err := compiler.CompileWorkflow("/nonexistent/file.md") return err }, @@ -93,7 +93,7 @@ on: require.NoError(t, err, "Failed to write test file") // Try to compile with invalid import - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") err = compiler.CompileWorkflow(testFile) return err }, @@ -161,7 +161,7 @@ func TestErrorMessagesPreserveContext(t *testing.T) { testFile := filepath.Join(tmpDir, "my-workflow.md") // Don't create the file - let it fail - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") err := compiler.CompileWorkflow(testFile) return err }, @@ -180,7 +180,7 @@ on: 123456 err := os.WriteFile(testFile, []byte(content), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") err = compiler.CompileWorkflow(testFile) return err }, @@ -220,7 +220,7 @@ func TestStandardLibraryErrorsNotExposed(t *testing.T) { { name: "path errors from file operations", operation: func() error { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") return compiler.CompileWorkflow("/definitely/does/not/exist/workflow.md") }, notInChain: []any{ @@ -241,7 +241,7 @@ on: err := os.WriteFile(testFile, []byte(content), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") return compiler.CompileWorkflow(testFile) }, notInChain: []any{ diff --git a/pkg/workflow/fetch_integration_test.go b/pkg/workflow/fetch_integration_test.go index 6c1a21fe0d..72a106350f 100644 --- a/pkg/workflow/fetch_integration_test.go +++ b/pkg/workflow/fetch_integration_test.go @@ -40,7 +40,7 @@ Fetch content from the web. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(workflowPath) @@ -103,7 +103,7 @@ Fetch content from the web. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(workflowPath) @@ -168,7 +168,7 @@ Fetch content from the web. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(workflowPath) @@ -231,7 +231,7 @@ Run some bash commands. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/firewall_args_integration_test.go b/pkg/workflow/firewall_args_integration_test.go index 3196e35663..a98be8f2d4 100644 --- a/pkg/workflow/firewall_args_integration_test.go +++ b/pkg/workflow/firewall_args_integration_test.go @@ -43,7 +43,7 @@ Test workflow with custom AWF arguments. } // Compile the workflow - compiler := NewCompiler(false, "", "test-firewall-args") + compiler := NewCompilerWithVersion("test-firewall-args") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -117,7 +117,7 @@ Test workflow without custom AWF arguments. } // Compile the workflow - compiler := NewCompiler(false, "", "test-no-custom-args") + compiler := NewCompilerWithVersion("test-no-custom-args") compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { diff --git a/pkg/workflow/firewall_default_enablement_test.go b/pkg/workflow/firewall_default_enablement_test.go index 8af320cc56..e4fafdab59 100644 --- a/pkg/workflow/firewall_default_enablement_test.go +++ b/pkg/workflow/firewall_default_enablement_test.go @@ -137,7 +137,7 @@ func TestCopilotFirewallDefaultIntegration(t *testing.T) { } // Create compiler - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetSkipValidation(true) // Extract engine config @@ -204,7 +204,7 @@ func TestCopilotFirewallDefaultIntegration(t *testing.T) { } // Create compiler - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetSkipValidation(true) // Extract engine config @@ -269,7 +269,7 @@ func TestCopilotFirewallDefaultIntegration(t *testing.T) { } // Create compiler - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetSkipValidation(true) // Extract engine config @@ -307,7 +307,7 @@ func TestDailyTeamStatusFirewallEnabled(t *testing.T) { } // Create compiler - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetSkipValidation(true) // Extract engine config (should default to copilot) @@ -348,7 +348,7 @@ func TestDailyTeamStatusFirewallEnabled(t *testing.T) { // TestStrictModeFirewallValidation tests strict mode firewall validation func TestStrictModeFirewallValidation(t *testing.T) { t.Run("strict mode requires firewall for copilot with network restrictions", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -369,7 +369,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("strict mode allows firewall disabled when allowed is wildcard", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -385,7 +385,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("strict mode passes when firewall is enabled", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -403,7 +403,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("strict mode skips validation for non-copilot engines", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -419,7 +419,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("strict mode refuses sandbox.agent: false for copilot", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -445,7 +445,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("strict mode refuses sandbox.agent: false for all engines", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -472,7 +472,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("strict mode skips validation when SRT is enabled", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) networkPerms := &NetworkPermissions{ @@ -492,7 +492,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("non-strict mode does not validate firewall", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) networkPerms := &NetworkPermissions{ @@ -508,7 +508,7 @@ func TestStrictModeFirewallValidation(t *testing.T) { }) t.Run("sandbox.agent: false is rejected even in non-strict mode", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) networkPerms := &NetworkPermissions{ diff --git a/pkg/workflow/firewall_disable_integration_test.go b/pkg/workflow/firewall_disable_integration_test.go index 0fc95f14ee..66fb3e95dd 100644 --- a/pkg/workflow/firewall_disable_integration_test.go +++ b/pkg/workflow/firewall_disable_integration_test.go @@ -21,8 +21,10 @@ func TestFirewallDisableIntegration(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") - compiler.SetSkipValidation(true) + compiler := NewCompiler( + WithVersion("test"), + WithSkipValidation(true), + ) // Extract network permissions networkPerms := compiler.extractNetworkPermissions(frontmatter) @@ -61,7 +63,7 @@ func TestFirewallDisableIntegration(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.strictMode = true compiler.SetSkipValidation(true) diff --git a/pkg/workflow/firewall_log_level_test.go b/pkg/workflow/firewall_log_level_test.go index ef37916311..397863156e 100644 --- a/pkg/workflow/firewall_log_level_test.go +++ b/pkg/workflow/firewall_log_level_test.go @@ -7,7 +7,7 @@ import ( // TestFirewallLogLevelParsing tests that the log-level field is correctly parsed func TestFirewallLogLevelParsing(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) t.Run("log-level is parsed from network.firewall object", func(t *testing.T) { diff --git a/pkg/workflow/firewall_test.go b/pkg/workflow/firewall_test.go index 6771b25f1c..6a8877fd85 100644 --- a/pkg/workflow/firewall_test.go +++ b/pkg/workflow/firewall_test.go @@ -230,7 +230,7 @@ func TestValidateFirewallConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.validateFirewallConfig(tt.workflowData) if tt.expectErr { if err == nil { @@ -282,7 +282,7 @@ func TestValidateLogLevelErrorMessageQuality(t *testing.T) { // TestValidateFirewallConfigIntegration tests the integration with workflow compilation func TestValidateFirewallConfigIntegration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that valid log-level passes through compilation validation validWorkflow := &WorkflowData{ diff --git a/pkg/workflow/firewall_workflow_test.go b/pkg/workflow/firewall_workflow_test.go index 2fa1a51fda..12cca210ec 100644 --- a/pkg/workflow/firewall_workflow_test.go +++ b/pkg/workflow/firewall_workflow_test.go @@ -91,7 +91,7 @@ func TestFirewallWorkflowCompilation(t *testing.T) { } // Create compiler - c := NewCompiler(false, "", "firewall") + c := NewCompilerWithVersion("firewall") c.SetSkipValidation(true) // Extract and verify tools diff --git a/pkg/workflow/forbidden_fields_import_test.go b/pkg/workflow/forbidden_fields_import_test.go index 7d1e29b706..9131ec66ee 100644 --- a/pkg/workflow/forbidden_fields_import_test.go +++ b/pkg/workflow/forbidden_fields_import_test.go @@ -76,7 +76,9 @@ This workflow imports a shared workflow with forbidden field. require.NoError(t, os.WriteFile(mainPath, []byte(mainContent), 0644)) // Try to compile - should fail because shared workflow has forbidden field - compiler := NewCompiler(false, tempDir, "test") + compiler := NewCompiler( + WithCustomOutput(tempDir), + ) err := compiler.CompileWorkflow(mainPath) // Should get error about forbidden field @@ -154,7 +156,9 @@ This workflow imports a shared workflow with allowed field. require.NoError(t, os.WriteFile(mainPath, []byte(mainContent), 0644)) // Compile - should succeed because shared workflow has allowed field - compiler := NewCompiler(false, tempDir, "test") + compiler := NewCompiler( + WithCustomOutput(tempDir), + ) err := compiler.CompileWorkflow(mainPath) // Should NOT get error about forbidden field @@ -217,7 +221,9 @@ This workflow imports a shared workflow that itself has imports (nested). require.NoError(t, os.WriteFile(mainPath, []byte(mainContent), 0644)) // Compile - should succeed because shared workflows can have imports (nested imports are supported) - compiler := NewCompiler(false, tempDir, "test") + compiler := NewCompiler( + WithCustomOutput(tempDir), + ) err := compiler.CompileWorkflow(mainPath) // Should NOT get error about forbidden field diff --git a/pkg/workflow/frontmatter_cache_test.go b/pkg/workflow/frontmatter_cache_test.go index 1a611efb83..f8e68369f3 100644 --- a/pkg/workflow/frontmatter_cache_test.go +++ b/pkg/workflow/frontmatter_cache_test.go @@ -65,7 +65,7 @@ engine: copilot testFile := filepath.Join(tmpDir, "test-"+tt.name+".md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) @@ -101,7 +101,7 @@ Test content` testFile := filepath.Join(tmpDir, "test-filter.md") require.NoError(t, os.WriteFile(testFile, []byte(testContent), 0644)) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(testFile) require.NoError(t, err) require.NotNil(t, workflowData) diff --git a/pkg/workflow/git_commands_integration_test.go b/pkg/workflow/git_commands_integration_test.go index 67a3048816..da085eb9ff 100644 --- a/pkg/workflow/git_commands_integration_test.go +++ b/pkg/workflow/git_commands_integration_test.go @@ -24,7 +24,7 @@ safe-outputs: This is a test workflow that should automatically get Git commands when create-pull-request is enabled. ` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow content and get both result and allowed tools string _, allowedToolsStr, err := compiler.parseWorkflowMarkdownContentWithToolsString(workflowContent) @@ -65,7 +65,7 @@ safe-outputs: This workflow should NOT get Git commands since it doesn't use create-pull-request or push-to-pull-request-branch. ` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow content and get allowed tools string _, allowedToolsStr, err := compiler.parseWorkflowMarkdownContentWithToolsString(workflowContent) @@ -105,7 +105,7 @@ safe-outputs: This is a test workflow that should automatically get additional Claude tools when create-pull-request is enabled. ` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow content and get allowed tools string _, allowedToolsStr, err := compiler.parseWorkflowMarkdownContentWithToolsString(workflowContent) @@ -153,7 +153,7 @@ safe-outputs: This is a test workflow that should automatically get additional Claude tools when push-to-pull-request-branch is enabled. ` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow content and get allowed tools string _, allowedToolsStr, err := compiler.parseWorkflowMarkdownContentWithToolsString(workflowContent) diff --git a/pkg/workflow/git_commands_test.go b/pkg/workflow/git_commands_test.go index 4714096dc6..654779a7d0 100644 --- a/pkg/workflow/git_commands_test.go +++ b/pkg/workflow/git_commands_test.go @@ -6,7 +6,7 @@ import ( ) func TestApplyDefaultGitCommandsForSafeOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewClaudeEngine() tests := []struct { @@ -131,7 +131,7 @@ func TestApplyDefaultGitCommandsForSafeOutputs(t *testing.T) { } func TestAdditionalClaudeToolsForSafeOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() engine := NewClaudeEngine() tests := []struct { diff --git a/pkg/workflow/git_config_test.go b/pkg/workflow/git_config_test.go index 42d9d1cfe7..2cf740a178 100644 --- a/pkg/workflow/git_config_test.go +++ b/pkg/workflow/git_config_test.go @@ -35,7 +35,7 @@ This is a test workflow to verify git configuration is included. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -70,7 +70,7 @@ This is a test workflow to verify git configuration is included. // TestGitConfigurationStepsHelper tests the generateGitConfigurationSteps helper directly func TestGitConfigurationStepsHelper(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() steps := compiler.generateGitConfigurationSteps() diff --git a/pkg/workflow/git_patch_test.go b/pkg/workflow/git_patch_test.go index 8e8a835e99..7ae407efae 100644 --- a/pkg/workflow/git_patch_test.go +++ b/pkg/workflow/git_patch_test.go @@ -52,7 +52,7 @@ Please do the following tasks: } // Create compiler with verbose enabled for testing - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(mdFile); err != nil { diff --git a/pkg/workflow/github_disabled_test.go b/pkg/workflow/github_disabled_test.go index c0af7883ea..1032fe4d62 100644 --- a/pkg/workflow/github_disabled_test.go +++ b/pkg/workflow/github_disabled_test.go @@ -6,7 +6,7 @@ import ( // TestGitHubToolDisabled tests the github: false functionality to disable the GitHub MCP server func TestGitHubToolDisabled(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/github_lockdown_autodetect_test.go b/pkg/workflow/github_lockdown_autodetect_test.go index e643c35ba9..5e968a7005 100644 --- a/pkg/workflow/github_lockdown_autodetect_test.go +++ b/pkg/workflow/github_lockdown_autodetect_test.go @@ -118,7 +118,7 @@ Test auto-determination with remote GitHub MCP. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -203,7 +203,7 @@ Test automatic lockdown determination with Claude. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/github_lockdown_integration_test.go b/pkg/workflow/github_lockdown_integration_test.go index e4c94bd850..a25309bf81 100644 --- a/pkg/workflow/github_lockdown_integration_test.go +++ b/pkg/workflow/github_lockdown_integration_test.go @@ -188,7 +188,7 @@ Test default behavior without lockdown. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/github_mcp_app_token_test.go b/pkg/workflow/github_mcp_app_token_test.go index c431aee3a5..a6eab25324 100644 --- a/pkg/workflow/github_mcp_app_token_test.go +++ b/pkg/workflow/github_mcp_app_token_test.go @@ -12,7 +12,7 @@ import ( // TestGitHubMCPAppTokenConfiguration tests that app configuration is correctly parsed for GitHub tool func TestGitHubMCPAppTokenConfiguration(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -56,7 +56,7 @@ Test workflow with GitHub MCP server app configuration. // TestGitHubMCPAppTokenMintingStep tests that token minting step is generated func TestGitHubMCPAppTokenMintingStep(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -115,7 +115,7 @@ Test workflow with GitHub MCP app token minting. // TestGitHubMCPAppTokenOverridesDefaultToken tests that app token overrides custom and default tokens func TestGitHubMCPAppTokenOverridesDefaultToken(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -160,7 +160,7 @@ Test that app token overrides custom token. // TestGitHubMCPAppTokenWithRemoteMode tests that app token works with remote mode func TestGitHubMCPAppTokenWithRemoteMode(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues diff --git a/pkg/workflow/github_remote_mode_test.go b/pkg/workflow/github_remote_mode_test.go index c6b86632d4..2aecd3a891 100644 --- a/pkg/workflow/github_remote_mode_test.go +++ b/pkg/workflow/github_remote_mode_test.go @@ -14,7 +14,7 @@ import ( func TestGitHubRemoteModeConfiguration(t *testing.T) { tmpDir := testutil.TempDir(t, "github-remote-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -390,7 +390,7 @@ func TestGitHubRemoteModeHelperFunctions(t *testing.T) { // MCP gateway validates ${VAR} references in headers at config load time. func TestCopilotGitHubRemotePersonalAccessTokenExport(t *testing.T) { tmpDir := testutil.TempDir(t, "copilot-github-remote-pat-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: issues @@ -457,7 +457,7 @@ This tests that GITHUB_PERSONAL_ACCESS_TOKEN is exported and passed to Docker. // since Claude uses a different auth pattern (direct $GITHUB_MCP_SERVER_TOKEN). func TestClaudeGitHubRemoteNoPersonalAccessToken(t *testing.T) { tmpDir := testutil.TempDir(t, "claude-github-remote-no-pat-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: issues diff --git a/pkg/workflow/github_token_precedence_integration_test.go b/pkg/workflow/github_token_precedence_integration_test.go index a230c4da8a..434a276a07 100644 --- a/pkg/workflow/github_token_precedence_integration_test.go +++ b/pkg/workflow/github_token_precedence_integration_test.go @@ -38,7 +38,7 @@ Test that top-level github-token is used in engine configuration. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -89,7 +89,7 @@ Test that safe-outputs github-token overrides top-level. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -141,7 +141,7 @@ Test that safe-outputs github-token overrides top-level token. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -202,7 +202,7 @@ Test that top-level github-token is used in Codex engine. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -257,7 +257,7 @@ Test that top-level github-token is used in Copilot engine. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) @@ -299,7 +299,7 @@ Test that default fallback includes GH_AW_GITHUB_MCP_SERVER_TOKEN. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Unexpected error compiling workflow: %v", err) diff --git a/pkg/workflow/github_token_validation_test.go b/pkg/workflow/github_token_validation_test.go index 0269e22ec9..6168a688cd 100644 --- a/pkg/workflow/github_token_validation_test.go +++ b/pkg/workflow/github_token_validation_test.go @@ -128,7 +128,7 @@ tools: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError { @@ -187,7 +187,7 @@ safe-outputs: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError { @@ -244,7 +244,7 @@ safe-outputs: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError { @@ -301,7 +301,7 @@ tools: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError { @@ -336,7 +336,7 @@ github-token: ghp_actualSecretInPlainText t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err == nil { @@ -377,7 +377,7 @@ safe-outputs: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) // Should fail due to plaintext token in github tool diff --git a/pkg/workflow/github_tools_mode_test.go b/pkg/workflow/github_tools_mode_test.go index bf948f5c70..15e918bc5c 100644 --- a/pkg/workflow/github_tools_mode_test.go +++ b/pkg/workflow/github_tools_mode_test.go @@ -64,7 +64,7 @@ func TestGitHubToolsModeSeparation(t *testing.T) { // TestApplyDefaultToolsNoLongerAddsDefaults verifies that applyDefaultTools no longer adds default tools // The MCP server should use ["*"] to allow all tools instead func TestApplyDefaultToolsNoLongerAddsDefaults(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/github_toolset_integration_test.go b/pkg/workflow/github_toolset_integration_test.go index cfab761b36..c7f949db4c 100644 --- a/pkg/workflow/github_toolset_integration_test.go +++ b/pkg/workflow/github_toolset_integration_test.go @@ -133,7 +133,7 @@ This workflow combines toolsets with read-only mode. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compileErr := compiler.CompileWorkflow(mdPath) if compileErr != nil { t.Fatalf("Failed to compile workflow: %v", compileErr) @@ -191,7 +191,7 @@ This workflow tests remote mode with array toolsets. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compileErr := compiler.CompileWorkflow(mdPath) if compileErr != nil { t.Fatalf("Failed to compile workflow: %v", compileErr) @@ -329,7 +329,7 @@ Remote mode with toolsets and read-only. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compileErr := compiler.CompileWorkflow(mdPath) if compileErr != nil { t.Fatalf("Failed to compile workflow: %v", compileErr) diff --git a/pkg/workflow/github_toolset_validation_integration_test.go b/pkg/workflow/github_toolset_validation_integration_test.go index d79dd03238..1681cf847f 100644 --- a/pkg/workflow/github_toolset_validation_integration_test.go +++ b/pkg/workflow/github_toolset_validation_integration_test.go @@ -227,7 +227,7 @@ Test content. } // Create a compiler instance - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Try to compile the workflow err = compiler.CompileWorkflow(workflowPath) @@ -291,7 +291,7 @@ Test content. } // Create a compiler instance - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Try to compile the workflow err = compiler.CompileWorkflow(workflowPath) @@ -348,7 +348,7 @@ Test content. } // Create a compiler instance - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Try to compile the workflow err = compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/heredoc_interpolation_test.go b/pkg/workflow/heredoc_interpolation_test.go index ebd2e54c7b..6f461558aa 100644 --- a/pkg/workflow/heredoc_interpolation_test.go +++ b/pkg/workflow/heredoc_interpolation_test.go @@ -38,7 +38,7 @@ Actor: ${{ github.actor }} t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -133,7 +133,7 @@ Actor: ${{ github.actor }} t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/importable_tools_test.go b/pkg/workflow/importable_tools_test.go index 105b6086de..fa85efa40e 100644 --- a/pkg/workflow/importable_tools_test.go +++ b/pkg/workflow/importable_tools_test.go @@ -59,7 +59,7 @@ Uses imported playwright tool. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -134,7 +134,7 @@ Uses imported serena tool. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -212,7 +212,7 @@ Uses imported agentic-workflows tool. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -289,7 +289,7 @@ Uses all imported tools. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -373,7 +373,7 @@ Uses imported serena with language config. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -457,7 +457,7 @@ Uses imported playwright with custom args. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -527,7 +527,7 @@ Missing actions:read permission. } // Compile the workflow - should fail due to missing permission - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() err := compiler.CompileWorkflow(workflowPath) if err == nil { @@ -578,7 +578,7 @@ Uses imported edit tool. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -637,7 +637,7 @@ Uses imported web-fetch tool. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -694,7 +694,7 @@ Uses imported web-search tool. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -753,7 +753,7 @@ Uses imported timeout setting. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -815,7 +815,7 @@ Uses imported startup-timeout setting. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -881,7 +881,7 @@ Uses all imported neutral tools. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -963,7 +963,7 @@ Uses imported serena in local mode. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -1061,7 +1061,7 @@ permissions: } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/imports_inputs_test.go b/pkg/workflow/imports_inputs_test.go index daf0cbef7b..b5f7470219 100644 --- a/pkg/workflow/imports_inputs_test.go +++ b/pkg/workflow/imports_inputs_test.go @@ -68,7 +68,7 @@ This workflow tests import with inputs. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -149,7 +149,7 @@ This workflow tests that string imports still work. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/imports_markdown_test.go b/pkg/workflow/imports_markdown_test.go index 80dd74d135..5b83e1579f 100644 --- a/pkg/workflow/imports_markdown_test.go +++ b/pkg/workflow/imports_markdown_test.go @@ -50,7 +50,7 @@ This is common setup content that should be prepended. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -183,7 +183,7 @@ This comes from @include directive.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowContent := `--- on: issues @@ -290,7 +290,7 @@ More imported content here.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowContent := `--- on: issues diff --git a/pkg/workflow/imports_recursive_test.go b/pkg/workflow/imports_recursive_test.go index d050619751..f84c29d39c 100644 --- a/pkg/workflow/imports_recursive_test.go +++ b/pkg/workflow/imports_recursive_test.go @@ -73,7 +73,7 @@ This workflow tests recursive imports. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -171,7 +171,7 @@ This workflow tests cyclic import detection. } // Compile the workflow - should handle the cycle gracefully - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -268,7 +268,7 @@ This workflow tests diamond import pattern. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -414,7 +414,7 @@ imports: } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/imports_test.go b/pkg/workflow/imports_test.go index e798ae4eb6..0d0dcc461d 100644 --- a/pkg/workflow/imports_test.go +++ b/pkg/workflow/imports_test.go @@ -56,7 +56,7 @@ This is a test workflow. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -139,7 +139,7 @@ This is a test workflow with multiple imports. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -215,7 +215,7 @@ This is a test workflow with imported MCP server. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/individual_github_token_integration_test.go b/pkg/workflow/individual_github_token_integration_test.go index bff801c80b..20cc721f83 100644 --- a/pkg/workflow/individual_github_token_integration_test.go +++ b/pkg/workflow/individual_github_token_integration_test.go @@ -38,7 +38,7 @@ This workflow tests that create-issue uses the safe-outputs global github-token. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(testFile) @@ -92,7 +92,7 @@ This workflow tests that create-pull-request uses the safe-outputs global github t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(testFile) @@ -144,7 +144,7 @@ This workflow tests that add-labels uses the safe-outputs global github-token. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(testFile) @@ -197,7 +197,7 @@ This workflow tests that the global github-token still works when no individual t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/is_task_job_needed_test.go b/pkg/workflow/is_task_job_needed_test.go index 93aae382ef..6d359a1075 100644 --- a/pkg/workflow/is_task_job_needed_test.go +++ b/pkg/workflow/is_task_job_needed_test.go @@ -3,7 +3,7 @@ package workflow import "testing" func TestIsActivationJobNeeded(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("no_conditions", func(t *testing.T) { data := &WorkflowData{ diff --git a/pkg/workflow/jobs_full_spec_test.go b/pkg/workflow/jobs_full_spec_test.go index f87f348365..4466bd06f2 100644 --- a/pkg/workflow/jobs_full_spec_test.go +++ b/pkg/workflow/jobs_full_spec_test.go @@ -189,7 +189,7 @@ jobs: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) if tt.shouldError { @@ -316,7 +316,7 @@ jobs: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) if tt.shouldError { diff --git a/pkg/workflow/jobs_secrets_validation_test.go b/pkg/workflow/jobs_secrets_validation_test.go index 0e49f9e193..bd826d80e9 100644 --- a/pkg/workflow/jobs_secrets_validation_test.go +++ b/pkg/workflow/jobs_secrets_validation_test.go @@ -299,7 +299,7 @@ Test workflow with additional text in secret.`, } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if tt.expectError { @@ -410,7 +410,7 @@ Test for schema validation.`, t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if tt.expectError { @@ -472,7 +472,7 @@ This workflow deploys the application using reusable workflows with proper secre t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { diff --git a/pkg/workflow/label_filter_test.go b/pkg/workflow/label_filter_test.go index 5dcaa24db1..81d1daae80 100644 --- a/pkg/workflow/label_filter_test.go +++ b/pkg/workflow/label_filter_test.go @@ -15,7 +15,7 @@ func TestLabelFilter(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "label-filter-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -231,7 +231,7 @@ tools: func TestLabelFilterCommentedOut(t *testing.T) { tmpDir := testutil.TempDir(t, "label-filter-comment-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: diff --git a/pkg/workflow/label_trigger_integration_test.go b/pkg/workflow/label_trigger_integration_test.go index 50e2e2eccb..1fe0ca62d8 100644 --- a/pkg/workflow/label_trigger_integration_test.go +++ b/pkg/workflow/label_trigger_integration_test.go @@ -10,7 +10,7 @@ func TestLabelTriggerIntegrationSimple(t *testing.T) { "on": "issue labeled bug enhancement", } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.preprocessScheduleFields(frontmatter, "", "") if err != nil { t.Fatalf("preprocessScheduleFields() error = %v", err) @@ -89,7 +89,7 @@ func TestLabelTriggerIntegrationIssue(t *testing.T) { "on": "issue labeled bug", } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.preprocessScheduleFields(frontmatter, "", "") if err != nil { t.Fatalf("preprocessScheduleFields() error = %v", err) @@ -119,7 +119,7 @@ func TestLabelTriggerIntegrationPullRequest(t *testing.T) { "on": "pull_request labeled needs-review approved", } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.preprocessScheduleFields(frontmatter, "", "") if err != nil { t.Fatalf("preprocessScheduleFields() error = %v", err) @@ -185,7 +185,7 @@ func TestLabelTriggerIntegrationDiscussion(t *testing.T) { "on": "discussion labeled question announcement", } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.preprocessScheduleFields(frontmatter, "", "") if err != nil { t.Fatalf("preprocessScheduleFields() error = %v", err) @@ -248,7 +248,7 @@ func TestLabelTriggerIntegrationError(t *testing.T) { "on": "labeled bug", } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.preprocessScheduleFields(frontmatter, "", "") if err != nil { t.Fatalf("preprocessScheduleFields() unexpected error = %v", err) diff --git a/pkg/workflow/local_action_permissions_test.go b/pkg/workflow/local_action_permissions_test.go index 26290bd3f9..e9085d239f 100644 --- a/pkg/workflow/local_action_permissions_test.go +++ b/pkg/workflow/local_action_permissions_test.go @@ -68,7 +68,7 @@ strict: false t.Fatal(err) } - compiler := NewCompiler(false, "", "dev") + compiler := NewCompilerWithVersion("dev") // Use dev mode to enable local action paths compiler.SetActionMode(ActionModeDev) @@ -171,7 +171,7 @@ command: /fix t.Fatal(err) } - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") // Use release mode to test production behavior (no local action checkouts) compiler.SetActionMode(ActionModeRelease) diff --git a/pkg/workflow/lock_for_agent_test.go b/pkg/workflow/lock_for_agent_test.go index bf6a33bfd1..d073c1be3e 100644 --- a/pkg/workflow/lock_for_agent_test.go +++ b/pkg/workflow/lock_for_agent_test.go @@ -35,7 +35,7 @@ Test workflow with lock-for-agent enabled. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -112,7 +112,7 @@ Test workflow with lock-for-agent but no reaction. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -183,7 +183,7 @@ Test workflow without lock-for-agent. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -248,7 +248,7 @@ Test workflow without lock-for-agent and without reaction. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -308,7 +308,7 @@ Test that lock-for-agent on issues doesn't break PR workflows. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -354,7 +354,7 @@ Test workflow with lock-for-agent enabled for issue_comment events. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -454,7 +454,7 @@ Test that lock-for-agent is commented out in generated YAML. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -523,7 +523,7 @@ Test that issue is unlocked in safe_outputs job before processing safe outputs. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/logs_test.go b/pkg/workflow/logs_test.go index 25e43b25de..277e34f320 100644 --- a/pkg/workflow/logs_test.go +++ b/pkg/workflow/logs_test.go @@ -30,7 +30,7 @@ This is a test workflow.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Unexpected error: %v", err) } diff --git a/pkg/workflow/main_job_env_test.go b/pkg/workflow/main_job_env_test.go index c45c39c460..406dc9572b 100644 --- a/pkg/workflow/main_job_env_test.go +++ b/pkg/workflow/main_job_env_test.go @@ -63,7 +63,7 @@ func TestMainJobEnvironmentVariables(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create workflow data - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ AI: "claude", RunsOn: "ubuntu-latest", @@ -144,7 +144,7 @@ This workflow tests that job-level environment variables are properly set for sa } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowFile) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/manifest_test.go b/pkg/workflow/manifest_test.go index bfd5880ce2..73ae4630ea 100644 --- a/pkg/workflow/manifest_test.go +++ b/pkg/workflow/manifest_test.go @@ -44,7 +44,7 @@ Be helpful and concise.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -239,7 +239,7 @@ engine: claude Handle the issue.` - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() testFile := filepath.Join(tmpDir, "test-workflow.md") if err := os.WriteFile(testFile, []byte(workflowContent), 0644); err != nil { t.Fatal(err) diff --git a/pkg/workflow/manual_approval_integration_test.go b/pkg/workflow/manual_approval_integration_test.go index beb295cfd5..80035fbd91 100644 --- a/pkg/workflow/manual_approval_integration_test.go +++ b/pkg/workflow/manual_approval_integration_test.go @@ -83,7 +83,7 @@ strict: false } // Compile the workflow - c := NewCompiler(false, "", "test-version") + c := NewCompiler() if err := c.CompileWorkflow(mdFile); err != nil { t.Fatalf("CompileWorkflow() error = %v", err) } diff --git a/pkg/workflow/max_turns_test.go b/pkg/workflow/max_turns_test.go index c40a95d312..bbfd7cf1b3 100644 --- a/pkg/workflow/max_turns_test.go +++ b/pkg/workflow/max_turns_test.go @@ -101,7 +101,7 @@ This workflow tests max-turns with timeout.`, } // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -241,7 +241,7 @@ engine: } // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError && err == nil { @@ -283,7 +283,7 @@ This tests max-turns feature with custom engine.` } // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow with custom engine and max-turns: %v", err) } diff --git a/pkg/workflow/max_turns_validation_test.go b/pkg/workflow/max_turns_validation_test.go index f0c76ef88d..42a0fde62b 100644 --- a/pkg/workflow/max_turns_validation_test.go +++ b/pkg/workflow/max_turns_validation_test.go @@ -108,7 +108,7 @@ This should succeed because no max-turns is specified.`, } // Create a compiler instance - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(false) // Try to compile the workflow diff --git a/pkg/workflow/mcp_auto_container_integration_test.go b/pkg/workflow/mcp_auto_container_integration_test.go index cbc0e028ef..189985fc41 100644 --- a/pkg/workflow/mcp_auto_container_integration_test.go +++ b/pkg/workflow/mcp_auto_container_integration_test.go @@ -117,7 +117,7 @@ Test that explicit container configuration overrides auto-assignment. tmpFile.Close() // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Skip validation for test workflowData, err := compiler.ParseWorkflowFile(tmpFile.Name()) @@ -175,7 +175,7 @@ Test that multiple MCP servers get appropriate containers. tmpFile.Close() // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) workflowData, err := compiler.ParseWorkflowFile(tmpFile.Name()) @@ -229,7 +229,7 @@ Test that environment variables are preserved with auto-containerization. tmpFile.Close() // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) workflowData, err := compiler.ParseWorkflowFile(tmpFile.Name()) diff --git a/pkg/workflow/mcp_config_compilation_test.go b/pkg/workflow/mcp_config_compilation_test.go index 2088f1facb..e34661e270 100644 --- a/pkg/workflow/mcp_config_compilation_test.go +++ b/pkg/workflow/mcp_config_compilation_test.go @@ -46,7 +46,7 @@ Please use the markitdown MCP server to convert HTML to markdown. tmpFile.Close() // Create compiler and compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Skip validation for test // Parse the workflow file to get WorkflowData @@ -172,7 +172,7 @@ This workflow tests that MCP server env vars are sorted alphabetically. tmpFile.Close() // Create compiler and compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Generate YAML diff --git a/pkg/workflow/mcp_config_test.go b/pkg/workflow/mcp_config_test.go index 5896c8f2bc..a056d9a69c 100644 --- a/pkg/workflow/mcp_config_test.go +++ b/pkg/workflow/mcp_config_test.go @@ -14,7 +14,7 @@ import ( func TestGitHubMCPConfiguration(t *testing.T) { tmpDir := testutil.TempDir(t, "mcp-config-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/mcp_fields_schema_test.go b/pkg/workflow/mcp_fields_schema_test.go index 355985c36a..18a1979b30 100644 --- a/pkg/workflow/mcp_fields_schema_test.go +++ b/pkg/workflow/mcp_fields_schema_test.go @@ -59,7 +59,7 @@ This workflow imports an MCP server with headers and url fields. } // Compile the workflow - should succeed without schema validation errors - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed with schema validation error: %v", err) } @@ -116,7 +116,7 @@ imports: t.Fatalf("Failed to write workflow file: %v", err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -168,7 +168,7 @@ imports: t.Fatalf("Failed to write workflow file: %v", err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } @@ -216,7 +216,7 @@ imports: t.Fatalf("Failed to write workflow file: %v", err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/mcp_gateway_entrypoint_mounts_e2e_test.go b/pkg/workflow/mcp_gateway_entrypoint_mounts_e2e_test.go index d587f9c2a0..2e789f48ff 100644 --- a/pkg/workflow/mcp_gateway_entrypoint_mounts_e2e_test.go +++ b/pkg/workflow/mcp_gateway_entrypoint_mounts_e2e_test.go @@ -39,7 +39,7 @@ Test that entrypoint is properly extracted and included in the compiled workflow require.NoError(t, err, "Failed to write test file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Compilation should succeed") @@ -92,7 +92,7 @@ Test that mounts are properly extracted and included in the compiled workflow. require.NoError(t, err, "Failed to write test file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Compilation should succeed") @@ -143,7 +143,7 @@ Test that both entrypoint and mounts are properly extracted and included in the require.NoError(t, err, "Failed to write test file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Compilation should succeed") @@ -195,7 +195,7 @@ Test that workflows without entrypoint or mounts still compile correctly. require.NoError(t, err, "Failed to write test file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Compilation should succeed") @@ -243,7 +243,7 @@ Test that entrypoint with special characters in args is properly handled. require.NoError(t, err, "Failed to write test file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Compilation should succeed") @@ -292,7 +292,7 @@ Test that mounts with environment variables are properly handled. require.NoError(t, err, "Failed to write test file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Compilation should succeed") diff --git a/pkg/workflow/mcp_http_url_validation_test.go b/pkg/workflow/mcp_http_url_validation_test.go index 068e7e8953..3cc86a4c5c 100644 --- a/pkg/workflow/mcp_http_url_validation_test.go +++ b/pkg/workflow/mcp_http_url_validation_test.go @@ -79,7 +79,7 @@ mcp-servers: } // Create compiler and try to compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowPath) if tt.expectError { diff --git a/pkg/workflow/mcp_logs_upload_test.go b/pkg/workflow/mcp_logs_upload_test.go index 755ba0264a..25a8a92105 100644 --- a/pkg/workflow/mcp_logs_upload_test.go +++ b/pkg/workflow/mcp_logs_upload_test.go @@ -37,7 +37,7 @@ Please navigate to example.com and take a screenshot. } // Initialize compiler - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(mdFile) @@ -140,7 +140,7 @@ This workflow does not use Playwright but should still have MCP logs upload. } // Initialize compiler - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Compile the workflow err := compiler.CompileWorkflow(mdFile) diff --git a/pkg/workflow/mcp_safe_inputs_conditional_test.go b/pkg/workflow/mcp_safe_inputs_conditional_test.go index c1fbe0f4f5..25a6b8802e 100644 --- a/pkg/workflow/mcp_safe_inputs_conditional_test.go +++ b/pkg/workflow/mcp_safe_inputs_conditional_test.go @@ -97,7 +97,7 @@ Test Codex workflow with safe inputs t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/mcp_setup_generator_test.go b/pkg/workflow/mcp_setup_generator_test.go index 6cd6893a7e..07fc022ede 100644 --- a/pkg/workflow/mcp_setup_generator_test.go +++ b/pkg/workflow/mcp_setup_generator_test.go @@ -347,7 +347,7 @@ Test workflow with custom container and version.`, require.NoError(t, err, "Failed to write test workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() err = compiler.CompileWorkflow(testFile) require.NoError(t, err, "Failed to compile workflow") @@ -438,7 +438,7 @@ tools: Test that TAVILY_API_KEY is passed to gateway container. ` - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() tmpDir := t.TempDir() inputFile := filepath.Join(tmpDir, "test.md") @@ -497,7 +497,7 @@ tools: Test that multiple secrets are passed to gateway container. ` - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() tmpDir := t.TempDir() inputFile := filepath.Join(tmpDir, "test.md") diff --git a/pkg/workflow/missing_data_test.go b/pkg/workflow/missing_data_test.go index 64a0c41c3a..e6ab1e5a4c 100644 --- a/pkg/workflow/missing_data_test.go +++ b/pkg/workflow/missing_data_test.go @@ -87,7 +87,7 @@ func TestMissingDataSafeOutput(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Extract safe outputs config safeOutputs := compiler.extractSafeOutputsConfig(tt.frontmatter) @@ -177,7 +177,7 @@ func TestMissingDataConfigParsing(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := compiler.parseMissingDataConfig(tt.configData) if tt.expectNil { @@ -240,7 +240,7 @@ func TestBuildCreateOutputMissingDataJob(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ Name: "Test Workflow", diff --git a/pkg/workflow/missing_tool_test.go b/pkg/workflow/missing_tool_test.go index 20e870cde1..0eba84ad70 100644 --- a/pkg/workflow/missing_tool_test.go +++ b/pkg/workflow/missing_tool_test.go @@ -88,7 +88,7 @@ func TestMissingToolSafeOutput(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Extract safe outputs config safeOutputs := compiler.extractSafeOutputsConfig(tt.frontmatter) @@ -139,7 +139,7 @@ func TestMissingToolSafeOutput(t *testing.T) { } func TestGeneratePromptIncludesGitHubAWPrompt(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ MarkdownContent: "Test workflow content", @@ -162,7 +162,7 @@ func TestGeneratePromptIncludesGitHubAWPrompt(t *testing.T) { } func TestMissingToolPromptGeneration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create workflow data with missing-tool enabled data := &WorkflowData{ @@ -185,7 +185,7 @@ func TestMissingToolPromptGeneration(t *testing.T) { } func TestMissingToolNotEnabledByDefault(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with completely empty frontmatter emptyFrontmatter := map[string]any{} @@ -208,7 +208,7 @@ func TestMissingToolNotEnabledByDefault(t *testing.T) { } func TestMissingToolConfigParsing(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/multiline_test.go b/pkg/workflow/multiline_test.go index a03276fb04..a12c4826a2 100644 --- a/pkg/workflow/multiline_test.go +++ b/pkg/workflow/multiline_test.go @@ -8,7 +8,7 @@ import ( // TestMultilineStringHandling tests that multiline strings in with parameters // are correctly serialized with proper YAML indentation func TestMultilineStringHandling(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() testCases := []struct { name string diff --git a/pkg/workflow/network_merge_edge_cases_test.go b/pkg/workflow/network_merge_edge_cases_test.go index 874c44f9ac..df4fc2dadb 100644 --- a/pkg/workflow/network_merge_edge_cases_test.go +++ b/pkg/workflow/network_merge_edge_cases_test.go @@ -55,7 +55,7 @@ imports: t.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatal(err) } @@ -127,7 +127,7 @@ imports: t.Fatal(err) } - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatal(err) } diff --git a/pkg/workflow/network_merge_import_test.go b/pkg/workflow/network_merge_import_test.go index 74862405dc..d4d5816474 100644 --- a/pkg/workflow/network_merge_import_test.go +++ b/pkg/workflow/network_merge_import_test.go @@ -63,7 +63,7 @@ This workflow should have merged network domains. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/network_merge_integration_test.go b/pkg/workflow/network_merge_integration_test.go index 8601904f9d..f9522f2bda 100644 --- a/pkg/workflow/network_merge_integration_test.go +++ b/pkg/workflow/network_merge_integration_test.go @@ -79,7 +79,7 @@ This workflow should have merged network domains from multiple sources. } // Compile the workflow - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("CompileWorkflow failed: %v", err) } diff --git a/pkg/workflow/network_test.go b/pkg/workflow/network_test.go index 27dfcfe6cd..a1ede298fd 100644 --- a/pkg/workflow/network_test.go +++ b/pkg/workflow/network_test.go @@ -8,7 +8,7 @@ import ( ) func TestCompilerNetworkPermissionsExtraction(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Helper function to create a temporary workflow file for testing createTempWorkflowFile := func(content string) (string, func()) { diff --git a/pkg/workflow/neutral_tools_integration_test.go b/pkg/workflow/neutral_tools_integration_test.go index 686db4c5b4..9eeb433dbe 100644 --- a/pkg/workflow/neutral_tools_integration_test.go +++ b/pkg/workflow/neutral_tools_integration_test.go @@ -12,7 +12,7 @@ import ( ) func TestNeutralToolsIntegration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Skip schema validation for this test tempDir := testutil.TempDir(t, "test-*") @@ -109,7 +109,7 @@ Test workflow with neutral tools format. } func TestBackwardCompatibilityWithClaudeFormat(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Skip schema validation for this test tempDir := testutil.TempDir(t, "test-*") diff --git a/pkg/workflow/neutral_tools_simple_test.go b/pkg/workflow/neutral_tools_simple_test.go index d0216a0189..5bac133635 100644 --- a/pkg/workflow/neutral_tools_simple_test.go +++ b/pkg/workflow/neutral_tools_simple_test.go @@ -27,7 +27,7 @@ func TestNeutralToolsExpandsToClaudeTools(t *testing.T) { } // Extract cache-memory config - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() cacheMemoryConfig, _ := compiler.extractCacheMemoryConfigFromMap(neutralTools) result := engine.computeAllowedClaudeToolsString(neutralTools, safeOutputs, cacheMemoryConfig) @@ -82,7 +82,7 @@ func TestNeutralToolsWithoutSafeOutputs(t *testing.T) { } // Extract cache-memory config - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() cacheMemoryConfig, _ := compiler.extractCacheMemoryConfigFromMap(neutralTools) result := engine.computeAllowedClaudeToolsString(neutralTools, nil, cacheMemoryConfig) diff --git a/pkg/workflow/noop_in_conclusion_test.go b/pkg/workflow/noop_in_conclusion_test.go index ef3819ea13..0718e3cc3b 100644 --- a/pkg/workflow/noop_in_conclusion_test.go +++ b/pkg/workflow/noop_in_conclusion_test.go @@ -36,7 +36,7 @@ Test that noop step is generated inside the conclusion job. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -110,7 +110,7 @@ Test that missing_tool step is generated inside the conclusion job. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -189,7 +189,7 @@ Test that both noop and missing_tool steps are generated inside the conclusion j t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/notify_comment_test.go b/pkg/workflow/notify_comment_test.go index 4edc585ce8..1faaec234c 100644 --- a/pkg/workflow/notify_comment_test.go +++ b/pkg/workflow/notify_comment_test.go @@ -140,7 +140,7 @@ func TestConclusionJob(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create a test workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", AIReaction: tt.aiReaction, @@ -236,7 +236,7 @@ func TestConclusionJob(t *testing.T) { func TestConclusionJobIntegration(t *testing.T) { // Test that the job is properly integrated with activation job outputs - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", AIReaction: "eyes", // This causes the activation job to create a comment @@ -304,7 +304,7 @@ func TestConclusionJobIntegration(t *testing.T) { func TestConclusionJobWithMessages(t *testing.T) { // Test that the conclusion job includes custom messages when configured - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", AIReaction: "eyes", @@ -356,7 +356,7 @@ func TestConclusionJobWithMessages(t *testing.T) { func TestConclusionJobWithoutMessages(t *testing.T) { // Test that the conclusion job does NOT include messages env var when not configured - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", AIReaction: "eyes", @@ -397,7 +397,7 @@ func TestConclusionJobWithoutMessages(t *testing.T) { func TestActivationJobWithMessages(t *testing.T) { // Test that the activation job includes custom messages when configured - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", AIReaction: "eyes", @@ -446,7 +446,7 @@ func TestActivationJobWithMessages(t *testing.T) { func TestActivationJobWithoutMessages(t *testing.T) { // Test that the activation job does NOT include messages env var when not configured - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "Test Workflow", AIReaction: "eyes", @@ -485,7 +485,7 @@ func TestActivationJobWithoutMessages(t *testing.T) { // TestConclusionJobWithGeneratedAssets tests that the conclusion job includes environment variables // for safe output job URLs when safe output jobs are present func TestConclusionJobWithGeneratedAssets(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Create workflow data with safe outputs configuration workflowData := &WorkflowData{ diff --git a/pkg/workflow/patch_artifact_download_verification_test.go b/pkg/workflow/patch_artifact_download_verification_test.go index a338e78c44..543f868b74 100644 --- a/pkg/workflow/patch_artifact_download_verification_test.go +++ b/pkg/workflow/patch_artifact_download_verification_test.go @@ -46,7 +46,7 @@ in the consolidated safe_outputs job when create-pull-request is enabled. t.Fatalf("Failed to write test markdown file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -140,7 +140,7 @@ push-to-pull-request-branch is enabled. t.Fatalf("Failed to write test markdown file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -193,7 +193,7 @@ only non-PR safe outputs are enabled. t.Fatalf("Failed to write test markdown file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/patch_size_validation_test.go b/pkg/workflow/patch_size_validation_test.go index 0684ae415b..ef0991a30e 100644 --- a/pkg/workflow/patch_size_validation_test.go +++ b/pkg/workflow/patch_size_validation_test.go @@ -83,7 +83,7 @@ This workflow tests custom 2MB patch size configuration.`, } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -171,7 +171,7 @@ This workflow tests large valid patch size configuration.`, } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/permission_restriction_test.go b/pkg/workflow/permission_restriction_test.go index bb47267a81..be82a70724 100644 --- a/pkg/workflow/permission_restriction_test.go +++ b/pkg/workflow/permission_restriction_test.go @@ -16,7 +16,7 @@ func TestDefaultPermissionRestriction(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-permission-restriction-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -256,7 +256,7 @@ func TestCommandWorkflowStillWorks(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-command-compatibility-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: diff --git a/pkg/workflow/permissions_explicit_empty_test.go b/pkg/workflow/permissions_explicit_empty_test.go index 48e18925f7..54d39d007f 100644 --- a/pkg/workflow/permissions_explicit_empty_test.go +++ b/pkg/workflow/permissions_explicit_empty_test.go @@ -88,7 +88,7 @@ Test content`, } // Compile with specified action mode - compiler := NewCompiler(false, "", "v1.0.0") + compiler := NewCompilerWithVersion("v1.0.0") compiler.actionMode = tt.actionMode err = compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/permissions_import_test.go b/pkg/workflow/permissions_import_test.go index 8ab1ef9db3..f34a2b29d1 100644 --- a/pkg/workflow/permissions_import_test.go +++ b/pkg/workflow/permissions_import_test.go @@ -74,7 +74,7 @@ func TestValidateIncludedPermissions(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.ValidateIncludedPermissions(tt.topPermissionsYAML, tt.importedPermissions) if tt.expectError { @@ -139,7 +139,7 @@ tools: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainWorkflowPath) if err != nil { t.Fatalf("Expected compilation to succeed but got error: %v", err) @@ -190,7 +190,7 @@ tools: } // Compile the workflow - should fail - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainWorkflowPath) if err == nil { t.Fatalf("Expected compilation to fail due to missing permissions") @@ -244,7 +244,7 @@ tools: } // Compile the workflow - should fail - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainWorkflowPath) if err == nil { t.Fatalf("Expected compilation to fail due to insufficient permissions") @@ -284,7 +284,7 @@ tools: } // Compile the workflow - should succeed - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainWorkflowPath) if err != nil { t.Fatalf("Expected compilation to succeed but got error: %v", err) diff --git a/pkg/workflow/permissions_shortcut_included_test.go b/pkg/workflow/permissions_shortcut_included_test.go index 3bf8b9b70e..2dc640f140 100644 --- a/pkg/workflow/permissions_shortcut_included_test.go +++ b/pkg/workflow/permissions_shortcut_included_test.go @@ -86,7 +86,7 @@ tools: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainWorkflowPath) if tt.expectCompilationError { @@ -177,7 +177,7 @@ tools: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(mainWorkflowPath) if tt.expectCompilationError { diff --git a/pkg/workflow/permissions_warning_test.go b/pkg/workflow/permissions_warning_test.go index 7f560680eb..bb91248125 100644 --- a/pkg/workflow/permissions_warning_test.go +++ b/pkg/workflow/permissions_warning_test.go @@ -126,7 +126,7 @@ tools: r, w, _ := os.Pipe() os.Stderr = w - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(tt.strict) err := compiler.CompileWorkflow(testFile) @@ -205,7 +205,7 @@ tools: r, w, _ := os.Pipe() os.Stderr = w - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/playwright_allowed_domains_secrets_test.go b/pkg/workflow/playwright_allowed_domains_secrets_test.go index 725dd07fea..42c8b5ee16 100644 --- a/pkg/workflow/playwright_allowed_domains_secrets_test.go +++ b/pkg/workflow/playwright_allowed_domains_secrets_test.go @@ -97,7 +97,7 @@ Test no secrets in allowed_domains. tmpFile.Close() // Create compiler and compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // Parse the workflow file to get WorkflowData diff --git a/pkg/workflow/playwright_mcp_integration_test.go b/pkg/workflow/playwright_mcp_integration_test.go index 1716c8a025..1a78f7a6a4 100644 --- a/pkg/workflow/playwright_mcp_integration_test.go +++ b/pkg/workflow/playwright_mcp_integration_test.go @@ -96,7 +96,7 @@ Test playwright with copilot engine. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/pr_checkout_test.go b/pkg/workflow/pr_checkout_test.go index fe1ead7fc2..63a4d11b3a 100644 --- a/pkg/workflow/pr_checkout_test.go +++ b/pkg/workflow/pr_checkout_test.go @@ -197,7 +197,7 @@ Test workflow with permissions but checkout should be conditional. } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -290,7 +290,7 @@ Test workflow with multiple comment triggers. } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -363,7 +363,7 @@ Test workflow to verify GH_TOKEN configuration. } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/pr_ready_for_review_checkout_test.go b/pkg/workflow/pr_ready_for_review_checkout_test.go index 18f00a1d2f..5981f0c145 100644 --- a/pkg/workflow/pr_ready_for_review_checkout_test.go +++ b/pkg/workflow/pr_ready_for_review_checkout_test.go @@ -122,7 +122,7 @@ Test workflow without checkout (has permissions but checkout should be condition } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -201,7 +201,7 @@ Test workflow with pull_request triggers. } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/pre_activation_custom_fields_test.go b/pkg/workflow/pre_activation_custom_fields_test.go index d2bb8d785f..5da94504f7 100644 --- a/pkg/workflow/pre_activation_custom_fields_test.go +++ b/pkg/workflow/pre_activation_custom_fields_test.go @@ -15,7 +15,7 @@ import ( // TestPreActivationCustomSteps tests that custom steps from jobs.pre-activation are imported func TestPreActivationCustomSteps(t *testing.T) { tmpDir := testutil.TempDir(t, "pre-activation-custom-steps-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("custom_steps_imported", func(t *testing.T) { workflowContent := `--- @@ -318,7 +318,7 @@ Test that both pre-activation and pre_activation are imported // TestExtractPreActivationCustomFields tests the extractPreActivationCustomFields method directly func TestExtractPreActivationCustomFields(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/processing_benchmark_test.go b/pkg/workflow/processing_benchmark_test.go index aafddb3e5f..cb6b21de9c 100644 --- a/pkg/workflow/processing_benchmark_test.go +++ b/pkg/workflow/processing_benchmark_test.go @@ -37,7 +37,7 @@ Simple tool processing test. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -91,7 +91,7 @@ Complex tool configuration processing. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -131,7 +131,7 @@ Simple safe outputs configuration. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -186,7 +186,7 @@ Complex safe outputs configuration. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -228,7 +228,7 @@ Network permissions processing. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -269,7 +269,7 @@ Permission processing test. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { @@ -307,7 +307,7 @@ Role processing test. b.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() b.ResetTimer() for i := 0; i < b.N; i++ { diff --git a/pkg/workflow/project_safe_outputs_test.go b/pkg/workflow/project_safe_outputs_test.go index 6a0953ce3e..5e340c4009 100644 --- a/pkg/workflow/project_safe_outputs_test.go +++ b/pkg/workflow/project_safe_outputs_test.go @@ -8,7 +8,7 @@ import ( ) func TestParseProjectConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -111,7 +111,7 @@ func TestParseProjectConfig(t *testing.T) { } func TestApplyProjectSafeOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -228,7 +228,7 @@ func TestApplyProjectSafeOutputs(t *testing.T) { } func TestProjectConfigIntegration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test full integration: frontmatter -> safe-outputs config frontmatter := map[string]any{ diff --git a/pkg/workflow/projects_toolset_warning_test.go b/pkg/workflow/projects_toolset_warning_test.go index c8c84e9f7e..3ce14a70c5 100644 --- a/pkg/workflow/projects_toolset_warning_test.go +++ b/pkg/workflow/projects_toolset_warning_test.go @@ -137,7 +137,7 @@ This workflow uses all with redundant repos. os.Stderr = w // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compileErr := compiler.CompileWorkflow(mdPath) require.NoError(t, compileErr, "Failed to compile workflow") diff --git a/pkg/workflow/prompts_test.go b/pkg/workflow/prompts_test.go index 675db79f27..e8f27effbc 100644 --- a/pkg/workflow/prompts_test.go +++ b/pkg/workflow/prompts_test.go @@ -101,7 +101,7 @@ This is a test workflow with cache-memory enabled. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -171,7 +171,7 @@ This is a test workflow without cache-memory. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -230,7 +230,7 @@ This is a test workflow with multiple cache-memory entries. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -297,7 +297,7 @@ This is a test workflow with playwright enabled. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -351,7 +351,7 @@ This is a test workflow without playwright. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -406,7 +406,7 @@ This is a test workflow to verify playwright instructions come after temp folder } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -474,7 +474,7 @@ This is a test workflow with issue_comment trigger. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -530,7 +530,7 @@ This is a test workflow with command trigger. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -579,7 +579,7 @@ This is a test workflow with push trigger only. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -632,7 +632,7 @@ This is a test workflow without contents read permission. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/publish_assets_test.go b/pkg/workflow/publish_assets_test.go index 88b6a7e6c3..f6f90c7fd9 100644 --- a/pkg/workflow/publish_assets_test.go +++ b/pkg/workflow/publish_assets_test.go @@ -114,7 +114,7 @@ func TestHasSafeOutputsEnabledWithUploadAsset(t *testing.T) { func TestUploadAssetsJobUsesFileInput(t *testing.T) { // Test that the upload_assets job reads from file (via env var) not JSON payload - c := NewCompiler(false, "", "") + c := NewCompiler() data := &WorkflowData{ Name: "Test Workflow", SafeOutputs: &SafeOutputsConfig{ diff --git a/pkg/workflow/push_to_pull_request_branch_test.go b/pkg/workflow/push_to_pull_request_branch_test.go index a114895d6b..a63f18c51c 100644 --- a/pkg/workflow/push_to_pull_request_branch_test.go +++ b/pkg/workflow/push_to_pull_request_branch_test.go @@ -39,7 +39,7 @@ Please make changes and push them to the feature branch. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -117,7 +117,7 @@ This workflow allows pushing to any pull request. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -169,7 +169,7 @@ This workflow uses the default branch value. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // This should succeed and use default branch "triggering" err := compiler.CompileWorkflow(mdFile) @@ -217,7 +217,7 @@ This workflow uses null configuration which should default to "triggering". } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // This should succeed and use default branch "triggering" err := compiler.CompileWorkflow(mdFile) @@ -269,7 +269,7 @@ This workflow has minimal push-to-pull-request-branch configuration. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -332,7 +332,7 @@ This workflow fails when there are no changes. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -379,7 +379,7 @@ This workflow ignores when there are no changes. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -425,7 +425,7 @@ This workflow uses default if-no-changes behavior. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -472,7 +472,7 @@ This workflow explicitly sets branch to "triggering". } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -525,7 +525,7 @@ This workflow validates PR title prefix. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -573,7 +573,7 @@ This workflow validates PR labels. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -622,7 +622,7 @@ This workflow validates both PR title prefix and labels. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -673,7 +673,7 @@ This workflow appends a suffix to commit titles. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -720,7 +720,7 @@ since it's not supported by actions/github-script. } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -777,7 +777,7 @@ Test that the push-to-pull-request-branch job receives activation comment enviro } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -843,7 +843,7 @@ This test verifies that the aw.patch artifact is downloaded in the safe_outputs } // Create compiler and compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/reaction_none_test.go b/pkg/workflow/reaction_none_test.go index 04a63a30bb..d507c91904 100644 --- a/pkg/workflow/reaction_none_test.go +++ b/pkg/workflow/reaction_none_test.go @@ -41,7 +41,7 @@ Test command workflow with reaction explicitly disabled. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -128,7 +128,7 @@ Test command workflow with default (eyes) reaction. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -217,7 +217,7 @@ Test command workflow with explicit rocket reaction. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -294,7 +294,7 @@ Test workflow triggered by issue template with "eyes" reaction. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/reaction_outputs_test.go b/pkg/workflow/reaction_outputs_test.go index dbd6fb4c8f..d6d5f4a47c 100644 --- a/pkg/workflow/reaction_outputs_test.go +++ b/pkg/workflow/reaction_outputs_test.go @@ -42,7 +42,7 @@ This workflow should generate add_reaction job with comment outputs. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -116,7 +116,7 @@ This workflow should generate add_reaction job with GH_AW_WORKFLOW_NAME environm t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/redact_secrets_test.go b/pkg/workflow/redact_secrets_test.go index c29a38534c..800e340873 100644 --- a/pkg/workflow/redact_secrets_test.go +++ b/pkg/workflow/redact_secrets_test.go @@ -106,7 +106,7 @@ Test workflow for secret redaction. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/repo_memory_integration_test.go b/pkg/workflow/repo_memory_integration_test.go index 9db6850a4b..1cf8d79340 100644 --- a/pkg/workflow/repo_memory_integration_test.go +++ b/pkg/workflow/repo_memory_integration_test.go @@ -33,7 +33,7 @@ This workflow uses repo memory. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -93,7 +93,7 @@ This workflow uses custom repo memory configuration. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -150,7 +150,7 @@ This workflow uses multiple repo memories. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -217,7 +217,7 @@ This workflow has file validation. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -278,7 +278,7 @@ This workflow has repo-memory disabled. t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/repo_memory_path_consistency_test.go b/pkg/workflow/repo_memory_path_consistency_test.go index badd625b52..7bae3ad2be 100644 --- a/pkg/workflow/repo_memory_path_consistency_test.go +++ b/pkg/workflow/repo_memory_path_consistency_test.go @@ -117,7 +117,7 @@ func TestRepoMemoryPathConsistencyAcrossLayers(t *testing.T) { "Clone step should use correct branch name") // Test 4: Validate push job artifact download - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() pushJob, err := compiler.buildPushRepoMemoryJob(data, false) require.NoError(t, err, "Should successfully build push job") require.NotNil(t, pushJob, "Push job should not be nil") @@ -239,7 +239,7 @@ func TestRepoMemoryArtifactPathNoTrailingSlash(t *testing.T) { "Artifact upload path must not have trailing slash") // Test artifact download in push job - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() pushJob, err := compiler.buildPushRepoMemoryJob(data, false) require.NoError(t, err) require.NotNil(t, pushJob) @@ -303,7 +303,7 @@ func TestRepoMemoryArtifactNameFormat(t *testing.T) { "Artifact upload should use correct naming convention") // Check artifact download in push job - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() pushJob, err := compiler.buildPushRepoMemoryJob(data, false) require.NoError(t, err) require.NotNil(t, pushJob) @@ -416,7 +416,7 @@ func TestRepoMemoryMultipleMemoriesPathConsistency(t *testing.T) { "Should use correct logs directory") // Test push job - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() pushJob, err := compiler.buildPushRepoMemoryJob(data, false) require.NoError(t, err) require.NotNil(t, pushJob) @@ -459,7 +459,7 @@ func TestRepoMemoryPathComponentIsolation(t *testing.T) { var cloneBuilder strings.Builder generateRepoMemorySteps(&cloneBuilder, data) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() pushJob, err := compiler.buildPushRepoMemoryJob(data, false) require.NoError(t, err) require.NotNil(t, pushJob) diff --git a/pkg/workflow/repo_memory_test.go b/pkg/workflow/repo_memory_test.go index 073b90fe7c..ec66dec906 100644 --- a/pkg/workflow/repo_memory_test.go +++ b/pkg/workflow/repo_memory_test.go @@ -19,7 +19,7 @@ func TestRepoMemoryConfigDefault(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if err != nil { t.Fatalf("Failed to extract repo-memory config: %v", err) @@ -71,7 +71,7 @@ func TestRepoMemoryConfigObject(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if err != nil { t.Fatalf("Failed to extract repo-memory config: %v", err) @@ -124,7 +124,7 @@ func TestRepoMemoryConfigArray(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if err != nil { t.Fatalf("Failed to extract repo-memory config: %v", err) @@ -180,7 +180,7 @@ func TestRepoMemoryConfigDuplicateIDs(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() _, err = compiler.extractRepoMemoryConfig(toolsConfig) if err == nil { t.Fatal("Expected error for duplicate memory IDs, got nil") @@ -408,7 +408,7 @@ func TestRepoMemoryMaxFileSizeValidation(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if tt.wantError { @@ -478,7 +478,7 @@ func TestRepoMemoryMaxFileSizeValidationArray(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if tt.wantError { @@ -567,7 +567,7 @@ func TestRepoMemoryMaxFileCountValidation(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if tt.wantError { @@ -637,7 +637,7 @@ func TestRepoMemoryMaxFileCountValidationArray(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if tt.wantError { @@ -682,7 +682,7 @@ func TestRepoMemoryConfigWithCampaignID(t *testing.T) { t.Fatalf("Failed to parse tools config: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) if err != nil { t.Fatalf("Failed to extract repo-memory config: %v", err) @@ -837,7 +837,7 @@ func TestBranchPrefixInConfig(t *testing.T) { toolsConfig, err := ParseToolsConfig(toolsMap) require.NoError(t, err, "Failed to parse tools config") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) require.NoError(t, err, "Failed to extract repo-memory config") require.NotNil(t, config, "Expected non-nil config") @@ -866,7 +866,7 @@ func TestBranchPrefixInArrayConfig(t *testing.T) { toolsConfig, err := ParseToolsConfig(toolsMap) require.NoError(t, err, "Failed to parse tools config") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) require.NoError(t, err, "Failed to extract repo-memory config") require.NotNil(t, config, "Expected non-nil config") @@ -891,7 +891,7 @@ func TestBranchPrefixWithExplicitBranchName(t *testing.T) { toolsConfig, err := ParseToolsConfig(toolsMap) require.NoError(t, err, "Failed to parse tools config") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) require.NoError(t, err, "Failed to extract repo-memory config") require.NotNil(t, config, "Expected non-nil config") @@ -926,7 +926,7 @@ func TestInvalidBranchPrefixRejectsConfig(t *testing.T) { toolsConfig, err := ParseToolsConfig(toolsMap) require.NoError(t, err, "Failed to parse tools config") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config, err := compiler.extractRepoMemoryConfig(toolsConfig) require.Error(t, err, "Expected error for invalid branch-prefix: %s", tt.prefix) assert.Nil(t, config, "Expected nil config on error") diff --git a/pkg/workflow/repository_features_validation_integration_test.go b/pkg/workflow/repository_features_validation_integration_test.go index 94e046c5d9..9a3ad37f69 100644 --- a/pkg/workflow/repository_features_validation_integration_test.go +++ b/pkg/workflow/repository_features_validation_integration_test.go @@ -65,7 +65,7 @@ func TestRepositoryFeaturesValidationIntegration(t *testing.T) { }, } - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() err := compiler.validateRepositoryFeatures(workflowData) // After the fix, validation should never return an error for discussions @@ -91,7 +91,7 @@ func TestRepositoryFeaturesValidationIntegration(t *testing.T) { }, } - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() err := compiler.validateRepositoryFeatures(workflowData) hasIssues, checkErr := checkRepositoryHasIssues(repo, false) @@ -153,7 +153,7 @@ Test workflow for discussions validation. } // Try to compile the workflow - compiler := NewCompiler(true, "", "test") + compiler := NewCompiler() compiler.SetNoEmit(true) // Don't write lock file err = compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/repository_features_validation_test.go b/pkg/workflow/repository_features_validation_test.go index a57527b7e9..f54453bfb0 100644 --- a/pkg/workflow/repository_features_validation_test.go +++ b/pkg/workflow/repository_features_validation_test.go @@ -89,7 +89,7 @@ func TestValidateRepositoryFeatures(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.validateRepositoryFeatures(tt.workflowData) if tt.expectError && err == nil { diff --git a/pkg/workflow/role_checks_test.go b/pkg/workflow/role_checks_test.go index 57f886b32d..c0d6966512 100644 --- a/pkg/workflow/role_checks_test.go +++ b/pkg/workflow/role_checks_test.go @@ -14,7 +14,7 @@ import ( func TestRoleMembershipUsesGitHubToken(t *testing.T) { tmpDir := testutil.TempDir(t, "role-membership-token-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: @@ -105,7 +105,7 @@ Test that role membership check uses GITHUB_TOKEN.` func TestRoleMembershipTokenWithBots(t *testing.T) { tmpDir := testutil.TempDir(t, "role-membership-token-bots-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := `--- on: diff --git a/pkg/workflow/runtime_import_checkout_test.go b/pkg/workflow/runtime_import_checkout_test.go index c17eac0a2b..549c5bef50 100644 --- a/pkg/workflow/runtime_import_checkout_test.go +++ b/pkg/workflow/runtime_import_checkout_test.go @@ -158,7 +158,7 @@ features: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -212,7 +212,7 @@ features: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/runtime_import_validation_test.go b/pkg/workflow/runtime_import_validation_test.go index 55c589907f..3a5e1f34f4 100644 --- a/pkg/workflow/runtime_import_validation_test.go +++ b/pkg/workflow/runtime_import_validation_test.go @@ -260,7 +260,7 @@ Please process the issue. require.NoError(t, os.WriteFile(workflowFile, []byte(workflowContent), 0644)) // Create compiler and attempt to compile - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowFile) @@ -308,7 +308,7 @@ Please process the issue. require.NoError(t, os.WriteFile(workflowFile, []byte(workflowContent), 0644)) // Create compiler and compile - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(workflowFile) diff --git a/pkg/workflow/runtime_integration_test.go b/pkg/workflow/runtime_integration_test.go index 41a1c054c7..a7583dd9b7 100644 --- a/pkg/workflow/runtime_integration_test.go +++ b/pkg/workflow/runtime_integration_test.go @@ -42,7 +42,7 @@ Test workflow with runtime overrides. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) @@ -137,7 +137,7 @@ Test workflow with imported runtimes. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData, err := compiler.ParseWorkflowFile(workflowPath) if err != nil { t.Fatalf("Failed to parse workflow: %v", err) @@ -222,7 +222,7 @@ Test workflow with runtime overrides applied to steps. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -281,7 +281,7 @@ Test workflow with custom setup action. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -335,7 +335,7 @@ Test workflow that uses Go without go.mod file. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -398,7 +398,7 @@ Test workflow that uses Go with custom go.mod path via Serena. } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/runtime_setup_integration_test.go b/pkg/workflow/runtime_setup_integration_test.go index e0e2dc0190..178fd4e0fa 100644 --- a/pkg/workflow/runtime_setup_integration_test.go +++ b/pkg/workflow/runtime_setup_integration_test.go @@ -176,7 +176,7 @@ engine: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -227,7 +227,7 @@ steps: t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -274,7 +274,7 @@ steps: t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -331,7 +331,7 @@ steps: t.Fatalf("Failed to write test file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/safe_inputs_experimental_warning_test.go b/pkg/workflow/safe_inputs_experimental_warning_test.go index d6f1c9ba29..9f94d45757 100644 --- a/pkg/workflow/safe_inputs_experimental_warning_test.go +++ b/pkg/workflow/safe_inputs_experimental_warning_test.go @@ -126,7 +126,7 @@ permissions: r, w, _ := os.Pipe() os.Stderr = w - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/safe_inputs_http_codex_test.go b/pkg/workflow/safe_inputs_http_codex_test.go index 787542e04b..b6d2741158 100644 --- a/pkg/workflow/safe_inputs_http_codex_test.go +++ b/pkg/workflow/safe_inputs_http_codex_test.go @@ -35,7 +35,7 @@ Test safe-inputs HTTP transport for Codex } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -145,7 +145,7 @@ Test safe-inputs with secrets t.Fatalf("Failed to write workflow file: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/safe_inputs_mode_test.go b/pkg/workflow/safe_inputs_mode_test.go index 27fc53aeba..d968d8b209 100644 --- a/pkg/workflow/safe_inputs_mode_test.go +++ b/pkg/workflow/safe_inputs_mode_test.go @@ -51,7 +51,7 @@ Test safe-inputs HTTP mode } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/safe_jobs_syntax_test.go b/pkg/workflow/safe_jobs_syntax_test.go index 8e82af23c6..64b6197e5a 100644 --- a/pkg/workflow/safe_jobs_syntax_test.go +++ b/pkg/workflow/safe_jobs_syntax_test.go @@ -11,7 +11,7 @@ import ( // TestOldSafeJobsSyntaxRejected verifies that the old top-level safe-jobs syntax is rejected func TestOldSafeJobsSyntaxRejected(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() // Create a temporary workflow file with old safe-jobs syntax tmpDir := testutil.TempDir(t, "test-*") @@ -52,7 +52,7 @@ Test old syntax // TestNewSafeOutputsJobsSyntaxAccepted verifies that the new safe-outputs.jobs syntax works func TestNewSafeOutputsJobsSyntaxAccepted(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() // Create a temporary workflow file with new safe-outputs.jobs syntax tmpDir := testutil.TempDir(t, "test-*") diff --git a/pkg/workflow/safe_jobs_test.go b/pkg/workflow/safe_jobs_test.go index 4ef24ffad0..f9bacd14e4 100644 --- a/pkg/workflow/safe_jobs_test.go +++ b/pkg/workflow/safe_jobs_test.go @@ -6,7 +6,7 @@ import ( ) func TestParseSafeJobsConfig(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test parseSafeJobsConfig internal function which expects a "safe-jobs" key. // Note: User workflows should use "safe-outputs.jobs" syntax; this test validates @@ -166,7 +166,7 @@ func TestHasSafeJobsEnabled(t *testing.T) { } func TestBuildSafeJobs(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -259,7 +259,7 @@ func TestBuildSafeJobs(t *testing.T) { } func TestBuildSafeJobsWithNoConfiguration(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with no SafeJobs workflowData := &WorkflowData{ @@ -288,7 +288,7 @@ func TestBuildSafeJobsWithNoConfiguration(t *testing.T) { } func TestBuildSafeJobsWithoutCustomIfCondition(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -339,7 +339,7 @@ func TestBuildSafeJobsWithoutCustomIfCondition(t *testing.T) { } func TestBuildSafeJobsWithDashesInName(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -515,7 +515,7 @@ func TestMergeSafeJobs(t *testing.T) { } func TestMergeSafeJobsFromIncludes(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() topSafeJobs := map[string]*SafeJobConfig{ "deploy": { @@ -582,7 +582,7 @@ func TestMergeSafeJobsFromIncludes(t *testing.T) { // TestMergeSafeJobsFromIncludedConfigs tests merging safe-jobs from included safe-outputs configurations func TestMergeSafeJobsFromIncludedConfigs(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() // Top-level safe-jobs topSafeJobs := map[string]*SafeJobConfig{ @@ -676,7 +676,7 @@ func TestMergeSafeJobsFromIncludedConfigs(t *testing.T) { // TestSafeJobsInputTypes tests that safe-jobs inputs support all input types // and share the same InputDefinition type with workflow_dispatch inputs func TestSafeJobsInputTypes(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() frontmatter := map[string]any{ "safe-jobs": map[string]any{ diff --git a/pkg/workflow/safe_jobs_threat_detection_test.go b/pkg/workflow/safe_jobs_threat_detection_test.go index 64ce588194..2409088e0d 100644 --- a/pkg/workflow/safe_jobs_threat_detection_test.go +++ b/pkg/workflow/safe_jobs_threat_detection_test.go @@ -11,7 +11,7 @@ import ( // TestSafeOutputsJobsEnableThreatDetectionByDefault verifies that when safe-outputs.jobs // is configured, threat detection is automatically enabled even if not mentioned in frontmatter func TestSafeOutputsJobsEnableThreatDetectionByDefault(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() frontmatter := map[string]any{ "safe-outputs": map[string]any{ @@ -48,7 +48,7 @@ func TestSafeOutputsJobsEnableThreatDetectionByDefault(t *testing.T) { // TestSafeOutputsJobsRespectExplicitThreatDetectionFalse verifies that when // threat-detection is explicitly set to false, it respects that setting func TestSafeOutputsJobsRespectExplicitThreatDetectionFalse(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() frontmatter := map[string]any{ "safe-outputs": map[string]any{ @@ -81,7 +81,7 @@ func TestSafeOutputsJobsRespectExplicitThreatDetectionFalse(t *testing.T) { // TestSafeOutputsJobsRespectExplicitThreatDetectionTrue verifies that when // threat-detection is explicitly set to true, it respects that setting func TestSafeOutputsJobsRespectExplicitThreatDetectionTrue(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() frontmatter := map[string]any{ "safe-outputs": map[string]any{ @@ -114,7 +114,7 @@ func TestSafeOutputsJobsRespectExplicitThreatDetectionTrue(t *testing.T) { // TestSafeOutputsJobsDependOnDetectionJob verifies that custom safe-output jobs // depend on the detection job when threat detection is enabled func TestSafeOutputsJobsDependOnDetectionJob(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -179,7 +179,7 @@ func TestSafeOutputsJobsDependOnDetectionJob(t *testing.T) { // TestSafeOutputsJobsDoNotDependOnDetectionWhenDisabled verifies that custom safe-output jobs // do NOT depend on the detection job when threat detection is disabled func TestSafeOutputsJobsDoNotDependOnDetectionWhenDisabled(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -264,7 +264,7 @@ func TestHasSafeOutputsEnabledWithoutJobs(t *testing.T) { // TestSafeJobsWithThreatDetectionConfigObject verifies that threat detection // configuration object is properly handled func TestSafeJobsWithThreatDetectionConfigObject(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() frontmatter := map[string]any{ "safe-outputs": map[string]any{ @@ -305,7 +305,7 @@ func TestSafeJobsWithThreatDetectionConfigObject(t *testing.T) { // TestSafeJobsIntegrationWithWorkflowCompilation is an integration test that verifies // the entire workflow compilation process with safe-output jobs and threat detection func TestSafeJobsIntegrationWithWorkflowCompilation(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() markdown := `--- on: issues diff --git a/pkg/workflow/safe_output_refactor_test.go b/pkg/workflow/safe_output_refactor_test.go index 4dbbd732c5..a944157739 100644 --- a/pkg/workflow/safe_output_refactor_test.go +++ b/pkg/workflow/safe_output_refactor_test.go @@ -12,7 +12,7 @@ import ( // TestCreatePRReviewCommentUsesHelper verifies that create_pr_review_comment.go // uses the buildSafeOutputJobEnvVars helper correctly func TestCreatePRReviewCommentUsesHelper(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -47,7 +47,7 @@ func TestCreatePRReviewCommentUsesHelper(t *testing.T) { // TestCreateDiscussionUsesHelper verifies that create_discussion.go // uses the buildSafeOutputJobEnvVars helper correctly (standalone job still uses env vars) func TestCreateDiscussionUsesHelper(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -82,7 +82,7 @@ func TestCreateDiscussionUsesHelper(t *testing.T) { // TestTrialModeWithoutTargetRepo verifies that trial mode without explicit // target-repo config uses the trial repo slug func TestTrialModeWithoutTargetRepo(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetTrialMode(true) c.SetTrialLogicalRepoSlug("owner/trial-repo") @@ -120,7 +120,7 @@ func TestTrialModeWithoutTargetRepo(t *testing.T) { // TestNoStagedNorTrialMode verifies that neither staged flag nor target repo slug // are added when not configured func TestNoStagedNorTrialMode(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -153,7 +153,7 @@ func TestNoStagedNorTrialMode(t *testing.T) { // TestTargetRepoOverridesTrialRepo verifies that explicit target-repo config // takes precedence over trial mode repo slug func TestTargetRepoOverridesTrialRepo(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetTrialMode(true) c.SetTrialLogicalRepoSlug("owner/trial-repo") @@ -303,7 +303,7 @@ safe-outputs: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -423,7 +423,7 @@ safe-outputs: } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/safe_outputs_app_import_test.go b/pkg/workflow/safe_outputs_app_import_test.go index f031b1c105..3579bf3915 100644 --- a/pkg/workflow/safe_outputs_app_import_test.go +++ b/pkg/workflow/safe_outputs_app_import_test.go @@ -12,7 +12,7 @@ import ( // TestSafeOutputsAppImport tests that app configuration can be imported from shared workflows func TestSafeOutputsAppImport(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -80,7 +80,7 @@ This workflow uses the imported app configuration. // TestSafeOutputsAppImportOverride tests that local app configuration overrides imported one func TestSafeOutputsAppImportOverride(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -149,7 +149,7 @@ This workflow overrides the imported app configuration. // TestSafeOutputsAppImportStepGeneration tests that imported app config generates correct steps func TestSafeOutputsAppImportStepGeneration(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() diff --git a/pkg/workflow/safe_outputs_app_test.go b/pkg/workflow/safe_outputs_app_test.go index c97e557028..14b0168998 100644 --- a/pkg/workflow/safe_outputs_app_test.go +++ b/pkg/workflow/safe_outputs_app_test.go @@ -12,7 +12,7 @@ import ( // TestSafeOutputsAppConfiguration tests that app configuration is correctly parsed func TestSafeOutputsAppConfiguration(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -50,7 +50,7 @@ Test workflow with app configuration. // TestSafeOutputsAppConfigurationMinimal tests minimal app configuration without repositories func TestSafeOutputsAppConfigurationMinimal(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -85,7 +85,7 @@ Test workflow with minimal app configuration. // TestSafeOutputsAppTokenMintingStep tests that token minting step is generated func TestSafeOutputsAppTokenMintingStep(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -137,7 +137,7 @@ Test workflow with app token minting. // TestSafeOutputsAppTokenMintingStepWithRepositories tests token minting with repositories func TestSafeOutputsAppTokenMintingStepWithRepositories(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -181,7 +181,7 @@ Test workflow with app token minting and repository restrictions. // TestSafeOutputsAppWithoutSafeOutputs tests that app without safe outputs doesn't break func TestSafeOutputsAppWithoutSafeOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues @@ -207,7 +207,7 @@ Test workflow without safe outputs. // TestSafeOutputsAppTokenDiscussionsPermission tests that discussions permission is included func TestSafeOutputsAppTokenDiscussionsPermission(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") markdown := `--- on: issues diff --git a/pkg/workflow/safe_outputs_env_integration_test.go b/pkg/workflow/safe_outputs_env_integration_test.go index 3db96917db..b18cf0a749 100644 --- a/pkg/workflow/safe_outputs_env_integration_test.go +++ b/pkg/workflow/safe_outputs_env_integration_test.go @@ -18,7 +18,7 @@ func parseWorkflowFromContent(t *testing.T, content string, filename string) *Wo t.Fatalf("Failed to extract frontmatter: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() safeOutputs := compiler.extractSafeOutputsConfig(result.Frontmatter) topTools := extractToolsFromFrontmatter(result.Frontmatter) @@ -120,7 +120,7 @@ func TestSafeOutputsEnvIntegration(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Extract the safe outputs configuration config := compiler.extractSafeOutputsConfig(tt.frontmatter) @@ -219,7 +219,7 @@ Create an issue with test results. } // Build the create issue job and verify it includes our environment variables - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() job, err := compiler.buildCreateOutputIssueJob(workflowData, "main_job") if err != nil { t.Fatalf("Failed to build create issue job: %v", err) @@ -274,7 +274,7 @@ This workflow tests that custom environment variables work with staged mode. } // Build the create issue job and verify it includes our environment variables and staged flag - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() job, err := compiler.buildCreateOutputIssueJob(workflowData, "main_job") if err != nil { t.Fatalf("Failed to build create issue job: %v", err) diff --git a/pkg/workflow/safe_outputs_env_test.go b/pkg/workflow/safe_outputs_env_test.go index d06fb183fc..230ab083c7 100644 --- a/pkg/workflow/safe_outputs_env_test.go +++ b/pkg/workflow/safe_outputs_env_test.go @@ -5,7 +5,7 @@ import ( ) func TestSafeOutputsEnvConfiguration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("Should parse env configuration in safe-outputs", func(t *testing.T) { frontmatter := map[string]any{ diff --git a/pkg/workflow/safe_outputs_import_test.go b/pkg/workflow/safe_outputs_import_test.go index 17568d0f17..8c77fa4545 100644 --- a/pkg/workflow/safe_outputs_import_test.go +++ b/pkg/workflow/safe_outputs_import_test.go @@ -11,7 +11,7 @@ import ( // TestSafeOutputsImport tests that safe-output types can be imported from shared workflows func TestSafeOutputsImport(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -76,7 +76,7 @@ This workflow uses the imported create-issue configuration. // TestSafeOutputsImportMultipleTypes tests importing multiple safe-output types from a shared workflow func TestSafeOutputsImportMultipleTypes(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -143,7 +143,7 @@ imports: // TestSafeOutputsImportOverride tests that when the same safe-output type is defined in both main and imported workflow, the main workflow's definition takes precedence func TestSafeOutputsImportOverride(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -203,7 +203,7 @@ safe-outputs: // TestSafeOutputsImportConflictBetweenImports tests that a conflict error is returned when the same safe-output type is defined in multiple imported workflows func TestSafeOutputsImportConflictBetweenImports(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -272,7 +272,7 @@ imports: // TestSafeOutputsImportNoConflictDifferentTypes tests that importing different safe-output types does not cause a conflict func TestSafeOutputsImportNoConflictDifferentTypes(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -337,7 +337,7 @@ safe-outputs: // TestSafeOutputsImportFromMultipleWorkflows tests importing different safe-output types from multiple workflows func TestSafeOutputsImportFromMultipleWorkflows(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -412,7 +412,7 @@ imports: // TestMergeSafeOutputsUnit tests the MergeSafeOutputs function directly func TestMergeSafeOutputsUnit(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") tests := []struct { name string @@ -503,7 +503,7 @@ func TestMergeSafeOutputsUnit(t *testing.T) { // TestMergeSafeOutputsMessagesUnit tests the MergeSafeOutputs function for messages field func TestMergeSafeOutputsMessagesUnit(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") tests := []struct { name string @@ -619,7 +619,7 @@ func TestMergeSafeOutputsMessagesUnit(t *testing.T) { // TestSafeOutputsImportMetaFields tests that safe-output meta fields can be imported from shared workflows func TestSafeOutputsImportMetaFields(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -700,7 +700,7 @@ This workflow uses the imported meta configuration. // TestSafeOutputsImportMetaFieldsMainTakesPrecedence tests that main workflow meta fields take precedence over imports func TestSafeOutputsImportMetaFieldsMainTakesPrecedence(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -769,7 +769,7 @@ This workflow has its own meta configuration that should take precedence. // TestSafeOutputsImportMetaFieldsFromOnlyImport tests that meta fields are correctly imported when main has no safe-outputs section func TestSafeOutputsImportMetaFieldsFromOnlyImport(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -841,7 +841,7 @@ This workflow uses only imported safe-outputs configuration. // TestSafeOutputsImportJobsFromSharedWorkflow tests that safe-outputs.jobs can be imported from shared workflows func TestSafeOutputsImportJobsFromSharedWorkflow(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -918,7 +918,7 @@ This workflow imports safe-jobs from a shared workflow. // TestSafeOutputsImportJobsWithMainWorkflowJobs tests importing jobs when main workflow also has jobs func TestSafeOutputsImportJobsWithMainWorkflowJobs(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -998,7 +998,7 @@ This workflow has its own jobs and imports more jobs. // TestSafeOutputsImportJobsConflict tests that a conflict error is returned when the same job name is defined in both main and imported workflow func TestSafeOutputsImportJobsConflict(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -1065,7 +1065,7 @@ safe-outputs: // TestSafeOutputsImportMessagesFromSharedWorkflow tests that safe-outputs.messages can be imported from shared workflows func TestSafeOutputsImportMessagesFromSharedWorkflow(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -1141,7 +1141,7 @@ This workflow imports messages from a shared workflow. // TestSafeOutputsImportMessagesMainOverrides tests that main workflow messages take precedence over imports func TestSafeOutputsImportMessagesMainOverrides(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -1222,7 +1222,7 @@ Main workflow defines some messages that should take precedence. // TestSafeOutputsImportMessagesWithNoMainSafeOutputs tests messages import when main has no safe-outputs section func TestSafeOutputsImportMessagesWithNoMainSafeOutputs(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() @@ -1290,7 +1290,7 @@ Uses only imported safe-outputs including messages. // TestMergeSafeOutputsJobsNotMerged tests that Jobs are NOT merged in MergeSafeOutputs // because they are handled separately in the orchestrator via mergeSafeJobsFromIncludedConfigs func TestMergeSafeOutputsJobsNotMerged(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a top-level config with a job topConfig := &SafeOutputsConfig{ @@ -1322,7 +1322,7 @@ func TestMergeSafeOutputsJobsNotMerged(t *testing.T) { // TestMergeSafeOutputsJobsSkippedWhenEmpty tests that Jobs field is not created if not present func TestMergeSafeOutputsJobsSkippedWhenEmpty(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a top-level config without jobs topConfig := &SafeOutputsConfig{ @@ -1349,7 +1349,7 @@ func TestMergeSafeOutputsJobsSkippedWhenEmpty(t *testing.T) { // TestMergeSafeOutputsErrorPropagation tests error propagation from mergeSafeOutputConfig // This test verifies the error handling infrastructure is in place func TestMergeSafeOutputsErrorPropagation(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") tests := []struct { name string @@ -1404,7 +1404,7 @@ func TestMergeSafeOutputsErrorPropagation(t *testing.T) { // This verifies that Jobs ARE properly imported when going through ParseWorkflowFile // (which uses the orchestrator's mergeSafeJobsFromIncludedConfigs) func TestMergeSafeOutputsWithJobsIntegration(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create a temporary directory for test files tmpDir := t.TempDir() diff --git a/pkg/workflow/safe_outputs_integration_test.go b/pkg/workflow/safe_outputs_integration_test.go index a23fc3d43b..53ee5d33d3 100644 --- a/pkg/workflow/safe_outputs_integration_test.go +++ b/pkg/workflow/safe_outputs_integration_test.go @@ -226,7 +226,7 @@ func TestSafeOutputJobsIntegration(t *testing.T) { } // Create compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Build workflow data with the specific safe output configuration workflowData := &WorkflowData{ @@ -547,7 +547,7 @@ func TestConsolidatedSafeOutputsJobIntegration(t *testing.T) { t.Skip("Known issue: This safe output type doesn't generate a consolidated job when configured alone.") } - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -694,7 +694,7 @@ func TestSafeOutputJobsWithCustomEnvVars(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Create compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Build workflow data with custom env vars workflowData := &WorkflowData{ @@ -763,7 +763,7 @@ func TestSafeOutputJobsMissingConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", Source: "test-source", @@ -789,7 +789,7 @@ func TestSafeOutputJobsMissingConfig(t *testing.T) { // TestConsolidatedSafeOutputsJobWithCustomEnv tests that custom environment variables // are properly included in the consolidated safe outputs job. func TestConsolidatedSafeOutputsJobWithCustomEnv(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", diff --git a/pkg/workflow/safe_outputs_mcp_integration_test.go b/pkg/workflow/safe_outputs_mcp_integration_test.go index 3030fce4b0..0894e84cb6 100644 --- a/pkg/workflow/safe_outputs_mcp_integration_test.go +++ b/pkg/workflow/safe_outputs_mcp_integration_test.go @@ -34,7 +34,7 @@ Test safe outputs workflow with MCP server integration. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -100,7 +100,7 @@ Test workflow without safe outputs. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -153,7 +153,7 @@ Test safe outputs workflow with Codex engine. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/safe_outputs_messages_test.go b/pkg/workflow/safe_outputs_messages_test.go index 375f100b5c..3e2c29c63f 100644 --- a/pkg/workflow/safe_outputs_messages_test.go +++ b/pkg/workflow/safe_outputs_messages_test.go @@ -10,7 +10,7 @@ import ( ) func TestSafeOutputsMessagesConfiguration(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("Should parse messages configuration in safe-outputs", func(t *testing.T) { frontmatter := map[string]any{ @@ -192,7 +192,7 @@ func TestSerializeMessagesConfig(t *testing.T) { } func TestMessagesEnvVarInSafeOutputJobs(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("Should include GH_AW_SAFE_OUTPUT_MESSAGES env var when messages configured", func(t *testing.T) { data := &WorkflowData{ diff --git a/pkg/workflow/safe_outputs_runs_on_test.go b/pkg/workflow/safe_outputs_runs_on_test.go index 71dd2f0d1b..41de318f5b 100644 --- a/pkg/workflow/safe_outputs_runs_on_test.go +++ b/pkg/workflow/safe_outputs_runs_on_test.go @@ -61,7 +61,7 @@ This is a test workflow.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -107,7 +107,7 @@ This is a test workflow.` t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -153,7 +153,7 @@ This is a test workflow.` } func TestFormatSafeOutputsRunsOnEdgeCases(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/safe_outputs_target_validation_integration_test.go b/pkg/workflow/safe_outputs_target_validation_integration_test.go index cea67b6e31..47db2a424e 100644 --- a/pkg/workflow/safe_outputs_target_validation_integration_test.go +++ b/pkg/workflow/safe_outputs_target_validation_integration_test.go @@ -43,7 +43,7 @@ This workflow should fail to compile because "event" is not a valid target value t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Attempt to compile the workflow - should fail with validation error err := compiler.CompileWorkflow(workflowPath) @@ -134,7 +134,7 @@ This workflow should compile successfully. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should succeed err := compiler.CompileWorkflow(workflowPath) @@ -183,7 +183,7 @@ This workflow should fail because close-issue has an invalid target. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Attempt to compile the workflow - should fail err := compiler.CompileWorkflow(workflowPath) @@ -253,7 +253,7 @@ This workflow should fail to compile. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Attempt to compile the workflow - should fail err := compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/safe_outputs_test.go b/pkg/workflow/safe_outputs_test.go index 5ee8b9530b..5fc8244290 100644 --- a/pkg/workflow/safe_outputs_test.go +++ b/pkg/workflow/safe_outputs_test.go @@ -636,7 +636,7 @@ func TestGenerateSafeOutputsConfig(t *testing.T) { // TestFormatSafeOutputsRunsOn tests the formatSafeOutputsRunsOn function func TestFormatSafeOutputsRunsOn(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -972,7 +972,7 @@ func TestBuildStandardSafeOutputEnvVars(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if tt.trialMode { compiler.SetTrialMode(true) compiler.SetTrialLogicalRepoSlug(tt.trialRepoSlug) diff --git a/pkg/workflow/sandbox_agent_false_test.go b/pkg/workflow/sandbox_agent_false_test.go index cbe9987741..13eb740d26 100644 --- a/pkg/workflow/sandbox_agent_false_test.go +++ b/pkg/workflow/sandbox_agent_false_test.go @@ -33,7 +33,7 @@ Test workflow to verify sandbox.agent: false is rejected. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Should fail due to schema validation error if err := compiler.CompileWorkflow(workflowPath); err == nil { @@ -70,7 +70,7 @@ Test workflow to verify sandbox.agent: awf enables firewall. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -115,7 +115,7 @@ Test workflow to verify default sandbox.agent behavior (awf). } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) if err := compiler.CompileWorkflow(workflowPath); err != nil { @@ -163,7 +163,7 @@ Test workflow to verify network.firewall still works (deprecated). } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) // The compilation should succeed (deprecated fields should still work) @@ -175,7 +175,7 @@ Test workflow to verify network.firewall still works (deprecated). func TestSandboxAgentFalseExtraction(t *testing.T) { t.Run("extractAgentSandboxConfig rejects false", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with false value - should return nil now (invalid) agentConfig := compiler.extractAgentSandboxConfig(false) @@ -185,7 +185,7 @@ func TestSandboxAgentFalseExtraction(t *testing.T) { }) t.Run("extractAgentSandboxConfig rejects true (invalid)", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with true value (should be invalid) agentConfig := compiler.extractAgentSandboxConfig(true) @@ -195,7 +195,7 @@ func TestSandboxAgentFalseExtraction(t *testing.T) { }) t.Run("extractAgentSandboxConfig handles string", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with "awf" string agentConfig := compiler.extractAgentSandboxConfig("awf") diff --git a/pkg/workflow/sandbox_agent_tools_default_test.go b/pkg/workflow/sandbox_agent_tools_default_test.go index e6c6aef249..083c1fecac 100644 --- a/pkg/workflow/sandbox_agent_tools_default_test.go +++ b/pkg/workflow/sandbox_agent_tools_default_test.go @@ -30,7 +30,7 @@ Test workflow to verify sandbox.agent: awf enables edit and bash tools. require.NoError(t, err, "Failed to write workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) err = compiler.CompileWorkflow(workflowPath) @@ -72,7 +72,7 @@ Test workflow to verify sandbox.agent: srt enables edit and bash tools. require.NoError(t, err, "Failed to write workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) err = compiler.CompileWorkflow(workflowPath) @@ -109,7 +109,7 @@ Test workflow to verify default sandbox.agent (awf) does not enable extra tools. require.NoError(t, err, "Failed to write workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) err = compiler.CompileWorkflow(workflowPath) @@ -154,7 +154,7 @@ Test workflow without sandbox config. require.NoError(t, err, "Failed to write workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) err = compiler.CompileWorkflow(workflowPath) @@ -197,7 +197,7 @@ Test workflow where explicit tools.bash should take precedence over default. require.NoError(t, err, "Failed to write workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) err = compiler.CompileWorkflow(workflowPath) @@ -239,7 +239,7 @@ Test workflow where firewall is auto-enabled via network restrictions. require.NoError(t, err, "Failed to write workflow file") // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(true) err = compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/sandbox_custom_agent_test.go b/pkg/workflow/sandbox_custom_agent_test.go index 4ada49b6ba..c7c2b0e56d 100644 --- a/pkg/workflow/sandbox_custom_agent_test.go +++ b/pkg/workflow/sandbox_custom_agent_test.go @@ -145,8 +145,10 @@ sandbox: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") - compiler.SetStrictMode(false) + compiler := NewCompiler( + WithVersion("test"), + WithStrictMode(false), + ) err = compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Compilation failed: %v", err) @@ -214,8 +216,10 @@ sandbox: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") - compiler.SetStrictMode(false) + compiler := NewCompiler( + WithVersion("test"), + WithStrictMode(false), + ) err = compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Compilation failed: %v", err) @@ -275,8 +279,10 @@ sandbox: t.Fatal(err) } - compiler := NewCompiler(false, "", "test") - compiler.SetStrictMode(false) + compiler := NewCompiler( + WithVersion("test"), + WithStrictMode(false), + ) err = compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Compilation failed: %v", err) diff --git a/pkg/workflow/sandbox_disabled_test.go b/pkg/workflow/sandbox_disabled_test.go index 60eba583d8..04ffa329b7 100644 --- a/pkg/workflow/sandbox_disabled_test.go +++ b/pkg/workflow/sandbox_disabled_test.go @@ -29,7 +29,7 @@ Test workflow with sandbox disabled. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) // Non-strict mode to allow sandbox: false compiler.SetSkipValidation(true) @@ -54,7 +54,7 @@ Test workflow with sandbox disabled in strict mode. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(true) compiler.SetSkipValidation(true) @@ -84,7 +84,7 @@ Test workflow with network restrictions but sandbox disabled. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) compiler.SetSkipValidation(true) @@ -125,7 +125,7 @@ Test workflow with tools but sandbox disabled. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) compiler.SetSkipValidation(true) @@ -163,7 +163,7 @@ Test workflow. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) compiler.SetSkipValidation(true) @@ -197,7 +197,7 @@ Test workflow with sandbox: true. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) compiler.SetSkipValidation(true) @@ -311,7 +311,7 @@ Test workflow with tools and sandbox disabled. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) compiler.SetSkipValidation(true) @@ -357,7 +357,7 @@ Test workflow with direct copilot execution. err := os.WriteFile(workflowPath, []byte(markdown), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) compiler.SetSkipValidation(true) diff --git a/pkg/workflow/sandbox_experimental_warning_test.go b/pkg/workflow/sandbox_experimental_warning_test.go index f82d844594..e7927f5a1f 100644 --- a/pkg/workflow/sandbox_experimental_warning_test.go +++ b/pkg/workflow/sandbox_experimental_warning_test.go @@ -108,7 +108,7 @@ permissions: r, w, _ := os.Pipe() os.Stderr = w - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err := compiler.CompileWorkflow(testFile) @@ -242,7 +242,7 @@ permissions: r, w, _ := os.Pipe() os.Stderr = w - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err := compiler.CompileWorkflow(testFile) @@ -300,7 +300,7 @@ permissions: r, w, _ := os.Pipe() os.Stderr = w - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/sandbox_test.go b/pkg/workflow/sandbox_test.go index 99eab5c35a..db670905ba 100644 --- a/pkg/workflow/sandbox_test.go +++ b/pkg/workflow/sandbox_test.go @@ -341,7 +341,7 @@ permissions: err := os.WriteFile(testFile, []byte(content), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err = compiler.CompileWorkflow(testFile) require.NoError(t, err) @@ -379,7 +379,7 @@ permissions: err := os.WriteFile(testFile, []byte(content), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(false) err = compiler.CompileWorkflow(testFile) require.NoError(t, err) diff --git a/pkg/workflow/schedule_preprocessing_test.go b/pkg/workflow/schedule_preprocessing_test.go index 9a85018969..dae4698fac 100644 --- a/pkg/workflow/schedule_preprocessing_test.go +++ b/pkg/workflow/schedule_preprocessing_test.go @@ -98,7 +98,7 @@ func TestScheduleWorkflowDispatchAutomatic(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Set workflow identifier for fuzzy schedule scattering compiler.SetWorkflowIdentifier("test-workflow.md") @@ -245,7 +245,7 @@ func TestSchedulePreprocessingShorthandOnString(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Set workflow identifier for fuzzy schedule scattering // (required for all schedule tests to avoid fuzzy schedule errors) compiler.SetWorkflowIdentifier("test-workflow.md") @@ -492,7 +492,7 @@ func TestSchedulePreprocessing(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.preprocessScheduleFields(tt.frontmatter, "", "") if tt.expectedError { @@ -536,7 +536,7 @@ func TestScheduleFriendlyComments(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier("test-workflow.md") // Preprocess to convert and store friendly formats @@ -609,7 +609,7 @@ func TestFuzzyScheduleScattering(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if tt.workflowIdentifier != "" { compiler.SetWorkflowIdentifier(tt.workflowIdentifier) } @@ -669,7 +669,7 @@ func TestFuzzyScheduleScatteringDeterministic(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier(wf) err := compiler.preprocessScheduleFields(frontmatter, "", "") @@ -764,7 +764,7 @@ func TestSchedulePreprocessingWithFuzzyDaily(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier("test-workflow.md") err := compiler.preprocessScheduleFields(tt.frontmatter, "", "") @@ -823,7 +823,7 @@ func TestSchedulePreprocessingWithFuzzyDaily(t *testing.T) { func TestSchedulePreprocessingDailyVariations(t *testing.T) { // Test that "daily" produces a valid scattered schedule - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier("daily-variation-test.md") frontmatter := map[string]any{ @@ -920,7 +920,7 @@ func TestSlashCommandShorthand(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier("test-workflow.md") err := compiler.preprocessScheduleFields(tt.frontmatter, "", "") @@ -1035,7 +1035,7 @@ func TestFuzzyScheduleScatteringWithRepositorySlug(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier(tt.workflowIdentifier) if tt.repositorySlug != "" { compiler.SetRepositorySlug(tt.repositorySlug) @@ -1126,7 +1126,7 @@ func TestFuzzyScheduleScatteringAcrossOrganization(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetRepositorySlug(repo.slug) compiler.SetWorkflowIdentifier(repo.workflowName) @@ -1192,7 +1192,7 @@ func TestFuzzyScheduleScatteringWarningWithoutRepoSlug(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier("test-workflow.md") // Explicitly NOT setting repository slug @@ -1239,7 +1239,7 @@ func TestFuzzyScheduleScatteringWarningWithoutRepoSlug(t *testing.T) { // deterministically and don't carry over between compilations func TestFriendlyFormatDeterminism(t *testing.T) { // Create a compiler instance - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetWorkflowIdentifier("test-workflow.md") // Frontmatter with daily schedule diff --git a/pkg/workflow/schema_validation_integration_test.go b/pkg/workflow/schema_validation_integration_test.go index 73919aea58..487028d2e8 100644 --- a/pkg/workflow/schema_validation_integration_test.go +++ b/pkg/workflow/schema_validation_integration_test.go @@ -46,7 +46,7 @@ This is a valid workflow. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(false) // Enable schema validation err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/schema_validation_test.go b/pkg/workflow/schema_validation_test.go index fecb86e568..70b60050d8 100644 --- a/pkg/workflow/schema_validation_test.go +++ b/pkg/workflow/schema_validation_test.go @@ -185,7 +185,7 @@ func TestValidateGitHubActionsSchemaWithExamples(t *testing.T) { // Note: This test requires the schema to be loaded, which happens in validateGitHubActionsSchema // We'll test the integration by using the actual compiler method - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetSkipValidation(false) // Enable validation for this test tests := []struct { diff --git a/pkg/workflow/search_integration_test.go b/pkg/workflow/search_integration_test.go index eb48741603..b481f838d8 100644 --- a/pkg/workflow/search_integration_test.go +++ b/pkg/workflow/search_integration_test.go @@ -47,7 +47,7 @@ Search the web for information. os.Stderr = w // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should succeed with a warning err := compiler.CompileWorkflow(workflowPath) @@ -110,7 +110,7 @@ Search the web for information. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should succeed err := compiler.CompileWorkflow(workflowPath) @@ -165,7 +165,7 @@ Search the web for information. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should succeed err := compiler.CompileWorkflow(workflowPath) @@ -209,7 +209,7 @@ Do something without web search. } // Create a compiler - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow - should succeed err := compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/secret_masking_test.go b/pkg/workflow/secret_masking_test.go index 9aaa4b7c2f..05ee29d561 100644 --- a/pkg/workflow/secret_masking_test.go +++ b/pkg/workflow/secret_masking_test.go @@ -64,7 +64,7 @@ func TestExtractSecretMaskingConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() config := c.extractSecretMaskingConfig(tt.frontmatter) if tt.expectedStepCount == 0 { @@ -143,7 +143,7 @@ func TestMergeSecretMasking(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() result, err := c.MergeSecretMasking(tt.topConfig, tt.importedJSON) if err != nil { @@ -219,7 +219,7 @@ func TestGenerateCustomSecretMaskingStep(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() c.stepOrderTracker = NewStepOrderTracker() var yaml strings.Builder @@ -257,7 +257,7 @@ func TestSecretMaskingIntegration(t *testing.T) { }, } - c := NewCompiler(false, "", "test") + c := NewCompiler() c.SetSkipValidation(true) config := c.extractSecretMaskingConfig(frontmatter) diff --git a/pkg/workflow/secret_verification_output_test.go b/pkg/workflow/secret_verification_output_test.go index 1a2ab4e100..eb278701a0 100644 --- a/pkg/workflow/secret_verification_output_test.go +++ b/pkg/workflow/secret_verification_output_test.go @@ -26,7 +26,7 @@ Test workflow` t.Fatalf("Failed to write test workflow: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -70,7 +70,7 @@ Test workflow` t.Fatalf("Failed to write test workflow: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/secure_markdown_rendering_test.go b/pkg/workflow/secure_markdown_rendering_test.go index 89f31e9a61..43641b5d21 100644 --- a/pkg/workflow/secure_markdown_rendering_test.go +++ b/pkg/workflow/secure_markdown_rendering_test.go @@ -36,7 +36,7 @@ Run ID: ${{ github.run_id }} t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/security_fuzz_test.go b/pkg/workflow/security_fuzz_test.go index 1193f1ef1b..5e10495de7 100644 --- a/pkg/workflow/security_fuzz_test.go +++ b/pkg/workflow/security_fuzz_test.go @@ -133,7 +133,7 @@ items: [1, 2, 3 // Create a mock compiler and try to parse // This should never panic - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Try to validate expression safety on the content // This exercises the expression parser diff --git a/pkg/workflow/security_regression_test.go b/pkg/workflow/security_regression_test.go index 93c328e5eb..508ffec8ed 100644 --- a/pkg/workflow/security_regression_test.go +++ b/pkg/workflow/security_regression_test.go @@ -190,7 +190,7 @@ Testing secrets injection: ${{ secrets.GITHUB_TOKEN }}`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError { @@ -317,7 +317,7 @@ func TestSecurityDoSViaNestedYAML(t *testing.T) { t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // The compiler should complete without hanging // We don't check error here, just that it completes @@ -376,7 +376,7 @@ Testing simple anchor reference.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Should complete without exponential expansion err := compiler.CompileWorkflow(testFile) @@ -520,7 +520,7 @@ Test secrets: ${{ secrets.PREFIX }}`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if tt.expectError { @@ -594,7 +594,7 @@ Test network defaults.`, t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.CompileWorkflow(testFile) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/security_reports_test.go b/pkg/workflow/security_reports_test.go index 79fff95aa5..8c353c14fd 100644 --- a/pkg/workflow/security_reports_test.go +++ b/pkg/workflow/security_reports_test.go @@ -7,7 +7,7 @@ import ( // TestCodeScanningAlertsConfig tests the parsing of create-code-scanning-alert configuration func TestCodeScanningAlertsConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() tests := []struct { name string @@ -98,7 +98,7 @@ func TestCodeScanningAlertsConfig(t *testing.T) { // TestBuildCreateOutputCodeScanningAlertJob tests the creation of code scanning alert job func TestBuildCreateOutputCodeScanningAlertJob(t *testing.T) { - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() // Test valid configuration data := &WorkflowData{ @@ -228,7 +228,7 @@ func TestBuildCreateOutputCodeScanningAlertJob(t *testing.T) { // TestParseCodeScanningAlertsConfig tests the parsing function directly func TestParseCodeScanningAlertsConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/shared_workflow_test.go b/pkg/workflow/shared_workflow_test.go index 480c8896c9..c9827543f0 100644 --- a/pkg/workflow/shared_workflow_test.go +++ b/pkg/workflow/shared_workflow_test.go @@ -38,7 +38,7 @@ This is a reusable shared workflow component. } // Try to parse the workflow - it should return SharedWorkflowError - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _, err := compiler.ParseWorkflowFile(sharedPath) // Check that we got a SharedWorkflowError @@ -88,7 +88,7 @@ invalid_field: "This field should not be allowed" } // Try to parse the workflow - it should return a validation error (not SharedWorkflowError) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _, err := compiler.ParseWorkflowFile(sharedPath) // Check that we got an error (validation error, not SharedWorkflowError) @@ -132,7 +132,7 @@ This is a main workflow with an on trigger. } // Parse the workflow - it should succeed - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() workflowData, err := compiler.ParseWorkflowFile(mainPath) // Check that we got no error @@ -175,7 +175,7 @@ engine: } // Try to parse the workflow - it should return SharedWorkflowError - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _, err := compiler.ParseWorkflowFile(sharedPath) // Check that we got a SharedWorkflowError @@ -211,7 +211,7 @@ mcp-servers: } // Try to parse the workflow - it should return SharedWorkflowError - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _, err := compiler.ParseWorkflowFile(sharedPath) // Check that we got a SharedWorkflowError @@ -244,7 +244,7 @@ mcp-servers: } // Try to parse the workflow - it should return SharedWorkflowError (not "no markdown content" error) - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _, err := compiler.ParseWorkflowFile(sharedPath) // Check that we got a SharedWorkflowError @@ -285,7 +285,7 @@ engine: copilot } // Try to parse the workflow - it should fail with "no markdown content" error - compiler := workflow.NewCompiler(false, "", "test") + compiler := workflow.NewCompiler() _, err := compiler.ParseWorkflowFile(mainPath) // Check that we got an error diff --git a/pkg/workflow/skip_if_match_test.go b/pkg/workflow/skip_if_match_test.go index 4902bdde74..7baf6bf54b 100644 --- a/pkg/workflow/skip_if_match_test.go +++ b/pkg/workflow/skip_if_match_test.go @@ -15,7 +15,7 @@ import ( func TestSkipIfMatchPreActivationJob(t *testing.T) { tmpDir := testutil.TempDir(t, "skip-if-match-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("pre_activation_job_created_with_skip_if_match", func(t *testing.T) { workflowContent := `--- diff --git a/pkg/workflow/skip_if_no_match_test.go b/pkg/workflow/skip_if_no_match_test.go index 2262f68d6c..40a200046a 100644 --- a/pkg/workflow/skip_if_no_match_test.go +++ b/pkg/workflow/skip_if_no_match_test.go @@ -15,7 +15,7 @@ import ( func TestSkipIfNoMatchPreActivationJob(t *testing.T) { tmpDir := testutil.TempDir(t, "skip-if-no-match-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("pre_activation_job_created_with_skip_if_no_match", func(t *testing.T) { workflowContent := `--- diff --git a/pkg/workflow/slash_command_output_test.go b/pkg/workflow/slash_command_output_test.go index 4dccd47032..04f86fe08f 100644 --- a/pkg/workflow/slash_command_output_test.go +++ b/pkg/workflow/slash_command_output_test.go @@ -38,7 +38,7 @@ Test workflow content require.NoError(t, err) // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) require.NoError(t, err, "Failed to compile workflow") diff --git a/pkg/workflow/source_field_test.go b/pkg/workflow/source_field_test.go index b91b5603e6..4ec5935655 100644 --- a/pkg/workflow/source_field_test.go +++ b/pkg/workflow/source_field_test.go @@ -16,7 +16,7 @@ import ( func TestSourceFieldRendering(t *testing.T) { tmpDir := testutil.TempDir(t, "source-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -177,7 +177,7 @@ This is a test workflow to verify source field rendering. // TestSourceFieldExtraction tests that the extractSource method works correctly func TestSourceFieldExtraction(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/staged_add_issue_labels_test.go b/pkg/workflow/staged_add_issue_labels_test.go index 81e63fe75b..356bb486da 100644 --- a/pkg/workflow/staged_add_issue_labels_test.go +++ b/pkg/workflow/staged_add_issue_labels_test.go @@ -7,7 +7,7 @@ import ( func TestAddLabelsJobWithStagedFlag(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with staged: true workflowData := &WorkflowData{ @@ -51,7 +51,7 @@ func TestAddLabelsJobWithStagedFlag(t *testing.T) { func TestAddLabelsJobWithNilSafeOutputs(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with no SafeOutputs config - this should fail workflowData := &WorkflowData{ diff --git a/pkg/workflow/staged_awinfo_test.go b/pkg/workflow/staged_awinfo_test.go index f797ab7470..9e160b5679 100644 --- a/pkg/workflow/staged_awinfo_test.go +++ b/pkg/workflow/staged_awinfo_test.go @@ -7,7 +7,7 @@ import ( func TestGenerateCreateAwInfoWithStaged(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with staged: true workflowData := &WorkflowData{ diff --git a/pkg/workflow/staged_create_issue_test.go b/pkg/workflow/staged_create_issue_test.go index 3eb6acea04..a92acc7916 100644 --- a/pkg/workflow/staged_create_issue_test.go +++ b/pkg/workflow/staged_create_issue_test.go @@ -7,7 +7,7 @@ import ( func TestCreateIssueJobWithStagedFlag(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with staged: true workflowData := &WorkflowData{ @@ -51,7 +51,7 @@ func TestCreateIssueJobWithStagedFlag(t *testing.T) { func TestCreateIssueJobWithoutSafeOutputs(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with no SafeOutputs config - this should fail workflowData := &WorkflowData{ diff --git a/pkg/workflow/staged_pull_request_test.go b/pkg/workflow/staged_pull_request_test.go index 5c0b8f586f..579c2b57c9 100644 --- a/pkg/workflow/staged_pull_request_test.go +++ b/pkg/workflow/staged_pull_request_test.go @@ -7,7 +7,7 @@ import ( func TestCreatePullRequestJobWithStagedFlag(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with staged: true workflowData := &WorkflowData{ @@ -51,7 +51,7 @@ func TestCreatePullRequestJobWithStagedFlag(t *testing.T) { func TestCreatePullRequestJobWithoutSafeOutputs(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test with no SafeOutputs config - this should fail workflowData := &WorkflowData{ diff --git a/pkg/workflow/staged_test.go b/pkg/workflow/staged_test.go index 7efe2f0c81..75d6fabbb5 100644 --- a/pkg/workflow/staged_test.go +++ b/pkg/workflow/staged_test.go @@ -7,7 +7,7 @@ import ( func TestStagedFlag(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test frontmatter with staged: true frontmatter := map[string]any{ @@ -35,7 +35,7 @@ func TestStagedFlag(t *testing.T) { func TestStagedFlagDefault(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test frontmatter without staged flag frontmatter := map[string]any{ @@ -58,7 +58,7 @@ func TestStagedFlagDefault(t *testing.T) { func TestStagedFlagFalse(t *testing.T) { // Create a compiler instance - c := NewCompiler(false, "", "test") + c := NewCompiler() // Test frontmatter with staged: false frontmatter := map[string]any{ diff --git a/pkg/workflow/step_order_validation_integration_test.go b/pkg/workflow/step_order_validation_integration_test.go index ba7966d624..df9528f3cb 100644 --- a/pkg/workflow/step_order_validation_integration_test.go +++ b/pkg/workflow/step_order_validation_integration_test.go @@ -16,7 +16,7 @@ import ( func TestStepOrderingValidation_SecretRedactionBeforeUploads(t *testing.T) { tmpDir := testutil.TempDir(t, "step-order-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with a workflow that has secrets workflowWithSecrets := `--- @@ -82,7 +82,7 @@ This workflow has a secret reference and safe-outputs. func TestStepOrderingValidation_NoSecretsStillHasRedaction(t *testing.T) { tmpDir := testutil.TempDir(t, "step-order-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with a workflow that has NO secrets at compile time workflowNoSecrets := `--- @@ -132,7 +132,7 @@ This workflow has no secret references. func TestStepOrderingValidation_UploadedPathsCoverage(t *testing.T) { tmpDir := testutil.TempDir(t, "step-order-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test with a workflow that uploads artifacts workflow := `--- diff --git a/pkg/workflow/step_summary_test.go b/pkg/workflow/step_summary_test.go index 493e4f0d06..aa206ab7f0 100644 --- a/pkg/workflow/step_summary_test.go +++ b/pkg/workflow/step_summary_test.go @@ -41,7 +41,7 @@ This workflow tests that the step summary includes both JSONL and processed outp t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -104,7 +104,7 @@ This workflow tests that the step summary includes agentic run information. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -216,7 +216,7 @@ This workflow tests the workflow overview for Claude engine. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/stop_after_test.go b/pkg/workflow/stop_after_test.go index 2eb9fe925c..3f3036f6a4 100644 --- a/pkg/workflow/stop_after_test.go +++ b/pkg/workflow/stop_after_test.go @@ -178,7 +178,7 @@ jobs: // Test 1: Default behavior should preserve existing stop time t.Run("default behavior preserves stop time", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetRefreshStopTime(false) frontmatter := map[string]any{ @@ -201,7 +201,7 @@ jobs: // Test 2: With refresh flag, should generate new stop time t.Run("refresh flag generates new stop time", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetRefreshStopTime(true) frontmatter := map[string]any{ @@ -232,7 +232,7 @@ jobs: // Remove the lock file for this test os.Remove(lockFile) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetRefreshStopTime(false) frontmatter := map[string]any{ diff --git a/pkg/workflow/stop_time_check_job_test.go b/pkg/workflow/stop_time_check_job_test.go index 5c17534878..20770238bf 100644 --- a/pkg/workflow/stop_time_check_job_test.go +++ b/pkg/workflow/stop_time_check_job_test.go @@ -15,7 +15,7 @@ import ( func TestPreActivationJob(t *testing.T) { tmpDir := testutil.TempDir(t, "pre-activation-job-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() t.Run("pre_activation_job_created_with_stop_after", func(t *testing.T) { workflowContent := `--- diff --git a/pkg/workflow/strict_mode_deprecated_test.go b/pkg/workflow/strict_mode_deprecated_test.go index 6a43535f7d..59e2d99b4d 100644 --- a/pkg/workflow/strict_mode_deprecated_test.go +++ b/pkg/workflow/strict_mode_deprecated_test.go @@ -80,7 +80,7 @@ strict: false t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Determine if we should enable strict mode based on test name if strings.Contains(tt.name, "strict mode") && !strings.Contains(tt.name, "non-strict") { @@ -129,7 +129,7 @@ network: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err = compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/strict_mode_serena_test.go b/pkg/workflow/strict_mode_serena_test.go index 200f2895e3..39b38638e6 100644 --- a/pkg/workflow/strict_mode_serena_test.go +++ b/pkg/workflow/strict_mode_serena_test.go @@ -7,7 +7,7 @@ import ( // TestValidateStrictTools_SerenaLocalMode tests that serena local mode is rejected in strict mode func TestValidateStrictTools_SerenaLocalMode(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "tools": map[string]any{ @@ -31,7 +31,7 @@ func TestValidateStrictTools_SerenaLocalMode(t *testing.T) { // TestValidateStrictTools_SerenaDockerMode tests that serena docker mode is allowed in strict mode func TestValidateStrictTools_SerenaDockerMode(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "tools": map[string]any{ @@ -52,7 +52,7 @@ func TestValidateStrictTools_SerenaDockerMode(t *testing.T) { // TestValidateStrictTools_SerenaNoMode tests that serena without mode is allowed (defaults to docker) func TestValidateStrictTools_SerenaNoMode(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "tools": map[string]any{ @@ -72,7 +72,7 @@ func TestValidateStrictTools_SerenaNoMode(t *testing.T) { // TestValidateStrictTools_NoSerena tests that validation passes without serena func TestValidateStrictTools_NoSerena(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "tools": map[string]any{ diff --git a/pkg/workflow/strict_mode_test.go b/pkg/workflow/strict_mode_test.go index 0d0f4226ac..cfeb8be339 100644 --- a/pkg/workflow/strict_mode_test.go +++ b/pkg/workflow/strict_mode_test.go @@ -62,7 +62,7 @@ network: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) @@ -247,7 +247,7 @@ features: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) @@ -352,7 +352,7 @@ network: {} t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) @@ -406,7 +406,7 @@ tools: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) @@ -581,7 +581,7 @@ network: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) @@ -629,7 +629,7 @@ network: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Do NOT set strict mode - should allow everything if err := compiler.CompileWorkflow(testFile); err != nil { t.Errorf("Non-strict mode should allow all configurations, but got error: %v", err) @@ -725,7 +725,7 @@ features: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Do NOT set strict mode via CLI - let frontmatter control it err := compiler.CompileWorkflow(testFile) @@ -765,7 +765,7 @@ features: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) // CLI flag sets strict mode err := compiler.CompileWorkflow(testFile) @@ -822,7 +822,7 @@ strict: false t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Do NOT set strict mode via CLI - let frontmatter control it // Compile strict workflow first - should succeed now @@ -916,7 +916,7 @@ network: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/strict_mode_validation_test.go b/pkg/workflow/strict_mode_validation_test.go index 6d47499c3e..d86a475218 100644 --- a/pkg/workflow/strict_mode_validation_test.go +++ b/pkg/workflow/strict_mode_validation_test.go @@ -185,7 +185,7 @@ func TestValidateStrictPermissions(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err := compiler.validateStrictPermissions(tt.frontmatter) if tt.expectError && err == nil { @@ -270,7 +270,7 @@ func TestValidateStrictNetwork(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err := compiler.validateStrictNetwork(tt.networkPermissions) if tt.expectError && err == nil { @@ -465,7 +465,7 @@ func TestValidateStrictMode(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(tt.strictMode) err := compiler.validateStrictMode(tt.frontmatter, tt.networkPermissions) @@ -533,7 +533,7 @@ func TestValidateStrictModeEdgeCases(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.validateStrictMode(tt.frontmatter, tt.networkPermissions) diff --git a/pkg/workflow/strict_mode_zizmor_test.go b/pkg/workflow/strict_mode_zizmor_test.go index b206272c24..e08eab09b0 100644 --- a/pkg/workflow/strict_mode_zizmor_test.go +++ b/pkg/workflow/strict_mode_zizmor_test.go @@ -48,7 +48,7 @@ network: t.Fatal(err) } - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() compiler.SetStrictMode(true) err := compiler.CompileWorkflow(testFile) diff --git a/pkg/workflow/task_and_reaction_permissions_test.go b/pkg/workflow/task_and_reaction_permissions_test.go index ac5193c7fb..a8cdd48a76 100644 --- a/pkg/workflow/task_and_reaction_permissions_test.go +++ b/pkg/workflow/task_and_reaction_permissions_test.go @@ -42,7 +42,7 @@ The activation job references text output: "${{ needs.activation.outputs.text }} t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/task_job_generation_fix_test.go b/pkg/workflow/task_job_generation_fix_test.go index b8c36985c8..8cb106f136 100644 --- a/pkg/workflow/task_job_generation_fix_test.go +++ b/pkg/workflow/task_job_generation_fix_test.go @@ -40,7 +40,7 @@ Do some simple work.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -96,7 +96,7 @@ Do some work.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -143,7 +143,7 @@ Do conditional work.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/task_job_if_condition_test.go b/pkg/workflow/task_job_if_condition_test.go index 3f5edd7438..a2012967a3 100644 --- a/pkg/workflow/task_job_if_condition_test.go +++ b/pkg/workflow/task_job_if_condition_test.go @@ -42,7 +42,7 @@ Check the failed workflow and provide analysis.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/team_member_test.go b/pkg/workflow/team_member_test.go index 058d459e3b..07aed2eff8 100644 --- a/pkg/workflow/team_member_test.go +++ b/pkg/workflow/team_member_test.go @@ -18,7 +18,7 @@ func TestTeamMemberCheckForCommandWorkflows(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "workflow-team-member-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/temp_dir_before_custom_steps_test.go b/pkg/workflow/temp_dir_before_custom_steps_test.go index e58b627aa4..209fcd248e 100644 --- a/pkg/workflow/temp_dir_before_custom_steps_test.go +++ b/pkg/workflow/temp_dir_before_custom_steps_test.go @@ -47,7 +47,7 @@ steps: } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -174,7 +174,7 @@ steps: } // Compile workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowPath); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/temp_folder_test.go b/pkg/workflow/temp_folder_test.go index 7d42428d3f..b5082b2f81 100644 --- a/pkg/workflow/temp_folder_test.go +++ b/pkg/workflow/temp_folder_test.go @@ -34,7 +34,7 @@ This is a test workflow to verify temp folder instructions are included. } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } diff --git a/pkg/workflow/template_expression_integration_test.go b/pkg/workflow/template_expression_integration_test.go index 113025b106..68ea58e3ee 100644 --- a/pkg/workflow/template_expression_integration_test.go +++ b/pkg/workflow/template_expression_integration_test.go @@ -72,7 +72,7 @@ ${{ needs.activation.outputs.text }} t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -170,7 +170,7 @@ This expression needs wrapping. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -255,7 +255,7 @@ Steps expression - will be wrapped. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(testFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/template_rendering_test.go b/pkg/workflow/template_rendering_test.go index 223bcf17aa..d1409662be 100644 --- a/pkg/workflow/template_rendering_test.go +++ b/pkg/workflow/template_rendering_test.go @@ -54,7 +54,7 @@ Normal content here. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -150,7 +150,7 @@ Normal content without conditionals. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { @@ -204,7 +204,7 @@ Normal content without conditionals in markdown. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Compile the workflow if err := compiler.CompileWorkflow(testFile); err != nil { diff --git a/pkg/workflow/threat_detection_file_access_test.go b/pkg/workflow/threat_detection_file_access_test.go index 9c622d26b9..232eb16fab 100644 --- a/pkg/workflow/threat_detection_file_access_test.go +++ b/pkg/workflow/threat_detection_file_access_test.go @@ -8,7 +8,7 @@ import ( // TestThreatDetectionUsesFilePathNotInline verifies that the threat detection job // references the agent output file path instead of inlining the full content func TestThreatDetectionUsesFilePathNotInline(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ Name: "Test Workflow", @@ -55,7 +55,7 @@ func TestThreatDetectionUsesFilePathNotInline(t *testing.T) { // TestThreatDetectionHasBashReadTools verifies that bash read tools are configured func TestThreatDetectionHasBashReadTools(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ SafeOutputs: &SafeOutputsConfig{ diff --git a/pkg/workflow/threat_detection_isolation_test.go b/pkg/workflow/threat_detection_isolation_test.go index 1cff4a9f20..516b29d888 100644 --- a/pkg/workflow/threat_detection_isolation_test.go +++ b/pkg/workflow/threat_detection_isolation_test.go @@ -12,7 +12,7 @@ import ( ) func TestThreatDetectionIsolation(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Create a temporary directory for the test workflow tmpDir := testutil.TempDir(t, "test-*") diff --git a/pkg/workflow/threat_detection_test.go b/pkg/workflow/threat_detection_test.go index 7e2940f47a..d4d253bf18 100644 --- a/pkg/workflow/threat_detection_test.go +++ b/pkg/workflow/threat_detection_test.go @@ -8,7 +8,7 @@ import ( ) func TestParseThreatDetectionConfig(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -137,7 +137,7 @@ func TestParseThreatDetectionConfig(t *testing.T) { } func TestBuildThreatDetectionJob(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -238,7 +238,7 @@ func TestBuildThreatDetectionJob(t *testing.T) { } func TestThreatDetectionDefaultBehavior(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that threat detection is enabled by default when safe-outputs exist frontmatter := map[string]any{ @@ -258,7 +258,7 @@ func TestThreatDetectionDefaultBehavior(t *testing.T) { } func TestThreatDetectionExplicitDisable(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that threat detection can be explicitly disabled frontmatter := map[string]any{ @@ -280,7 +280,7 @@ func TestThreatDetectionExplicitDisable(t *testing.T) { func TestThreatDetectionJobDependencies(t *testing.T) { // Test that safe-output jobs depend on detection job when threat detection is enabled - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ SafeOutputs: &SafeOutputsConfig{ @@ -342,7 +342,7 @@ func TestThreatDetectionJobDependencies(t *testing.T) { func TestThreatDetectionCustomPrompt(t *testing.T) { // Test that custom prompt instructions are included in the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() customPrompt := "Look for suspicious API calls to external services and check for backdoor installations." data := &WorkflowData{ @@ -380,7 +380,7 @@ func TestThreatDetectionCustomPrompt(t *testing.T) { } func TestThreatDetectionWithCustomEngine(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -450,7 +450,7 @@ func TestThreatDetectionWithCustomEngine(t *testing.T) { } func TestThreatDetectionStepsOrdering(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ SafeOutputs: &SafeOutputsConfig{ @@ -507,7 +507,7 @@ func TestThreatDetectionStepsOrdering(t *testing.T) { } func TestBuildEngineStepsWithThreatDetectionEngine(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string @@ -581,7 +581,7 @@ func TestBuildEngineStepsWithThreatDetectionEngine(t *testing.T) { } func TestBuildUploadDetectionLogStep(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that upload detection log step is created with correct properties steps := compiler.buildUploadDetectionLogStep() @@ -611,7 +611,7 @@ func TestBuildUploadDetectionLogStep(t *testing.T) { } func TestThreatDetectionStepsIncludeUpload(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ SafeOutputs: &SafeOutputsConfig{ @@ -649,7 +649,7 @@ func TestThreatDetectionStepsIncludeUpload(t *testing.T) { } func TestEchoAgentOutputsStep(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that the echo step is created with correct properties steps := compiler.buildEchoAgentOutputsStep("agent") @@ -690,7 +690,7 @@ func TestEchoAgentOutputsStep(t *testing.T) { } func TestThreatDetectionStepsIncludeEcho(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ SafeOutputs: &SafeOutputsConfig{ @@ -725,7 +725,7 @@ func TestThreatDetectionStepsIncludeEcho(t *testing.T) { } func TestDownloadArtifactStepIncludesPrompt(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that the download artifact step includes unified agent-artifacts download steps := compiler.buildDownloadArtifactStep("agent") @@ -773,7 +773,7 @@ func TestDownloadPatchArtifactHasConditional(t *testing.T) { } func TestSetupScriptReferencesPromptFile(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that the setup script requires the external .cjs file script := compiler.buildSetupScriptRequire() @@ -795,7 +795,7 @@ func TestSetupScriptReferencesPromptFile(t *testing.T) { } func TestBuildWorkflowContextEnvVarsExcludesMarkdown(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ Name: "Test Workflow", @@ -823,7 +823,7 @@ func TestBuildWorkflowContextEnvVarsExcludesMarkdown(t *testing.T) { } func TestThreatDetectionEngineFalse(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that engine: false is properly parsed frontmatter := map[string]any{ @@ -866,7 +866,7 @@ func TestThreatDetectionEngineFalse(t *testing.T) { // TestDetectionJobSkipCondition verifies that the detection job has the correct // conditional logic to skip when there are no safe outputs and no patches func TestDetectionJobSkipCondition(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "issues", @@ -926,7 +926,7 @@ func TestDetectionJobSkipCondition(t *testing.T) { // TestCopilotDetectionDefaultModel verifies that the copilot engine uses the // default model gpt-5.1-codex-mini for the detection job when no model is specified func TestCopilotDetectionDefaultModel(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/time_delta_integration_test.go b/pkg/workflow/time_delta_integration_test.go index b368b2f242..2402b5543a 100644 --- a/pkg/workflow/time_delta_integration_test.go +++ b/pkg/workflow/time_delta_integration_test.go @@ -127,7 +127,7 @@ on: } // Compile the workflow - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() if err := compiler.CompileWorkflow(mdFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) } @@ -260,7 +260,7 @@ This is a test workflow with invalid stop-after.`, tt.stopTime) } // Compile the workflow - should fail - compiler := NewCompiler(false, "", "test-version") + compiler := NewCompiler() err = compiler.CompileWorkflow(mdFile) if err == nil { t.Errorf("Expected compilation to fail with invalid stop-after format %q but it succeeded", tt.stopTime) diff --git a/pkg/workflow/tools_timeout_integration_test.go b/pkg/workflow/tools_timeout_integration_test.go index 71aed00b43..2d3a6a445e 100644 --- a/pkg/workflow/tools_timeout_integration_test.go +++ b/pkg/workflow/tools_timeout_integration_test.go @@ -37,7 +37,7 @@ Test workflow. tmpFile.Close() // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err = compiler.CompileWorkflow(tmpFile.Name()) if err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/tools_timeout_validation_test.go b/pkg/workflow/tools_timeout_validation_test.go index 43ac54da4e..e2c2a2188d 100644 --- a/pkg/workflow/tools_timeout_validation_test.go +++ b/pkg/workflow/tools_timeout_validation_test.go @@ -200,7 +200,7 @@ Test workflow. tmpFile.Close() // Compile the workflow - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err = compiler.CompileWorkflow(tmpFile.Name()) if tt.shouldCompile { diff --git a/pkg/workflow/tracker_id_integration_test.go b/pkg/workflow/tracker_id_integration_test.go index 6fc57f4a59..0b684365e7 100644 --- a/pkg/workflow/tracker_id_integration_test.go +++ b/pkg/workflow/tracker_id_integration_test.go @@ -132,7 +132,7 @@ Create a pull request. t.Fatalf("Failed to write test workflow: %v", err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) compiler.verbose = false diff --git a/pkg/workflow/trial_issue_mode_test.go b/pkg/workflow/trial_issue_mode_test.go index f5699a23a3..2ffc0aafbf 100644 --- a/pkg/workflow/trial_issue_mode_test.go +++ b/pkg/workflow/trial_issue_mode_test.go @@ -7,7 +7,7 @@ import ( ) func TestTrialModeIssueDetection(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() testCases := []struct { name string @@ -71,7 +71,7 @@ func TestTrialModeIssueDetection(t *testing.T) { } func TestWorkflowDispatchInjection(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() testCases := []struct { name string @@ -112,7 +112,7 @@ func TestWorkflowDispatchInjection(t *testing.T) { } func TestIssueNumberReplacement(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() testCases := []struct { name string @@ -223,7 +223,7 @@ Process the issue ${{ github.event.issue.number }} and create a response. // Test trial mode compilation with issue triggers t.Run("Trial Mode with Issue Triggers", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetTrialMode(true) // Trial mode compiler.SetSkipValidation(true) // Skip validation for test @@ -266,7 +266,7 @@ Process the issue ${{ github.event.issue.number }} and create a response. // Test normal mode (no injection) t.Run("Normal Mode with Issue Triggers", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetTrialMode(false) // Normal mode compiler.SetSkipValidation(true) // Skip validation for test diff --git a/pkg/workflow/trial_mode_test.go b/pkg/workflow/trial_mode_test.go index 2135a4c70b..cdcdc251c1 100644 --- a/pkg/workflow/trial_mode_test.go +++ b/pkg/workflow/trial_mode_test.go @@ -46,7 +46,7 @@ This is a test workflow for trial mode compilation. // Test normal mode compilation (should include safe outputs) t.Run("Normal Mode", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) compiler.SetTrialMode(false) // Normal mode @@ -105,7 +105,7 @@ This is a test workflow for trial mode compilation. // Test trial mode compilation (should suppress safe outputs and add token) t.Run("Trial Mode", func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) compiler.SetTrialMode(true) // Trial mode @@ -286,7 +286,7 @@ This is a test workflow for trial mode compilation. } tmpFile.Close() - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) compiler.SetTrialMode(true) // Trial mode @@ -327,7 +327,7 @@ This is a test workflow for trial mode compilation. } func TestTrialModeSetterAndGetter(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Use dev mode to test with local action paths compiler.SetActionMode(ActionModeDev) diff --git a/pkg/workflow/trigger_shorthand_integration_test.go b/pkg/workflow/trigger_shorthand_integration_test.go index 7904035909..696588c7b6 100644 --- a/pkg/workflow/trigger_shorthand_integration_test.go +++ b/pkg/workflow/trigger_shorthand_integration_test.go @@ -128,7 +128,7 @@ Test workflow for dependabot PRs`, t.Fatalf("Failed to write test markdown: %v", err) } - c := NewCompiler(false, "", "test") + c := NewCompiler() err := c.CompileWorkflow(mdFile) @@ -232,7 +232,7 @@ Test`, t.Fatalf("Failed to write test markdown: %v", err) } - c := NewCompiler(false, "", "test") + c := NewCompiler() err := c.CompileWorkflow(mdFile) if err != nil { @@ -303,7 +303,7 @@ Test`, t.Fatalf("Failed to write test markdown: %v", err) } - c := NewCompiler(false, "", "test") + c := NewCompiler() err := c.CompileWorkflow(mdFile) if err != nil { diff --git a/pkg/workflow/unified_prompt_creation_test.go b/pkg/workflow/unified_prompt_creation_test.go index c7e5d0bf77..66a4b9bb1c 100644 --- a/pkg/workflow/unified_prompt_creation_test.go +++ b/pkg/workflow/unified_prompt_creation_test.go @@ -772,7 +772,7 @@ Actor: ${{ github.actor }}` require.NoError(t, err, "Should write test workflow file") // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowFile) require.NoError(t, err, "Should compile workflow successfully") @@ -822,7 +822,7 @@ Do something simple.` err := os.WriteFile(workflowFile, []byte(testWorkflow), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowFile) require.NoError(t, err, "Should compile minimal workflow") @@ -864,7 +864,7 @@ Manage issues based on comments.` err := os.WriteFile(workflowFile, []byte(testWorkflow), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowFile) require.NoError(t, err) @@ -907,7 +907,7 @@ Actor: ${{ github.actor }}` err := os.WriteFile(workflowFile, []byte(testWorkflow), 0644) require.NoError(t, err) - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowFile) require.NoError(t, err) diff --git a/pkg/workflow/update_discussion_test.go b/pkg/workflow/update_discussion_test.go index 8dbfa941c1..6ce1f41058 100644 --- a/pkg/workflow/update_discussion_test.go +++ b/pkg/workflow/update_discussion_test.go @@ -36,7 +36,7 @@ This workflow tests the update-discussion configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -113,7 +113,7 @@ This workflow tests the update-discussion configuration with all options. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -194,7 +194,7 @@ This workflow tests the update-discussion target configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -250,7 +250,7 @@ This workflow tests the update-discussion labels configuration. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -313,7 +313,7 @@ This workflow tests that allowed-labels implicitly enables labels. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/update_entity_helpers_test.go b/pkg/workflow/update_entity_helpers_test.go index c593bbcd21..455d008643 100644 --- a/pkg/workflow/update_entity_helpers_test.go +++ b/pkg/workflow/update_entity_helpers_test.go @@ -238,7 +238,7 @@ func TestParseUpdateEntityConfigWithFields(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() result, _ := compiler.parseUpdateEntityConfigWithFields(tt.outputMap, tt.opts) if tt.wantNil { @@ -327,7 +327,7 @@ func TestParseUpdateEntityConfigTyped(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() result := parseUpdateEntityConfigTyped(compiler, tt.outputMap, tt.entityType, tt.configKey, logger.New("test"), func(cfg *UpdateIssuesConfig) []UpdateEntityFieldSpec { @@ -363,7 +363,7 @@ func TestParseUpdateEntityConfigTypedWithCustomParser(t *testing.T) { }, } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() result := parseUpdateEntityConfigTyped(compiler, outputMap, UpdateEntityDiscussion, "update-discussion", logger.New("test"), func(cfg *UpdateDiscussionsConfig) []UpdateEntityFieldSpec { diff --git a/pkg/workflow/update_issue_test.go b/pkg/workflow/update_issue_test.go index bc62dc131c..7ae5b549f2 100644 --- a/pkg/workflow/update_issue_test.go +++ b/pkg/workflow/update_issue_test.go @@ -39,7 +39,7 @@ This workflow tests the update-issue configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -114,7 +114,7 @@ This workflow tests the update-issue configuration with all options. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) @@ -186,7 +186,7 @@ This workflow tests the update-issue target configuration parsing. t.Fatal(err) } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse the workflow data workflowData, err := compiler.ParseWorkflowFile(testFile) diff --git a/pkg/workflow/update_project_handler_config_test.go b/pkg/workflow/update_project_handler_config_test.go index 57c12e47bf..5294ddb1e8 100644 --- a/pkg/workflow/update_project_handler_config_test.go +++ b/pkg/workflow/update_project_handler_config_test.go @@ -32,7 +32,7 @@ Test workflow err := os.WriteFile(mdFile, []byte(testContent), 0600) require.NoError(t, err, "Failed to write test markdown file") - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() err = compiler.CompileWorkflow(mdFile) require.NoError(t, err, "Failed to compile workflow") diff --git a/pkg/workflow/update_project_test.go b/pkg/workflow/update_project_test.go index d3d53aceb1..5293431aed 100644 --- a/pkg/workflow/update_project_test.go +++ b/pkg/workflow/update_project_test.go @@ -123,7 +123,7 @@ func TestParseUpdateProjectConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() config := compiler.parseUpdateProjectConfig(tt.outputMap) if tt.expectedNil { @@ -139,7 +139,7 @@ func TestParseUpdateProjectConfig(t *testing.T) { } func TestUpdateProjectConfig_DefaultMax(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() outputMap := map[string]any{ "update-project": map[string]any{ @@ -174,7 +174,7 @@ func TestUpdateProjectConfig_TokenPrecedence(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() outputMap := map[string]any{ "update-project": map[string]any{ @@ -249,7 +249,7 @@ func TestBuildUpdateProjectJob(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() job, err := compiler.buildUpdateProjectJob(tt.workflowData, "main") @@ -269,7 +269,7 @@ func TestBuildUpdateProjectJob(t *testing.T) { } func TestUpdateProjectJob_EnvironmentVariables(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", @@ -302,7 +302,7 @@ func TestUpdateProjectJob_EnvironmentVariables(t *testing.T) { } func TestUpdateProjectJob_Permissions(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() workflowData := &WorkflowData{ Name: "test-workflow", diff --git a/pkg/workflow/update_project_token_test.go b/pkg/workflow/update_project_token_test.go index 0231aa682a..cd5c04f2b0 100644 --- a/pkg/workflow/update_project_token_test.go +++ b/pkg/workflow/update_project_token_test.go @@ -63,7 +63,7 @@ func TestUpdateProjectGitHubTokenEnvVar(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Parse frontmatter workflowData := &WorkflowData{ diff --git a/pkg/workflow/upload_assets_config_test.go b/pkg/workflow/upload_assets_config_test.go index ca4bd007c5..884d4c7c79 100644 --- a/pkg/workflow/upload_assets_config_test.go +++ b/pkg/workflow/upload_assets_config_test.go @@ -5,7 +5,7 @@ import ( ) func TestUploadAssetsConfigDefaults(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Test default configuration outputMap := map[string]any{ @@ -36,7 +36,7 @@ func TestUploadAssetsConfigDefaults(t *testing.T) { } func TestUploadAssetsConfigCustomExtensions(t *testing.T) { - compiler := NewCompiler(false, "", "") + compiler := NewCompiler() // Test custom configuration like dev.md outputMap := map[string]any{ diff --git a/pkg/workflow/validation_strict_mcp_network_test.go b/pkg/workflow/validation_strict_mcp_network_test.go index ef57d490d1..8b129b8306 100644 --- a/pkg/workflow/validation_strict_mcp_network_test.go +++ b/pkg/workflow/validation_strict_mcp_network_test.go @@ -7,7 +7,7 @@ import ( // TestValidateStrictMCPNetwork_NoMCPServers tests that validation passes when no mcp-servers are configured func TestValidateStrictMCPNetwork_NoMCPServers(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", } @@ -20,7 +20,7 @@ func TestValidateStrictMCPNetwork_NoMCPServers(t *testing.T) { // TestValidateStrictMCPNetwork_EmptyMCPServers tests that validation passes with empty mcp-servers map func TestValidateStrictMCPNetwork_EmptyMCPServers(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{}, @@ -34,7 +34,7 @@ func TestValidateStrictMCPNetwork_EmptyMCPServers(t *testing.T) { // TestValidateStrictMCPNetwork_InvalidMCPServersType tests that validation skips invalid mcp-servers type func TestValidateStrictMCPNetwork_InvalidMCPServersType(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": "invalid-type", @@ -48,7 +48,7 @@ func TestValidateStrictMCPNetwork_InvalidMCPServersType(t *testing.T) { // TestValidateStrictMCPNetwork_ContainerWithTopLevelNetwork tests that validation passes with container + top-level network func TestValidateStrictMCPNetwork_ContainerWithTopLevelNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -71,7 +71,7 @@ func TestValidateStrictMCPNetwork_ContainerWithTopLevelNetwork(t *testing.T) { // TestValidateStrictMCPNetwork_ContainerWithoutNetwork tests that validation fails without top-level network config func TestValidateStrictMCPNetwork_ContainerWithoutNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -93,7 +93,7 @@ func TestValidateStrictMCPNetwork_ContainerWithoutNetwork(t *testing.T) { // TestValidateStrictMCPNetwork_ExplicitStdioTypeContainerWithNetwork tests stdio type with container and top-level network func TestValidateStrictMCPNetwork_ExplicitStdioTypeContainerWithNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -117,7 +117,7 @@ func TestValidateStrictMCPNetwork_ExplicitStdioTypeContainerWithNetwork(t *testi // TestValidateStrictMCPNetwork_ExplicitStdioTypeContainerWithoutNetwork tests stdio type with container but no network func TestValidateStrictMCPNetwork_ExplicitStdioTypeContainerWithoutNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -136,7 +136,7 @@ func TestValidateStrictMCPNetwork_ExplicitStdioTypeContainerWithoutNetwork(t *te // TestValidateStrictMCPNetwork_LocalTypeContainerWithNetwork tests local type (converted to stdio) with top-level network func TestValidateStrictMCPNetwork_LocalTypeContainerWithNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -160,7 +160,7 @@ func TestValidateStrictMCPNetwork_LocalTypeContainerWithNetwork(t *testing.T) { // TestValidateStrictMCPNetwork_LocalTypeContainerWithoutNetwork tests local type with container but no network func TestValidateStrictMCPNetwork_LocalTypeContainerWithoutNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -179,7 +179,7 @@ func TestValidateStrictMCPNetwork_LocalTypeContainerWithoutNetwork(t *testing.T) // TestValidateStrictMCPNetwork_HTTPTypeNoValidation tests that HTTP type servers don't require network validation func TestValidateStrictMCPNetwork_HTTPTypeNoValidation(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -198,7 +198,7 @@ func TestValidateStrictMCPNetwork_HTTPTypeNoValidation(t *testing.T) { // TestValidateStrictMCPNetwork_StdioWithCommandNoContainer tests stdio with command but no container (allowed) func TestValidateStrictMCPNetwork_StdioWithCommandNoContainer(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -218,7 +218,7 @@ func TestValidateStrictMCPNetwork_StdioWithCommandNoContainer(t *testing.T) { // TestValidateStrictMCPNetwork_InvalidServerConfigType tests that invalid server config type is skipped func TestValidateStrictMCPNetwork_InvalidServerConfigType(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -234,7 +234,7 @@ func TestValidateStrictMCPNetwork_InvalidServerConfigType(t *testing.T) { // TestValidateStrictMCPNetwork_NonMCPServerSkipped tests that non-MCP server configs are skipped func TestValidateStrictMCPNetwork_NonMCPServerSkipped(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -253,7 +253,7 @@ func TestValidateStrictMCPNetwork_NonMCPServerSkipped(t *testing.T) { // TestValidateStrictMCPNetwork_MultipleServers tests validation with multiple MCP servers func TestValidateStrictMCPNetwork_MultipleServers(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -284,7 +284,7 @@ func TestValidateStrictMCPNetwork_MultipleServers(t *testing.T) { // TestValidateStrictMCPNetwork_MultipleServersOneFails tests that one failing server causes validation error func TestValidateStrictMCPNetwork_MultipleServersOneFails(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -309,7 +309,7 @@ func TestValidateStrictMCPNetwork_MultipleServersOneFails(t *testing.T) { // TestValidateStrictMCPNetwork_InferredStdioFromContainer tests container field infers stdio type func TestValidateStrictMCPNetwork_InferredStdioFromContainer(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -333,7 +333,7 @@ func TestValidateStrictMCPNetwork_InferredStdioFromContainer(t *testing.T) { // TestValidateStrictMCPNetwork_InferredHTTPFromURL tests URL field infers HTTP type (no validation needed) func TestValidateStrictMCPNetwork_InferredHTTPFromURL(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -352,7 +352,7 @@ func TestValidateStrictMCPNetwork_InferredHTTPFromURL(t *testing.T) { // TestValidateStrictMCPNetwork_InferredStdioFromCommand tests command field infers stdio type (no container, allowed) func TestValidateStrictMCPNetwork_InferredStdioFromCommand(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -372,7 +372,7 @@ func TestValidateStrictMCPNetwork_InferredStdioFromCommand(t *testing.T) { // TestValidateStrictMCPNetwork_ContainerWithNoNetworkConfig tests container without any network config fails func TestValidateStrictMCPNetwork_ContainerWithNoNetworkConfig(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -395,7 +395,7 @@ func TestValidateStrictMCPNetwork_ContainerWithNoNetworkConfig(t *testing.T) { // TestValidateStrictMCPNetwork_ContainerWithEmptyTopLevelNetwork tests container with empty top-level network fails func TestValidateStrictMCPNetwork_ContainerWithEmptyTopLevelNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ @@ -423,7 +423,7 @@ func TestValidateStrictMCPNetwork_ContainerWithEmptyTopLevelNetwork(t *testing.T // TestValidateStrictMCPNetwork_MultipleServersWithTopLevelNetwork tests multiple servers with top-level network func TestValidateStrictMCPNetwork_MultipleServersWithTopLevelNetwork(t *testing.T) { - compiler := NewCompiler(true, "", "") + compiler := NewCompiler() frontmatter := map[string]any{ "on": "push", "mcp-servers": map[string]any{ diff --git a/pkg/workflow/validation_test.go b/pkg/workflow/validation_test.go index a17d01d773..81ffb2e4b9 100644 --- a/pkg/workflow/validation_test.go +++ b/pkg/workflow/validation_test.go @@ -70,7 +70,7 @@ func TestValidateContainerImages(t *testing.T) { } } - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.validateContainerImages(tt.workflowData) if tt.expectError && err == nil { @@ -277,7 +277,7 @@ func TestValidateRuntimePackages(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err := compiler.validateRuntimePackages(tt.workflowData) // If we expect an error and got one, or don't expect one and didn't get one, test passes diff --git a/pkg/workflow/workflow_dispatch_inputs_test.go b/pkg/workflow/workflow_dispatch_inputs_test.go index 624240da72..5a9dc4317f 100644 --- a/pkg/workflow/workflow_dispatch_inputs_test.go +++ b/pkg/workflow/workflow_dispatch_inputs_test.go @@ -142,7 +142,7 @@ Test workflow with environment input`, } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) @@ -279,7 +279,7 @@ Test workflow with required and optional inputs` } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { @@ -346,7 +346,7 @@ Test workflow with choice input options` } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { @@ -437,7 +437,7 @@ Test workflow with all input types` } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) if err != nil { @@ -695,7 +695,7 @@ engine: copilot } // Compile workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() err = compiler.CompileWorkflow(workflowPath) diff --git a/pkg/workflow/workflow_run_repo_safety_test.go b/pkg/workflow/workflow_run_repo_safety_test.go index 901b2b5b04..b0f157e8c2 100644 --- a/pkg/workflow/workflow_run_repo_safety_test.go +++ b/pkg/workflow/workflow_run_repo_safety_test.go @@ -95,7 +95,7 @@ Do something on issue.`, } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -184,7 +184,7 @@ This workflow runs when CI workflows fail to help diagnose issues.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -271,7 +271,7 @@ Do something on push.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) @@ -323,7 +323,7 @@ Test workflow with workflow_run trigger.` } // Compile the workflow - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() if err := compiler.CompileWorkflow(workflowFile); err != nil { t.Fatalf("Failed to compile workflow: %v", err) diff --git a/pkg/workflow/workflow_run_validation_test.go b/pkg/workflow/workflow_run_validation_test.go index bda218c114..1897d40757 100644 --- a/pkg/workflow/workflow_run_validation_test.go +++ b/pkg/workflow/workflow_run_validation_test.go @@ -187,7 +187,7 @@ Test workflow content.`, } // Create compiler with appropriate mode - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetStrictMode(tt.strictMode) compiler.SetNoEmit(true) // Don't write lock files for these tests @@ -273,7 +273,7 @@ Test workflow content.`, } // Create compiler in normal mode - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() compiler.SetNoEmit(true) // Compile the workflow diff --git a/pkg/workflow/xml_comments_test.go b/pkg/workflow/xml_comments_test.go index 3e5ff40034..2c25856e1a 100644 --- a/pkg/workflow/xml_comments_test.go +++ b/pkg/workflow/xml_comments_test.go @@ -215,7 +215,7 @@ End`, } func TestGeneratePromptRemovesXMLComments(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() data := &WorkflowData{ MarkdownContent: `# Workflow Title @@ -303,7 +303,7 @@ func TestCompileWorkflowWithChunking(t *testing.T) { // Create temporary directory for test files tmpDir := testutil.TempDir(t, "chunking-test") - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() // Test that normal-sized content compiles successfully with single step normalContent := `--- diff --git a/pkg/workflow/yaml_test.go b/pkg/workflow/yaml_test.go index 2d07b9d438..8f7cd14f0b 100644 --- a/pkg/workflow/yaml_test.go +++ b/pkg/workflow/yaml_test.go @@ -299,7 +299,7 @@ func TestMarshalWithFieldOrder(t *testing.T) { } func TestExtractTopLevelYAMLSectionWithOrdering(t *testing.T) { - compiler := NewCompiler(false, "", "test") + compiler := NewCompiler() tests := []struct { name string diff --git a/pkg/workflow/zizmor_annotation_test.go b/pkg/workflow/zizmor_annotation_test.go index d01ac63ab1..8cf3efc51d 100644 --- a/pkg/workflow/zizmor_annotation_test.go +++ b/pkg/workflow/zizmor_annotation_test.go @@ -6,7 +6,7 @@ import ( ) func TestAddZizmorIgnoreForWorkflowRun(t *testing.T) { - c := NewCompiler(false, "", "test") + c := NewCompiler() tests := []struct { name string diff --git a/specs/actions.md b/specs/actions.md index f2a6e092a6..4018138785 100644 --- a/specs/actions.md +++ b/specs/actions.md @@ -719,9 +719,7 @@ Includes validation methods `IsValid()`, `IsDev()`, `IsRelease()`, `IsScript()`, #### 2. Compiler Support (`pkg/workflow/compiler_types.go`) - Added `actionMode` field to `Compiler` struct -- Added `SetActionMode()` and `GetActionMode()` methods - Default mode is `ActionModeInline` for backward compatibility -- Both `NewCompiler()` and `NewCompilerWithCustomOutput()` initialize with inline mode #### 3. Script Registry Extensions (`pkg/workflow/script_registry.go`) @@ -802,21 +800,21 @@ workflow.DefaultScriptRegistry.RegisterWithAction( **Dev mode** (local action references): ```go -compiler := workflow.NewCompiler(false, "", "1.0.0") +compiler := workflow.NewCompilerWithVersion("1.0.0") compiler.SetActionMode(workflow.ActionModeDev) compiler.CompileWorkflow("workflow.md") ``` **Release mode** (SHA-pinned remote references): ```go -compiler := workflow.NewCompiler(false, "", "1.0.0") +compiler := workflow.NewCompilerWithVersion("1.0.0") compiler.SetActionMode(workflow.ActionModeRelease) compiler.CompileWorkflow("workflow.md") ``` **Script mode** (direct shell script execution): ```go -compiler := workflow.NewCompiler(false, "", "1.0.0") +compiler := workflow.NewCompilerWithVersion("1.0.0") compiler.SetActionMode(workflow.ActionModeScript) compiler.CompileWorkflow("workflow.md") ``` @@ -979,7 +977,7 @@ workflow.DefaultScriptRegistry.RegisterWithAction( ) // Compile with dev action mode -compiler := workflow.NewCompiler(false, "", "1.0.0") +compiler := workflow.NewCompilerWithVersion("1.0.0") compiler.SetActionMode(workflow.ActionModeDev) compiler.CompileWorkflow("workflow.md") ```text diff --git a/specs/testing.md b/specs/testing.md index f61a6ecafe..f23f7349a0 100644 --- a/specs/testing.md +++ b/specs/testing.md @@ -31,7 +31,7 @@ Use **testify** assertions appropriately: ```go func TestSafeOutputsAppConfiguration(t *testing.T) { - compiler := NewCompiler(false, "", "1.0.0") + compiler := NewCompilerWithVersion("1.0.0") // Create test file - use require (setup step) tmpDir := t.TempDir()