Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNino committed Sep 14, 2023
2 parents 6acb9a2 + bb19a7a commit be4499c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 8 additions & 12 deletions artifactory/commands/transferfiles/state/transfersnapshot.go
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand All @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
7 changes: 5 additions & 2 deletions xray/utils/analyzermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit be4499c

Please sign in to comment.