From 0c20c771d99d8fbb19b0aea4b9730a094c6012f2 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Wed, 8 Jan 2025 15:21:43 +0200 Subject: [PATCH 1/4] Update .github/workflows/test.yml Co-authored-by: Yahav Itschak --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c290bd83..4977965ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: uses: pnpm/action-setup@v4 with: version: 9 + # Install Mono on Ubuntu to run nuget.exe (due to this issue on Ubuntu 24 that hasn't been fixed yet - https://github.com/NuGet/setup-nuget/issues/168) - name: Install Mono on Ubuntu if: matrix.os == 'ubuntu' From 6ac61ffda7efeb31a48bec3dd72d8c009ac13255 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Wed, 8 Jan 2025 16:01:15 +0200 Subject: [PATCH 2/4] Update artifactory/commands/dotnet/dotnetcommand_test.go Co-authored-by: Yahav Itschak --- artifactory/commands/dotnet/dotnetcommand_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifactory/commands/dotnet/dotnetcommand_test.go b/artifactory/commands/dotnet/dotnetcommand_test.go index 2651af90f..0fa00975e 100644 --- a/artifactory/commands/dotnet/dotnetcommand_test.go +++ b/artifactory/commands/dotnet/dotnetcommand_test.go @@ -297,7 +297,7 @@ func TestCreateConfigFileIfNeeded(t *testing.T) { t.Run(tt.name, func(t *testing.T) { configPath := filepath.Join(t.TempDir(), tt.configPath) if tt.fileExists { - assert.NoError(t, os.MkdirAll(filepath.Dir(configPath), 0777)) + assert.NoError(t, os.MkdirAll(filepath.Dir(configPath), os.ModePerm)) assert.NoError(t, os.WriteFile(configPath, []byte{}, 0644)) } err := CreateConfigFileIfNeeded(configPath) From 2b347b89cf423506e9ad2d57bf4286fda3bfc847 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Wed, 8 Jan 2025 16:01:23 +0200 Subject: [PATCH 3/4] Update artifactory/commands/dotnet/dotnetcommand_test.go Co-authored-by: Yahav Itschak --- artifactory/commands/dotnet/dotnetcommand_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifactory/commands/dotnet/dotnetcommand_test.go b/artifactory/commands/dotnet/dotnetcommand_test.go index 0fa00975e..39f63b212 100644 --- a/artifactory/commands/dotnet/dotnetcommand_test.go +++ b/artifactory/commands/dotnet/dotnetcommand_test.go @@ -336,7 +336,7 @@ func TestAddConfigFileFlag(t *testing.T) { }, } - for _, tt := range tests { + for _, testCase := range testCases { t.Run(tt.name, func(t *testing.T) { // Create a mock command object cmd, err := dotnet.NewToolchainCmd(tt.toolchainType) From 17f4f5f1f470d863cee31be3018291d244b498ec Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Wed, 8 Jan 2025 17:17:19 +0200 Subject: [PATCH 4/4] Update artifactory/commands/dotnet/dotnetcommand.go Co-authored-by: Yahav Itschak --- artifactory/commands/dotnet/dotnetcommand.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifactory/commands/dotnet/dotnetcommand.go b/artifactory/commands/dotnet/dotnetcommand.go index 3756c27f7..b91e9cb99 100644 --- a/artifactory/commands/dotnet/dotnetcommand.go +++ b/artifactory/commands/dotnet/dotnetcommand.go @@ -214,7 +214,7 @@ func RemoveSourceFromNugetConfigIfExists(cmdType dotnet.ToolchainType, customCon if strings.Contains(stdOut+stdErr, "Unable to find") || strings.Contains(stdOut+stdErr, "does not exist") { return nil } - return fmt.Errorf("failed to remove source: %w\n%s", err, strings.TrimSpace(stdOut+stdErr)) + return errorutils.CheckErrorf("failed to remove source: %w\n%s\n%s", err, strings.TrimSpace(stdOut), strings.TrimSpace(stdErr)) } return nil }