Skip to content

Commit

Permalink
CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Oct 20, 2024
1 parent 8d77882 commit b6ead79
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions integrationutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ func setIntegrationTestEnvs(t *testing.T, testDetails *IntegrationTestDetails) f
useLocalRepo = "true"
}
unsetEnvs := utils.SetEnvsAndAssertWithCallback(t, map[string]string{
utils.RequirementsFileEnv: "requirements.txt",
utils.GitPullRequestIDEnv: testDetails.PullRequestID,
utils.GitProvider: testDetails.GitProvider,
utils.GitTokenEnv: testDetails.GitToken,
utils.GitRepoEnv: testDetails.RepoName,
utils.GitRepoOwnerEnv: testDetails.RepoOwner,
utils.BranchNameTemplateEnv: testDetails.CustomBranchName,
utils.GitApiEndpointEnv: testDetails.ApiEndpoint,
utils.GitProjectEnv: testDetails.GitProject,
utils.GitUsernameEnv: testDetails.GitUsername,
utils.GitBaseBranchEnv: mainBranch,
utils.GitUseCurrentLocalRepositoryEnv: useLocalRepo,
utils.RequirementsFileEnv: "requirements.txt",
utils.GitPullRequestIDEnv: testDetails.PullRequestID,
utils.GitProvider: testDetails.GitProvider,
utils.GitTokenEnv: testDetails.GitToken,
utils.GitRepoEnv: testDetails.RepoName,
utils.GitRepoOwnerEnv: testDetails.RepoOwner,
utils.BranchNameTemplateEnv: testDetails.CustomBranchName,
utils.GitApiEndpointEnv: testDetails.ApiEndpoint,
utils.GitProjectEnv: testDetails.GitProject,
utils.GitUsernameEnv: testDetails.GitUsername,
utils.GitBaseBranchEnv: mainBranch,
utils.GitUseLocalRepositoryEnv: useLocalRepo,
})
return func() {
envRestoreFunc()
Expand Down
12 changes: 6 additions & 6 deletions utils/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ const (
JfrogConfigProfileEnv = "JF_CONFIG_PROFILE"

// Git environment variables
GitProvider = "JF_GIT_PROVIDER"
GitRepoOwnerEnv = "JF_GIT_OWNER"
GitRepoEnv = "JF_GIT_REPO"
GitProjectEnv = "JF_GIT_PROJECT"
GitUsernameEnv = "JF_GIT_USERNAME"
GitUseCurrentLocalRepositoryEnv = "JF_USE_CURRENT_LOCAL_REPOSITORY"
GitProvider = "JF_GIT_PROVIDER"
GitRepoOwnerEnv = "JF_GIT_OWNER"
GitRepoEnv = "JF_GIT_REPO"
GitProjectEnv = "JF_GIT_PROJECT"
GitUsernameEnv = "JF_GIT_USERNAME"
GitUseLocalRepositoryEnv = "JF_USE_LOCAL_REPOSITORY"

// Git naming template environment variables
BranchNameTemplateEnv = "JF_BRANCH_NAME_TEMPLATE"
Expand Down
2 changes: 1 addition & 1 deletion utils/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (gm *GitManager) SetLocalRepositoryAndRemoteName() (*GitManager, error) {
var err error
// Re-initialize the repository and update remoteName
gm.remoteName = vcsutils.RemoteName
gm.localGitRepository, err = git.PlainOpen(".")
err = gm.SetLocalRepository()
return gm, err
}

Expand Down
2 changes: 1 addition & 1 deletion utils/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (g *Git) extractScanRepositoryEnvParams(gitParamsFromEnv *Git) (err error)
}
}
if !g.UseLocalRepository {
if g.UseLocalRepository, err = getBoolEnv(GitUseCurrentLocalRepositoryEnv, false); err != nil {
if g.UseLocalRepository, err = getBoolEnv(GitUseLocalRepositoryEnv, false); err != nil {
return
}
}
Expand Down

0 comments on commit b6ead79

Please sign in to comment.