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

Add Xray Source Control Service #451

Merged
merged 55 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bd5817f
prepare xsc calls
EyalDelarea Aug 17, 2023
8d820ed
prepare optional gitInfoContext for XSC.
EyalDelarea Aug 21, 2023
c5a4e62
Send gitInfoContext object to xsc
EyalDelarea Aug 21, 2023
a1746b2
pull dev
EyalDelarea Aug 21, 2023
556d8ea
fix merge
EyalDelarea Aug 21, 2023
e720e40
fix merge
EyalDelarea Aug 21, 2023
0d83140
Fix go sum
EyalDelarea Aug 21, 2023
aca546e
Create XSC context object before scanning
EyalDelarea Aug 22, 2023
d3f8ba7
fix tests,update dependencies
EyalDelarea Aug 22, 2023
9b91b17
fix static check
EyalDelarea Aug 22, 2023
b12b27a
fix git provider name for xsc ui display
EyalDelarea Aug 22, 2023
060cede
Add azure getRepo support for XSC context
EyalDelarea Aug 22, 2023
ee1b901
update core
EyalDelarea Aug 22, 2023
ffa1655
pull dev
EyalDelarea Aug 24, 2023
826c851
remove todo
EyalDelarea Aug 24, 2023
ff415d7
update deps
EyalDelarea Aug 28, 2023
2008293
pull dev
EyalDelarea Aug 28, 2023
52b335d
remove XSC git context info from scan pull request
EyalDelarea Aug 29, 2023
5807540
pull dev
EyalDelarea Aug 29, 2023
f01120e
Update deps
EyalDelarea Aug 30, 2023
3cfd0d9
remove provider mapping
EyalDelarea Aug 30, 2023
54769fc
Merge branch 'dev' of https://github.com/jfrog/frogbot into add_xsc_s…
EyalDelarea Aug 30, 2023
b773d94
Merge branch 'dev' of https://github.com/jfrog/frogbot into add_xsc_s…
EyalDelarea Aug 30, 2023
92982e0
pull dev
EyalDelarea Aug 31, 2023
fd800c0
Merge branch 'dev' of https://github.com/jfrog/frogbot into add_xsc_s…
EyalDelarea Sep 3, 2023
646d644
pull dev
EyalDelarea Sep 6, 2023
5443f7e
fix pull
EyalDelarea Sep 6, 2023
fb96429
update deps
EyalDelarea Sep 6, 2023
86d1dcd
update deps
EyalDelarea Sep 7, 2023
6e4bde9
update deps
EyalDelarea Sep 8, 2023
923b231
Merge branch 'dev' of https://github.com/jfrog/frogbot into add_xsc_s…
EyalDelarea Sep 8, 2023
c562e25
update deps
EyalDelarea Sep 8, 2023
28e0fa9
pull dev
EyalDelarea Sep 10, 2023
a1596bc
CR
EyalDelarea Sep 10, 2023
0d9d83a
CR
EyalDelarea Sep 10, 2023
542d0a0
pull dev
EyalDelarea Sep 10, 2023
7976532
pull dev
EyalDelarea Sep 10, 2023
fa4a0a9
merge
EyalDelarea Sep 10, 2023
adaad79
update deps
EyalDelarea Sep 10, 2023
d3d5cbf
Update deps
EyalDelarea Sep 10, 2023
23962f0
update deps
EyalDelarea Sep 11, 2023
e3982d2
pull dev
EyalDelarea Sep 11, 2023
9f1a241
fix diff
EyalDelarea Sep 11, 2023
c3d4246
update deps and comments
EyalDelarea Sep 11, 2023
34df909
update deps
EyalDelarea Sep 11, 2023
d22c749
update deps
EyalDelarea Sep 11, 2023
61b613a
Update go.mod
EyalDelarea Sep 12, 2023
1d10bfc
CR
EyalDelarea Sep 12, 2023
b3d8369
update deps
EyalDelarea Sep 12, 2023
c17ca76
return error
EyalDelarea Sep 12, 2023
6bf94bb
pull dev
EyalDelarea Sep 12, 2023
fa7788e
remove extra api call
EyalDelarea Sep 12, 2023
c696fb8
remove diff
EyalDelarea Sep 12, 2023
d0e40b2
remove if
EyalDelarea Sep 12, 2023
1faff97
comments
EyalDelarea Sep 12, 2023
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
12 changes: 3 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/go-git/go-git/v5 v5.8.1
github.com/golang/mock v1.6.0
github.com/google/go-github/v45 v45.2.0
github.com/jfrog/build-info-go v1.9.9
github.com/jfrog/build-info-go v1.9.10
github.com/jfrog/froggit-go v1.13.4
github.com/jfrog/gofrog v1.3.0
github.com/jfrog/jfrog-cli-core/v2 v2.41.4
github.com/jfrog/jfrog-client-go v1.31.6
github.com/jfrog/jfrog-cli-core/v2 v2.41.5
EyalDelarea marked this conversation as resolved.
Show resolved Hide resolved
github.com/jfrog/jfrog-client-go v1.32.1
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
github.com/owenrumney/go-sarif/v2 v2.2.0
github.com/stretchr/testify v1.8.4
Expand Down Expand Up @@ -115,9 +115,3 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)

replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230910172216-6e94c82ee5ab

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20230906115540-2c3c91d271d6

replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230907115821-300055da003e
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -877,16 +877,16 @@ 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.7 h1:lwiTJr1DEkAgzljsUsORmWsVn5MQjt1BPJdPCtJ6KXE=
github.com/jedib0t/go-pretty/v6 v6.4.7/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs=
github.com/jfrog/build-info-go v1.8.9-0.20230907115821-300055da003e h1:m2XFar8L02NwUoG66rZzVwLopgfxoeOAvOca7bIFtTw=
github.com/jfrog/build-info-go v1.8.9-0.20230907115821-300055da003e/go.mod h1:QEskae5fQpjeY2PBzsjWtUQVskYSNDF2sSmw/Gx44dQ=
github.com/jfrog/build-info-go v1.9.10 h1:uXnDLVxpqxoAMpXcki00QaBB+M2BoGMMpHODPkmmYOY=
github.com/jfrog/build-info-go v1.9.10/go.mod h1:ujJ8XQZMdT2tMkLSMJNyDd1pCY+duwHdjV+9or9FLIg=
github.com/jfrog/froggit-go v1.13.4 h1:+pHq3iNkKFvojXCJ74sDV+UsV4Thsi03dsu36jkS7Rc=
github.com/jfrog/froggit-go v1.13.4/go.mod h1:0jRAaZZusaFFnITosmx6CA60SKryuoaCasJyUrP/c1s=
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-cli-core/v2 v2.31.1-0.20230910172216-6e94c82ee5ab h1:a5K2iiesqXkvPZlf+BX7qt2XdJFgirVULyPD2VtBtzw=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230910172216-6e94c82ee5ab/go.mod h1:PCRqGSz6tKQNtiITSk9WZGflJjno/Vg4DvXPLkH6xO8=
github.com/jfrog/jfrog-client-go v1.28.1-0.20230906115540-2c3c91d271d6 h1:9mNCAUu/uHx80s4rMc9PeI1lllrZ1MOPUesIMglFoTY=
github.com/jfrog/jfrog-client-go v1.28.1-0.20230906115540-2c3c91d271d6/go.mod h1:soD5VL3X+G+0KKUNSlb0CSdF9nwHsQZCr0xqOGedAHM=
github.com/jfrog/jfrog-cli-core/v2 v2.41.5 h1:+hQs69dXhNrDIDsBlEPcmLgywfkzyKrIsCZtBW486PU=
github.com/jfrog/jfrog-cli-core/v2 v2.41.5/go.mod h1:HCMfdtCy2B81EF8YiQlsfbG3CsLk/VeqoWGNYoSUz8Q=
github.com/jfrog/jfrog-client-go v1.32.1 h1:RQmuPSLsF5222vZJzwkgHSZMMJF83ExS7SwIvh4P+H8=
github.com/jfrog/jfrog-client-go v1.32.1/go.mod h1:362+oa7uTTYurzBs1L0dmUTlLo7uhpAU/pwM5Zb9clg=
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA=
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
Expand Down
2 changes: 2 additions & 0 deletions scanpullrequest/scanallpullrequests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ func getMockClient(t *testing.T, frogbotMessages *[]string, mockParams ...MockPa
client.EXPECT().DeletePullRequestComment(context.Background(), params.repoOwner, params.repoName, gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
// Return private repositories visibility
client.EXPECT().GetRepositoryInfo(context.Background(), gomock.Any(), gomock.Any()).Return(vcsclient.RepositoryInfo{RepositoryVisibility: vcsclient.Private}, nil).AnyTimes()
// Return latest commit info for XSC context.
client.EXPECT().GetLatestCommit(context.Background(), params.repoOwner, params.repoName, gomock.Any()).Return(vcsclient.CommitInfo{}, nil).AnyTimes()
}
return client
}
Expand Down
1 change: 1 addition & 0 deletions scanpullrequest/scanpullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
xrayutils "github.com/jfrog/jfrog-cli-core/v2/xray/utils"
"github.com/jfrog/jfrog-client-go/utils/log"
"github.com/jfrog/jfrog-client-go/xray/services"

"os"
)

Expand Down
55 changes: 29 additions & 26 deletions scanrepository/scanrepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type ScanRepositoryCmd struct {
dryRun bool
// When dryRun is enabled, dryRunRepoPath specifies the repository local path to clone
dryRunRepoPath string
// The details of the current scan
details *utils.ScanDetails
// The scanDetails of the current scan
scanDetails *utils.ScanDetails
// The base working directory
baseWd string
// The git client the command performs git operations with
Expand All @@ -57,6 +57,7 @@ func (cfp *ScanRepositoryCmd) scanAndFixRepository(repository *utils.Repository,
if err = cfp.setCommandPrerequisites(repository, branch, client); err != nil {
return
}
cfp.scanDetails.SetXscGitInfoContext(branch, repository.Project, client)
if err = cfp.scanAndFixBranch(repository); err != nil {
return
}
Expand All @@ -78,7 +79,7 @@ func (cfp *ScanRepositoryCmd) scanAndFixBranch(repository *utils.Repository) (er
err = errors.Join(err, restoreBaseDir(), fileutils.RemoveTempDir(clonedRepoDir))
}()
for i := range repository.Projects {
cfp.details.Project = &repository.Projects[i]
cfp.scanDetails.Project = &repository.Projects[i]
cfp.projectTech = ""
if err = cfp.scanAndFixProject(repository); err != nil {
return
Expand All @@ -88,37 +89,39 @@ func (cfp *ScanRepositoryCmd) scanAndFixBranch(repository *utils.Repository) (er
}

func (cfp *ScanRepositoryCmd) setCommandPrerequisites(repository *utils.Repository, branch string, client vcsclient.VcsClient) (err error) {
cfp.details = utils.NewScanDetails(client, &repository.Server, &repository.Git).

cfp.scanDetails = utils.NewScanDetails(client, &repository.Server, &repository.Git).
SetXrayGraphScanParams(repository.Watches, repository.JFrogProjectKey).
SetFailOnInstallationErrors(*repository.FailOnSecurityIssues).
SetBaseBranch(branch).
SetFixableOnly(repository.FixableOnly).
SetMinSeverity(repository.MinSeverity)

cfp.aggregateFixes = repository.Git.AggregateFixes
cfp.OutputWriter = outputwriter.GetCompatibleOutputWriter(repository.GitProvider)
repositoryInfo, err := client.GetRepositoryInfo(context.Background(), cfp.details.RepoOwner, cfp.details.RepoName)
repositoryInfo, err := client.GetRepositoryInfo(context.Background(), cfp.scanDetails.RepoOwner, cfp.scanDetails.RepoName)
if err != nil {
return
}
remoteHttpsGitUrl := repositoryInfo.CloneInfo.HTTP
cfp.gitManager, err = utils.NewGitManager().
SetAuth(cfp.details.Username, cfp.details.Token).
SetAuth(cfp.scanDetails.Username, cfp.scanDetails.Token).
SetDryRun(cfp.dryRun, cfp.dryRunRepoPath).
SetRemoteGitUrl(remoteHttpsGitUrl)
if err != nil {
return
}
_, err = cfp.gitManager.SetGitParams(cfp.details.Git)
_, err = cfp.gitManager.SetGitParams(cfp.scanDetails.Git)
return
}

func (cfp *ScanRepositoryCmd) scanAndFixProject(repository *utils.Repository) error {
var fixNeeded bool
// A map that contains the full project paths as a keys
// The value is a map of vulnerable package names -> the details of the vulnerable packages.
// That means we have a map of all the vulnerabilities that were found in a specific folder, along with their full details.
// The value is a map of vulnerable package names -> the scanDetails of the vulnerable packages.
// That means we have a map of all the vulnerabilities that were found in a specific folder, along with their full scanDetails.
vulnerabilitiesByPathMap := make(map[string]map[string]*utils.VulnerabilityDetails)
projectFullPathWorkingDirs := utils.GetFullPathWorkingDirs(cfp.details.Project.WorkingDirs, cfp.baseWd)
projectFullPathWorkingDirs := utils.GetFullPathWorkingDirs(cfp.scanDetails.Project.WorkingDirs, cfp.baseWd)
for _, fullPathWd := range projectFullPathWorkingDirs {
scanResults, err := cfp.scan(fullPathWd)
if err != nil {
Expand All @@ -128,7 +131,7 @@ func (cfp *ScanRepositoryCmd) scanAndFixProject(repository *utils.Repository) er
if repository.GitProvider.String() == vcsutils.GitHub.String() {
// Uploads Sarif results to GitHub in order to view the scan in the code scanning UI
// Currently available on GitHub only
if err = utils.UploadSarifResultsToGithubSecurityTab(scanResults, repository, cfp.details.BaseBranch(), cfp.details.Client()); err != nil {
if err = utils.UploadSarifResultsToGithubSecurityTab(scanResults, repository, cfp.scanDetails.BaseBranch(), cfp.scanDetails.Client()); err != nil {
log.Warn(err)
}
}
Expand All @@ -152,7 +155,7 @@ func (cfp *ScanRepositoryCmd) scanAndFixProject(repository *utils.Repository) er
// Audit the dependencies of the current commit.
func (cfp *ScanRepositoryCmd) scan(currentWorkingDir string) (*audit.Results, error) {
// Audit commit code
auditResults, err := cfp.details.RunInstallAndAudit(currentWorkingDir)
auditResults, err := cfp.scanDetails.RunInstallAndAudit(currentWorkingDir)
if err != nil {
return nil, err
}
Expand All @@ -171,7 +174,7 @@ func (cfp *ScanRepositoryCmd) getVulnerabilitiesMap(scanResults *xrayutils.Exten

// Nothing to fix, return
if len(vulnerabilitiesMap) == 0 {
log.Info("Didn't find vulnerable dependencies with existing fix versions for", cfp.details.RepoName)
log.Info("Didn't find vulnerable dependencies with existing fix versions for", cfp.scanDetails.RepoName)
}
return vulnerabilitiesMap, nil
}
Expand Down Expand Up @@ -215,7 +218,7 @@ func (cfp *ScanRepositoryCmd) fixProjectVulnerabilities(fullProjectPath string,
}

// After fixing the current vulnerability, checkout to the base branch to start fixing the next vulnerability
if e := cfp.gitManager.Checkout(cfp.details.BaseBranch()); e != nil {
if e := cfp.gitManager.Checkout(cfp.scanDetails.BaseBranch()); e != nil {
err = errors.Join(err, cfp.handleUpdatePackageErrors(e))
return
}
Expand Down Expand Up @@ -283,7 +286,7 @@ func (cfp *ScanRepositoryCmd) handleUpdatePackageErrors(err error) error {
func (cfp *ScanRepositoryCmd) fixSinglePackageAndCreatePR(vulnDetails *utils.VulnerabilityDetails) (err error) {
fixVersion := vulnDetails.SuggestedFixedVersion
log.Debug("Attempting to fix", vulnDetails.ImpactedDependencyName, "with", fixVersion)
fixBranchName, err := cfp.gitManager.GenerateFixBranchName(cfp.details.BaseBranch(), vulnDetails.ImpactedDependencyName, fixVersion)
fixBranchName, err := cfp.gitManager.GenerateFixBranchName(cfp.scanDetails.BaseBranch(), vulnDetails.ImpactedDependencyName, fixVersion)
if err != nil {
return
}
Expand Down Expand Up @@ -329,8 +332,8 @@ func (cfp *ScanRepositoryCmd) openFixingPullRequest(fixBranchName string, vulnDe
if err != nil {
return
}
log.Debug("Creating Pull Request form:", fixBranchName, " to:", cfp.details.BaseBranch())
return cfp.details.Client().CreatePullRequest(context.Background(), cfp.details.RepoOwner, cfp.details.RepoName, fixBranchName, cfp.details.BaseBranch(), pullRequestTitle, prBody)
log.Debug("Creating Pull Request form:", fixBranchName, " to:", cfp.scanDetails.BaseBranch())
return cfp.scanDetails.Client().CreatePullRequest(context.Background(), cfp.scanDetails.RepoOwner, cfp.scanDetails.RepoName, fixBranchName, cfp.scanDetails.BaseBranch(), pullRequestTitle, prBody)
}

// openAggregatedPullRequest handles the opening or updating of a pull request when the aggregate mode is active.
Expand All @@ -348,11 +351,11 @@ func (cfp *ScanRepositoryCmd) openAggregatedPullRequest(fixBranchName string, pu
return
}
if pullRequestInfo == nil {
log.Info("Creating Pull Request from:", fixBranchName, "to:", cfp.details.BaseBranch())
return cfp.details.Client().CreatePullRequest(context.Background(), cfp.details.RepoOwner, cfp.details.RepoName, fixBranchName, cfp.details.BaseBranch(), pullRequestTitle, prBody)
log.Info("Creating Pull Request from:", fixBranchName, "to:", cfp.scanDetails.BaseBranch())
return cfp.scanDetails.Client().CreatePullRequest(context.Background(), cfp.scanDetails.RepoOwner, cfp.scanDetails.RepoName, fixBranchName, cfp.scanDetails.BaseBranch(), pullRequestTitle, prBody)
}
log.Info("Updating Pull Request from:", fixBranchName, "to:", cfp.details.BaseBranch())
return cfp.details.Client().UpdatePullRequest(context.Background(), cfp.details.RepoOwner, cfp.details.RepoName, pullRequestTitle, prBody, "", int(pullRequestInfo.ID), vcsutils.Open)
log.Info("Updating Pull Request from:", fixBranchName, "to:", cfp.scanDetails.BaseBranch())
return cfp.scanDetails.Client().UpdatePullRequest(context.Background(), cfp.scanDetails.RepoOwner, cfp.scanDetails.RepoName, pullRequestTitle, prBody, "", int(pullRequestInfo.ID), vcsutils.Open)
}

func (cfp *ScanRepositoryCmd) preparePullRequestDetails(vulnerabilitiesDetails ...*utils.VulnerabilityDetails) (string, string, error) {
Expand All @@ -377,7 +380,7 @@ func (cfp *ScanRepositoryCmd) preparePullRequestDetails(vulnerabilitiesDetails .

func (cfp *ScanRepositoryCmd) cloneRepositoryAndCheckoutToBranch() (tempWd string, restoreDir func() error, err error) {
if cfp.dryRun {
tempWd = filepath.Join(cfp.dryRunRepoPath, cfp.details.RepoName)
tempWd = filepath.Join(cfp.dryRunRepoPath, cfp.scanDetails.RepoName)
} else {
// Create temp working directory
if tempWd, err = fileutils.CreateTempDir(); err != nil {
Expand All @@ -387,7 +390,7 @@ func (cfp *ScanRepositoryCmd) cloneRepositoryAndCheckoutToBranch() (tempWd strin
log.Debug("Created temp working directory:", tempWd)

// Clone the content of the repo to the new working directory
if err = cfp.gitManager.Clone(tempWd, cfp.details.BaseBranch()); err != nil {
if err = cfp.gitManager.Clone(tempWd, cfp.scanDetails.BaseBranch()); err != nil {
return
}

Expand Down Expand Up @@ -470,7 +473,7 @@ func (cfp *ScanRepositoryCmd) updatePackageToFixedVersion(vulnDetails *utils.Vul

handler := cfp.handlers[vulnDetails.Technology]
if handler == nil {
handler = packagehandlers.GetCompatiblePackageHandler(vulnDetails, cfp.details)
handler = packagehandlers.GetCompatiblePackageHandler(vulnDetails, cfp.scanDetails)
cfp.handlers[vulnDetails.Technology] = handler
} else if _, unsupported := handler.(*packagehandlers.UnsupportedPackageHandler); unsupported {
return
Expand All @@ -496,7 +499,7 @@ func (cfp *ScanRepositoryCmd) getRemoteBranchScanHash(prBody string) string {
}

func (cfp *ScanRepositoryCmd) getOpenPullRequestBySourceBranch(branchName string) (prInfo *vcsclient.PullRequestInfo, err error) {
list, err := cfp.details.Client().ListOpenPullRequestsWithBody(context.Background(), cfp.details.RepoOwner, cfp.details.RepoName)
list, err := cfp.scanDetails.Client().ListOpenPullRequestsWithBody(context.Background(), cfp.scanDetails.RepoOwner, cfp.scanDetails.RepoName)
if err != nil {
return
}
Expand Down Expand Up @@ -541,7 +544,7 @@ func (cfp *ScanRepositoryCmd) aggregateFixAndOpenPullRequest(vulnerabilitiesMap
}
}
log.Info("-----------------------------------------------------------------")
if e := cfp.gitManager.Checkout(cfp.details.BaseBranch()); e != nil {
if e := cfp.gitManager.Checkout(cfp.scanDetails.BaseBranch()); e != nil {
err = errors.Join(err, e)
}
return
Expand Down
2 changes: 1 addition & 1 deletion scanrepository/scanrepository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func TestPackageTypeFromScan(t *testing.T) {
Project: &frogbotParams.Projects[0],
ServerDetails: &frogbotParams.Server,
}
testScan.details = &scanSetup
testScan.scanDetails = &scanSetup
scanResponse, err := testScan.scan(tmpDir)
assert.NoError(t, err)
verifyTechnologyNaming(t, scanResponse.ExtendedScanResults.XrayResults, pkg.packageType)
Expand Down
Loading
Loading