Expose securityPolicyProject for project or group in GraphQL API
requested to merge 414988-add-graphql-query-to-expose-security-policy-project-for-a-project-or-group into master
What does this MR do and why?
This MR exposes securityPolicyProject
for project
or group
in GraphQL API.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Project | Group |
---|---|
How to set up and validate locally
- Create a new group
- Visit Secure -> Policies and create a group policy. The security policy project will be created automatically with it. Sample policy YAML:
type: scan_result_policy name: Test policy description: '' enabled: true rules: - type: any_merge_request branch_type: protected commits: any actions: - type: require_approval approvals_required: 1 role_approvers: - developer
- Query GraphQL (
/-/graphql-explorer
):query { namespace: group(fullPath: "<group-path>") { id securityPolicyProject { name fullPath openMergeRequestsCount } } }
- Create a new project
- Visit Secure -> Policies and create a project policy. The security policy project will be created automatically with it. Sample policy YAML:
type: scan_result_policy name: Test policy description: '' enabled: true rules: - type: any_merge_request branch_type: protected commits: any actions: - type: require_approval approvals_required: 1 role_approvers: - developer
- Query GraphQL (
/-/graphql-explorer
):query { namespace: project(fullPath: "<project-path>") { id securityPolicyProject { name fullPath openMergeRequestsCount } } }
Related to #414988 (closed)
Edited by Martin Čavoj