Skip to content

Commit

Permalink
Merge branch 'dev' into validate-xray-url
Browse files Browse the repository at this point in the history
  • Loading branch information
hadarshjfrog authored Oct 28, 2024
2 parents df0c639 + c989616 commit 30a7ebf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions commands/audit/sca/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ import (
xrayUtils "github.com/jfrog/jfrog-client-go/xray/services/utils"
)

const (
// Visual Studio inner directory.
DotVsRepoSuffix = ".vs"
)

var CurationErrorMsgToUserTemplate = "Failed to retrieve the dependencies tree for the %s project. Please contact your " +
"Artifactory administrator to verify pass-through for Curation audit is enabled for your project"

Expand Down
3 changes: 2 additions & 1 deletion commands/audit/sca/nuget/nuget.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func BuildDependencyTree(params utils.AuditParams) (dependencyTree []*xrayUtils.
err = errors.Join(err, fileutils.RemoveTempDir(tmpWd))
}()

err = biutils.CopyDir(wd, tmpWd, true, nil)
// Exclude Visual Studio inner directorty since it is not neccessary for the scan process and may cause race condition.
err = biutils.CopyDir(wd, tmpWd, true, []string{sca.DotVsRepoSuffix})
if err != nil {
err = fmt.Errorf("failed copying project to temp dir: %w", err)
return
Expand Down
5 changes: 4 additions & 1 deletion commands/audit/sca/pnpm/pnpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"

"github.com/jfrog/jfrog-cli-security/commands/audit/sca"
"github.com/jfrog/jfrog-cli-security/commands/audit/sca/npm"
"github.com/jfrog/jfrog-cli-security/utils"
"github.com/jfrog/jfrog-cli-security/utils/techutils"
Expand Down Expand Up @@ -115,7 +116,9 @@ func installProjectIfNeeded(pnpmExecPath, workingDir string) (dirForDependencies
err = errors.Join(err, fileutils.RemoveTempDir(dirForDependenciesCalculation))
}
}()
err = biutils.CopyDir(workingDir, dirForDependenciesCalculation, true, nil)

// Exclude Visual Studio inner directorty since it is not neccessary for the scan process and may cause race condition.
err = biutils.CopyDir(workingDir, dirForDependenciesCalculation, true, []string{sca.DotVsRepoSuffix})
if err != nil {
err = fmt.Errorf("failed copying project to temp dir: %w", err)
return
Expand Down
5 changes: 3 additions & 2 deletions commands/audit/sca/python/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ func getDependencies(auditPython *AuditPython) (dependenciesGraph map[string][]s
)
}()

err = biutils.CopyDir(wd, tempDirPath, true, nil)
// Exclude Visual Studio inner directorty since it is not neccessary for the scan process and may cause race condition.
err = biutils.CopyDir(wd, tempDirPath, true, []string{sca.DotVsRepoSuffix})
if err != nil {
return
}
Expand Down Expand Up @@ -439,4 +440,4 @@ func populatePythonDependencyTree(currNode *xrayUtils.GraphNode, dependenciesGra
currNode.Nodes = append(currNode.Nodes, childNode)
populatePythonDependencyTree(childNode, dependenciesGraph, uniqueDepsSet)
}
}
}

0 comments on commit 30a7ebf

Please sign in to comment.