From 107a75092ebac2861fd78915effaa1ee413ef956 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:54:31 +0000 Subject: [PATCH 1/2] Initial plan From dd968fc13d51c43fc433ff172cb3163096246d59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Oct 2025 23:20:38 +0000 Subject: [PATCH 2/2] Update tests for setup-node v6 upgrade and add missing setup-dotnet action pin Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/action_pins_test.go | 4 ++-- pkg/workflow/codex_test.go | 2 +- pkg/workflow/compiler_generation_test.go | 4 ++-- pkg/workflow/custom_engine_integration_test.go | 6 +++--- pkg/workflow/custom_engine_test.go | 8 ++++---- pkg/workflow/data/action_pins.json | 7 ++++++- pkg/workflow/engine_config_test.go | 4 ++-- pkg/workflow/multiline_test.go | 4 ++-- pkg/workflow/permissions_test.go | 6 +++--- pkg/workflow/pinned_actions_comment_test.go | 12 ++++++------ pkg/workflow/runtime_integration_test.go | 2 +- pkg/workflow/runtime_setup_integration_test.go | 4 ++-- pkg/workflow/runtime_setup_test.go | 6 +++--- 13 files changed, 37 insertions(+), 32 deletions(-) diff --git a/pkg/workflow/action_pins_test.go b/pkg/workflow/action_pins_test.go index 2cc1fb0a3ad..1387b29fe6d 100644 --- a/pkg/workflow/action_pins_test.go +++ b/pkg/workflow/action_pins_test.go @@ -296,7 +296,7 @@ func TestApplyActionPinToStep(t *testing.T) { }, }, expectPinned: true, - expectedUses: "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + expectedUses: "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", }, { name: "step with unpinned action", @@ -413,7 +413,7 @@ func TestGetActionPinByRepo(t *testing.T) { repo: "actions/setup-node", expectExists: true, expectRepo: "actions/setup-node", - expectVer: "v4", + expectVer: "v6", }, { repo: "unknown/action", diff --git a/pkg/workflow/codex_test.go b/pkg/workflow/codex_test.go index c23d0561e67..8985af024bb 100644 --- a/pkg/workflow/codex_test.go +++ b/pkg/workflow/codex_test.go @@ -107,7 +107,7 @@ This is a test workflow. if !strings.Contains(lockContent, "Setup Node.js") { t.Errorf("Expected lock file to contain 'Setup Node.js' step for codex but it didn't.\nContent:\n%s", lockContent) } - if !strings.Contains(lockContent, "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020") { + if !strings.Contains(lockContent, "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903") { t.Errorf("Expected lock file to contain Node.js setup action for codex but it didn't.\nContent:\n%s", lockContent) } // Check that codex installation is present diff --git a/pkg/workflow/compiler_generation_test.go b/pkg/workflow/compiler_generation_test.go index da974aaaad2..4dc6c60b348 100644 --- a/pkg/workflow/compiler_generation_test.go +++ b/pkg/workflow/compiler_generation_test.go @@ -170,13 +170,13 @@ func TestConvertStepToYAML(t *testing.T) { name: "step with complex with parameters", stepMap: map[string]any{ "name": "Setup Node", - "uses": "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses": "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with": map[string]any{ "node-version": "18", "cache": "npm", }, }, - expected: " - name: Setup Node\n uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020\n with:\n cache: npm\n node-version: \"18\"\n", + expected: " - name: Setup Node\n uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903\n with:\n cache: npm\n node-version: \"18\"\n", hasError: false, }, { diff --git a/pkg/workflow/custom_engine_integration_test.go b/pkg/workflow/custom_engine_integration_test.go index f41f90f19ea..cf656b9fdba 100644 --- a/pkg/workflow/custom_engine_integration_test.go +++ b/pkg/workflow/custom_engine_integration_test.go @@ -35,7 +35,7 @@ engine: id: custom steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 with: node-version: '18' - name: Run tests @@ -49,7 +49,7 @@ engine: This workflow uses the custom engine to execute defined steps.`, shouldContain: []string{ "- name: Setup Node.js", - "uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "node-version: \"18\"", "- name: Run tests", "echo \"Running tests...\"", @@ -129,7 +129,7 @@ Simple custom workflow with one step.`, } // Verify that the custom steps are properly formatted YAML - if !strings.Contains(contentStr, "name: Setup Node.js") || !strings.Contains(contentStr, "uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020") { + if !strings.Contains(contentStr, "name: Setup Node.js") || !strings.Contains(contentStr, "uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903") { // This is expected for the first test only if test.name == "custom engine with simple steps" { t.Error("Custom engine steps were not properly formatted in the generated workflow") diff --git a/pkg/workflow/custom_engine_test.go b/pkg/workflow/custom_engine_test.go index e11edc23ca3..63d5a566028 100644 --- a/pkg/workflow/custom_engine_test.go +++ b/pkg/workflow/custom_engine_test.go @@ -129,7 +129,7 @@ func TestCustomEngineGetExecutionStepsWithIdAndContinueOnError(t *testing.T) { "name": "Setup with ID", "id": "setup-step", "continue-on-error": true, - "uses": "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses": "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with": map[string]any{ "node-version": "18", }, @@ -199,7 +199,7 @@ func TestCustomEngineGetExecutionStepsWithSteps(t *testing.T) { Steps: []map[string]any{ { "name": "Setup Node.js", - "uses": "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses": "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with": map[string]any{ "node-version": "18", }, @@ -229,8 +229,8 @@ func TestCustomEngineGetExecutionStepsWithSteps(t *testing.T) { if !strings.Contains(firstStepContent, "name: Setup Node.js") { t.Errorf("Expected first step to contain 'name: Setup Node.js', got:\n%s", firstStepContent) } - if !strings.Contains(firstStepContent, "uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020") { - t.Errorf("Expected first step to contain 'uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020', got:\n%s", firstStepContent) + if !strings.Contains(firstStepContent, "uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903") { + t.Errorf("Expected first step to contain 'uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903', got:\n%s", firstStepContent) } } diff --git a/pkg/workflow/data/action_pins.json b/pkg/workflow/data/action_pins.json index 21343d10adc..f2269399d0b 100644 --- a/pkg/workflow/data/action_pins.json +++ b/pkg/workflow/data/action_pins.json @@ -27,7 +27,7 @@ "version": "v5", "sha": "a26af69be951a213d495a4c3e4e4022e16d87065" }, - "actions/setup-node@v6": { + "actions/setup-node": { "repo": "actions/setup-node", "version": "v6", "sha": "2028fbc5c25fe9cf00d9f06a71cc4710d4507903" @@ -42,6 +42,11 @@ "version": "v4", "sha": "0057852bfaa89a56745cba8c7296529d2fc39830" }, + "actions/setup-dotnet": { + "repo": "actions/setup-dotnet", + "version": "v4", + "sha": "67a3573c9a986a3f9c594539f4ab511d57bb3ce9" + }, "actions/setup-java": { "repo": "actions/setup-java", "version": "v4", diff --git a/pkg/workflow/engine_config_test.go b/pkg/workflow/engine_config_test.go index 98b41f2dd17..46794075ee3 100644 --- a/pkg/workflow/engine_config_test.go +++ b/pkg/workflow/engine_config_test.go @@ -148,7 +148,7 @@ func TestExtractEngineConfig(t *testing.T) { "steps": []any{ map[string]any{ "name": "Setup Node.js", - "uses": "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses": "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with": map[string]any{ "node-version": "18", }, @@ -166,7 +166,7 @@ func TestExtractEngineConfig(t *testing.T) { Steps: []map[string]any{ { "name": "Setup Node.js", - "uses": "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses": "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with": map[string]any{ "node-version": "18", }, diff --git a/pkg/workflow/multiline_test.go b/pkg/workflow/multiline_test.go index 8a5dbf8f25c..5b24298bd45 100644 --- a/pkg/workflow/multiline_test.go +++ b/pkg/workflow/multiline_test.go @@ -51,7 +51,7 @@ console.log(data);`, name: "simple single-line with parameters", stepMap: map[string]any{ "name": "Simple Test", - "uses": "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses": "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with": map[string]any{ "node-version": "18", "cache": "npm", @@ -59,7 +59,7 @@ console.log(data);`, }, shouldContain: []string{ "name: Simple Test", - "uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "with:", "node-version: \"18\"", // goccy/go-yaml quotes numeric strings "cache: npm", diff --git a/pkg/workflow/permissions_test.go b/pkg/workflow/permissions_test.go index 9b498d34ee0..719839bcade 100644 --- a/pkg/workflow/permissions_test.go +++ b/pkg/workflow/permissions_test.go @@ -240,7 +240,7 @@ func TestContainsCheckout(t *testing.T) { name: "contains different action", customSteps: `steps: - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 with: node-version: '18'`, expected: false, @@ -251,7 +251,7 @@ func TestContainsCheckout(t *testing.T) { - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020`, + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903`, expected: true, }, { @@ -328,7 +328,7 @@ func TestContainsCheckout(t *testing.T) { name: "checkout in comment (should not match)", customSteps: `steps: - name: Setup - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # TODO: add actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8`, expected: true, // Current implementation does simple string match }, diff --git a/pkg/workflow/pinned_actions_comment_test.go b/pkg/workflow/pinned_actions_comment_test.go index ad17359c9a9..a130d1a4cb4 100644 --- a/pkg/workflow/pinned_actions_comment_test.go +++ b/pkg/workflow/pinned_actions_comment_test.go @@ -34,12 +34,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 `, expected: map[string]string{ "actions/checkout": "v5", - "actions/setup-node": "v4", + "actions/setup-node": "v6", "actions/cache": "v4", }, }, @@ -51,12 +51,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 `, expected: map[string]string{ "actions/checkout": "v5", - "actions/setup-node": "v4", + "actions/setup-node": "v6", }, }, { @@ -156,8 +156,8 @@ func TestGeneratePinnedActionsComment(t *testing.T) { usedPins: map[string]ActionPin{ "actions/setup-node": { Repo: "actions/setup-node", - Version: "v4", - SHA: "49933ea5288caeca8642d1e84afbd3f7d6820020", + Version: "v6", + SHA: "2028fbc5c25fe9cf00d9f06a71cc4710d4507903", }, "actions/checkout": { Repo: "actions/checkout", diff --git a/pkg/workflow/runtime_integration_test.go b/pkg/workflow/runtime_integration_test.go index b162ae12504..550c767e0e8 100644 --- a/pkg/workflow/runtime_integration_test.go +++ b/pkg/workflow/runtime_integration_test.go @@ -236,7 +236,7 @@ Test workflow with runtime overrides applied to steps. lockStr := string(lockContent) // Verify that Node.js setup step is included with version 22 - if !strings.Contains(lockStr, "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020") { + if !strings.Contains(lockStr, "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903") { t.Error("Expected setup-node action in lock file") } if !strings.Contains(lockStr, "node-version: '22'") { diff --git a/pkg/workflow/runtime_setup_integration_test.go b/pkg/workflow/runtime_setup_integration_test.go index 92bb61fae5e..0d08603fc3a 100644 --- a/pkg/workflow/runtime_setup_integration_test.go +++ b/pkg/workflow/runtime_setup_integration_test.go @@ -26,7 +26,7 @@ steps: # Test workflow`, expectSetup: []string{ "Setup Node.js", - "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "node-version: '24'", }, }, @@ -88,7 +88,7 @@ on: push engine: copilot steps: - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 with: node-version: '20' - name: Install diff --git a/pkg/workflow/runtime_setup_test.go b/pkg/workflow/runtime_setup_test.go index 07615bbbbd2..11cf4bc4c93 100644 --- a/pkg/workflow/runtime_setup_test.go +++ b/pkg/workflow/runtime_setup_test.go @@ -160,7 +160,7 @@ func TestDetectFromCustomSteps(t *testing.T) { { name: "detects node even when setup-node exists (filtering happens later)", customSteps: `steps: - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 - run: npm install`, expected: []string{"node"}, // Changed: now detects, filtering happens in DetectRuntimeRequirements }, @@ -265,7 +265,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) { expectSteps: 1, checkContent: []string{ "Setup Node.js", - "actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020", + "actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903", "node-version: '20'", }, }, @@ -393,7 +393,7 @@ func TestShouldSkipRuntimeSetup(t *testing.T) { name: "never skip - runtime filtering handles existing setup actions", data: &WorkflowData{ CustomSteps: `steps: - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 - run: npm install`, }, expected: false, // Changed: we no longer skip, we filter instead