Skip to content

Commit

Permalink
Add support to code repository in github and gitlab on prem
Browse files Browse the repository at this point in the history
  • Loading branch information
Korjen97 committed Oct 29, 2024
1 parent 5220341 commit a333de5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/commands/util/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func runPRDecoration(prWrapper wrappers.PRWrapper, policyWrapper wrappers.Policy
namespaceFlag, _ := cmd.Flags().GetString(params.NamespaceFlag)
repoNameFlag, _ := cmd.Flags().GetString(params.RepoNameFlag)
prNumberFlag, _ := cmd.Flags().GetInt(params.PRNumberFlag)
serverUrl, _ := cmd.Flags().GetString(params.CodeRepositoryFlag)
apiUrl, _ := cmd.Flags().GetString(params.CodeRepositoryFlag)

Check failure on line 164 in internal/commands/util/pr.go

View workflow job for this annotation

GitHub Actions / lint

var `apiUrl` should be `apiURL` (golint)

scanRunningOrQueued, err := isScanRunningOrQueued(scansWrapper, scanID)

Expand All @@ -188,7 +188,7 @@ func runPRDecoration(prWrapper wrappers.PRWrapper, policyWrapper wrappers.Policy
RepoName: repoNameFlag,
PrNumber: prNumberFlag,
Policies: policies,
ServerUrl: serverUrl,
ApiUrl: apiUrl,
}
prResponse, errorModel, err := prWrapper.PostPRDecoration(prModel)
if err != nil {
Expand All @@ -213,7 +213,7 @@ func runPRDecorationGitlab(prWrapper wrappers.PRWrapper, policyWrapper wrappers.
repoNameFlag, _ := cmd.Flags().GetString(params.RepoNameFlag)
iIDFlag, _ := cmd.Flags().GetInt(params.PRIidFlag)
gitlabProjectIDFlag, _ := cmd.Flags().GetInt(params.PRGitlabProjectFlag)
serverUrl, _ := cmd.Flags().GetString(params.CodeRepositoryFlag)
apiUrl, _ := cmd.Flags().GetString(params.CodeRepositoryFlag)

Check failure on line 216 in internal/commands/util/pr.go

View workflow job for this annotation

GitHub Actions / lint

var `apiUrl` should be `apiURL` (golint)

scanRunningOrQueued, err := isScanRunningOrQueued(scansWrapper, scanID)

Expand Down Expand Up @@ -241,7 +241,7 @@ func runPRDecorationGitlab(prWrapper wrappers.PRWrapper, policyWrapper wrappers.
IiD: iIDFlag,
GitlabProjectID: gitlabProjectIDFlag,
Policies: policies,
ServerUrl: serverUrl,
ApiUrl: apiUrl,
}

prResponse, errorModel, err := prWrapper.PostGitlabPRDecoration(prModel)
Expand Down
4 changes: 2 additions & 2 deletions internal/wrappers/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type PRModel struct {
RepoName string `json:"repoName"`
PrNumber int `json:"prNumber"`
Policies []PrPolicy `json:"violatedPolicyList"`
ServerUrl string `json:"ServerUrl"`
ApiUrl string `json:"apiUrl"`

Check failure on line 14 in internal/wrappers/pr.go

View workflow job for this annotation

GitHub Actions / lint

struct field `ApiUrl` should be `APIURL` (golint)
}

type GitlabPRModel struct {
Expand All @@ -22,7 +22,7 @@ type GitlabPRModel struct {
IiD int `json:"iid"`
GitlabProjectID int `json:"gitlabProjectID"`
Policies []PrPolicy `json:"violatedPolicyList"`
ServerUrl string `json:"ServerUrl"`
ApiUrl string `json:"apiUrl"`

Check failure on line 25 in internal/wrappers/pr.go

View workflow job for this annotation

GitHub Actions / lint

struct field `ApiUrl` should be `APIURL` (golint)
}

type PRWrapper interface {
Expand Down

0 comments on commit a333de5

Please sign in to comment.