diff --git a/artifactory/commands/transferfiles/delayedartifactshandler.go b/artifactory/commands/transferfiles/delayedartifactshandler.go index 4609b63fb..adab43f5c 100644 --- a/artifactory/commands/transferfiles/delayedartifactshandler.go +++ b/artifactory/commands/transferfiles/delayedartifactshandler.go @@ -220,7 +220,7 @@ func getDelayUploadComparisonFunctions(packageType string) []shouldDelayUpload { switch packageType { case maven, gradle, ivy: return []shouldDelayUpload{func(fileName string) bool { - return filepath.Ext(fileName) == ".pom" + return filepath.Ext(fileName) == ".pom" || fileName == "pom.xml" }} case docker: return []shouldDelayUpload{func(fileName string) bool { diff --git a/artifactory/commands/transferfiles/state/transfersnapshot.go b/artifactory/commands/transferfiles/state/transfersnapshot.go index 2cc04782f..d51b551a1 100644 --- a/artifactory/commands/transferfiles/state/transfersnapshot.go +++ b/artifactory/commands/transferfiles/state/transfersnapshot.go @@ -1,12 +1,15 @@ package state import ( - "github.com/jfrog/jfrog-cli-core/v2/utils/reposnapshot" - "github.com/jfrog/jfrog-client-go/utils/errorutils" "sync" "time" + + "github.com/jfrog/jfrog-cli-core/v2/utils/reposnapshot" + "github.com/jfrog/jfrog-client-go/utils/errorutils" ) +var saveRepoSnapshotMutex sync.Mutex + type SnapshotActionFunc func(rts *RepoTransferSnapshot) error var snapshotSaveIntervalMin = snapshotSaveIntervalMinDefault @@ -20,8 +23,7 @@ type RepoTransferSnapshot struct { snapshotManager reposnapshot.RepoSnapshotManager lastSaveTimestamp time.Time // This boolean marks that this snapshot continues a previous run. It allows skipping certain checks if it was not loaded, because some data is known to be new. - loadedFromSnapshot bool - saveRepoSnapshotMutex sync.Mutex + loadedFromSnapshot bool } // Runs the provided action on the snapshot manager, and periodically saves the repo state and snapshot to the snapshot dir. @@ -38,22 +40,16 @@ func (ts *TransferStateManager) snapshotAction(action SnapshotActionFunc) (err e return nil } - if !ts.repoTransferSnapshot.saveRepoSnapshotMutex.TryLock() { + if !saveRepoSnapshotMutex.TryLock() { return nil } - defer ts.repoTransferSnapshot.saveRepoSnapshotMutex.Unlock() + defer saveRepoSnapshotMutex.Unlock() ts.repoTransferSnapshot.lastSaveTimestamp = now if err = ts.repoTransferSnapshot.snapshotManager.PersistRepoSnapshot(); err != nil { return err } - return saveStateToSnapshot(&ts.TransferState) -} - -func saveStateToSnapshot(ts *TransferState) error { - saveStateMutex.Lock() - defer saveStateMutex.Unlock() return ts.persistTransferState(true) } diff --git a/go.mod b/go.mod index 2f2afd68e..f4b687efc 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/jedib0t/go-pretty/v6 v6.4.7 github.com/jfrog/build-info-go v1.9.10 github.com/jfrog/gofrog v1.3.0 - github.com/jfrog/jfrog-client-go v1.32.2 + github.com/jfrog/jfrog-client-go v1.32.3 github.com/magiconair/properties v1.8.7 github.com/manifoldco/promptui v0.9.0 github.com/owenrumney/go-sarif/v2 v2.2.0 diff --git a/go.sum b/go.sum index 02c23bd61..737b839c2 100644 --- a/go.sum +++ b/go.sum @@ -199,8 +199,8 @@ github.com/jfrog/build-info-go v1.9.10 h1:uXnDLVxpqxoAMpXcki00QaBB+M2BoGMMpHODPk github.com/jfrog/build-info-go v1.9.10/go.mod h1:ujJ8XQZMdT2tMkLSMJNyDd1pCY+duwHdjV+9or9FLIg= github.com/jfrog/gofrog v1.3.0 h1:o4zgsBZE4QyDbz2M7D4K6fXPTBJht+8lE87mS9bw7Gk= github.com/jfrog/gofrog v1.3.0/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0= -github.com/jfrog/jfrog-client-go v1.32.2 h1:t0ceWCtFri+xsa0D2ESqD/itcovlxBXCky1A1MJ4P2I= -github.com/jfrog/jfrog-client-go v1.32.2/go.mod h1:UewnwkIf/77HzBgwCPzOHZCK6V/Nw5/JwdzN/tRb4aU= +github.com/jfrog/jfrog-client-go v1.32.3 h1:B2M8Gu8EMrokbHWPPDgN1b7YRWwf0oe746epvQASK6c= +github.com/jfrog/jfrog-client-go v1.32.3/go.mod h1:UewnwkIf/77HzBgwCPzOHZCK6V/Nw5/JwdzN/tRb4aU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= diff --git a/xray/utils/analyzermanager.go b/xray/utils/analyzermanager.go index 50a4cbcfd..5f46be58c 100644 --- a/xray/utils/analyzermanager.go +++ b/xray/utils/analyzermanager.go @@ -23,7 +23,7 @@ const ( EntitlementsMinVersion = "3.66.5" ApplicabilityFeatureId = "contextual_analysis" AnalyzerManagerZipName = "analyzerManager.zip" - defaultAnalyzerManagerVersion = "1.3.2.2005632" + defaultAnalyzerManagerVersion = "1.3.2.2006984" minAnalyzerManagerVersionForSast = "1.3" analyzerManagerDownloadPath = "xsc-gen-exe-analyzer-manager-local/v1" analyzerManagerDirName = "analyzerManager" @@ -108,7 +108,10 @@ func (am *AnalyzerManager) Exec(configFile, scanCommand, workingDir string, serv cmd.Dir = workingDir output, err := cmd.CombinedOutput() if err != nil { - err = errorutils.CheckErrorf("running %q in directory: %q failed: %s - %s", strings.Join(cmd.Args, " "), workingDir, err.Error(), string(output)) + if len(output) > 0 { + log.Debug(fmt.Sprintf("%s %q output: %s", workingDir, strings.Join(cmd.Args, " "), string(output))) + } + err = errorutils.CheckError(err) } return }