Skip to content

Commit

Permalink
Expand fields for GitLab project
Browse files Browse the repository at this point in the history
Get some more data

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Nov 14, 2024
1 parent 42081a4 commit 1cca603
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 2 deletions.
6 changes: 6 additions & 0 deletions providers/gitlab/resources/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ func getGitlabProjectArgs(prj *gitlab.Project) map[string]*llx.RawData {
"visibility": llx.StringData(string(prj.Visibility)),
"webURL": llx.StringData(prj.WebURL),
"wikiEnabled": llx.BoolData(prj.WikiEnabled),
"jobsEnabled": llx.BoolData(prj.JobsEnabled),
"emptyRepo": llx.BoolData(prj.EmptyRepo),
"license": llx.StringData(prj.License.Name),
"sharedRunnersEnabled": llx.BoolData(prj.SharedRunnersEnabled),
"groupRunnersEnabled": llx.BoolData(prj.GroupRunnersEnabled),
}
}

Expand Down Expand Up @@ -141,6 +146,7 @@ func (p *mqlGitlabProject) approvalSettings() (*mqlGitlabProjectApprovalSetting,
"mergeRequestsAuthorApproval": llx.BoolData(approvalConfig.MergeRequestsAuthorApproval),
"mergeRequestsDisableCommittersApproval": llx.BoolData(approvalConfig.MergeRequestsDisableCommittersApproval),
"requirePasswordToApprove": llx.BoolData(approvalConfig.RequirePasswordToApprove),
"selectiveCodeOwnerRemovals": llx.BoolData(approvalConfig.SelectiveCodeOwnerRemovals),
}

mqlApprovalSettings, err := CreateResource(p.MqlRuntime, "gitlab.project.approvalSetting", approvalSettings)
Expand Down
17 changes: 15 additions & 2 deletions providers/gitlab/resources/gitlab.lr
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gitlab.project @defaults("fullName visibility webURL") {
// Project path
path string
// Create date of the project
createdAt time
createdAt time
// Project description
description string
// Default Git branch
Expand Down Expand Up @@ -123,6 +123,19 @@ private gitlab.project.approvalSetting @defaults("approvalsBeforeMerge requirePa
mergeRequestsDisableCommittersApproval bool
// Whether a password is required to approve
requirePasswordToApprove bool
// DEETS

Check warning on line 126 in providers/gitlab/resources/gitlab.lr

View workflow job for this annotation

GitHub Actions / Run spell check

`DEETS` is not a recognized word. (unrecognized-spelling)
selectiveCodeOwnerRemovals bool
// DEETS

Check warning on line 128 in providers/gitlab/resources/gitlab.lr

View workflow job for this annotation

GitHub Actions / Run spell check

`DEETS` is not a recognized word. (unrecognized-spelling)
jobsEnabled bool
// DEETS

Check warning on line 130 in providers/gitlab/resources/gitlab.lr

View workflow job for this annotation

GitHub Actions / Run spell check

`DEETS` is not a recognized word. (unrecognized-spelling)
emptyRepo bool
// DEETS

Check warning on line 132 in providers/gitlab/resources/gitlab.lr

View workflow job for this annotation

GitHub Actions / Run spell check

`DEETS` is not a recognized word. (unrecognized-spelling)
license string
// DEETS

Check warning on line 134 in providers/gitlab/resources/gitlab.lr

View workflow job for this annotation

GitHub Actions / Run spell check

`DEETS` is not a recognized word. (unrecognized-spelling)
sharedRunnersEnabled
// DEETS
groupRunnersEnabled

}


Expand Down Expand Up @@ -166,4 +179,4 @@ private gitlab.project.webhook @defaults("url sslVerification") {
url string
// Whether SSL verification is enabled
sslVerification bool
}
}
72 changes: 72 additions & 0 deletions providers/gitlab/resources/gitlab.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions providers/gitlab/resources/gitlab.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ resources:
fields:
approvalsBeforeMerge: {}
disableOverridingApproversPerMergeRequest: {}
emptyRepo: {}
groupRunnersEnabled: {}
jobsEnabled: {}
license: {}
mergeRequestsAuthorApproval: {}
mergeRequestsDisableCommittersApproval: {}
requirePasswordToApprove: {}
resetApprovalsOnPush: {}
selectiveCodeOwnerRemovals: {}
sharedRunnersEnabled: {}
is_private: true
min_mondoo_version: 9.0.0
gitlab.project.file:
Expand Down

0 comments on commit 1cca603

Please sign in to comment.