Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible race condition when running external commands #1053

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,6 @@ require (

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20231126134442-14887b84b87a

replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231128152703-7461a0ee42a6
replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231130093251-25c79868c10c

replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.3.2-0.20231130091721-6d742be8bc7a
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jedib0t/go-pretty/v6 v6.4.0 h1:YlI/2zYDrweA4MThiYMKtGRfT+2qZOO65ulej8GTcVI=
github.com/jedib0t/go-pretty/v6 v6.4.0/go.mod h1:MgmISkTWDSFu0xOqiZ0mKNntMQ2mDgOcwOkwBEkMDJI=
github.com/jfrog/build-info-go v1.8.9-0.20231128152703-7461a0ee42a6 h1:mn2csOrg1FTMnoGOyaX/jcy+l3QyRf5+klsgxQN4/Gs=
github.com/jfrog/build-info-go v1.8.9-0.20231128152703-7461a0ee42a6/go.mod h1:XVFk2rCYhIdc7+hIGE8TC3le5PPM+xYHU22udoE2b7Q=
github.com/jfrog/gofrog v1.3.1 h1:QqAwQXCVReT724uga1AYqG/ZyrNQ6f+iTxmzkb+YFQk=
github.com/jfrog/gofrog v1.3.1/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0=
github.com/jfrog/build-info-go v1.8.9-0.20231130093251-25c79868c10c h1:culsgr+XKgN+l+Isy/pV/Cvt3t1sGmBGYKvxu0Eqc3s=
github.com/jfrog/build-info-go v1.8.9-0.20231130093251-25c79868c10c/go.mod h1:ABgPkDi0h8A8DwVh1z6kNt9xMFzd0vZ9Ae5BiEjxvLQ=
github.com/jfrog/gofrog v1.3.2-0.20231130091721-6d742be8bc7a h1:SCgU7ho+YAu+8lo2U5Tr0gH8PQV6mVGaoywXH8He4Ng=
github.com/jfrog/gofrog v1.3.2-0.20231130091721-6d742be8bc7a/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-client-go v1.28.1-0.20231126134442-14887b84b87a h1:hZFfT7i+vwhDhJ7xf211XbS9uxjR83vC618di1Eo0wo=
Expand Down
15 changes: 8 additions & 7 deletions utils/python/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ package utils

import (
"fmt"
buildinfoutils "github.com/jfrog/build-info-go/utils"
"net/url"
"os"
"path/filepath"
"strings"

"github.com/jfrog/build-info-go/utils/pythonutils"
"github.com/jfrog/gofrog/io"
gofrogcmd "github.com/jfrog/gofrog/io"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-client-go/auth"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/log"
"github.com/spf13/viper"
"net/url"
"os"
"path/filepath"
"strings"
)

const (
Expand Down Expand Up @@ -91,7 +92,7 @@ func runPoetryConfigCommand(args []string, maskArgs bool) error {
logMessage += strings.Join(args, " ")
}
log.Info(fmt.Sprintf("Running Poetry %s", logMessage))
cmd := buildinfoutils.NewCommand("poetry", "config", args)
cmd := io.NewCommand("poetry", "config", args)
err := gofrogcmd.RunCmd(cmd)
if err != nil {
return errorutils.CheckErrorf("Poetry config command failed with: %s", err.Error())
Expand All @@ -113,7 +114,7 @@ func addRepoToPyprojectFile(filepath, poetryRepoName, repoUrl string) error {
}
log.Info(fmt.Sprintf("Added tool.poetry.source name:%q url:%q", poetryRepoName, repoUrl))
log.Info("Running Poetry update")
cmd := buildinfoutils.NewCommand("poetry", "update", []string{})
cmd := io.NewCommand("poetry", "update", []string{})
err = gofrogcmd.RunCmd(cmd)
if err != nil {
return errorutils.CheckErrorf("Poetry config command failed with: %s", err.Error())
Expand Down