FE: Add support for branch exceptions in Policy UI Editor
Why are we doing this work
In the scope of this issue, we would like to extend the current functionality to support branch_exceptions
in Policy Editor UI for both Scan Result and Scan Execution Policies,
On Project-level dropdown with branches should be rendered from GraphQL Query:
query {
project(fullPath: "gitlab-org/gitlab") {
repository {
branchNames(searchPattern: "maste*", offset: 1, limit: 10)
}
}
}
On Group-level dropdown we're still discussing it in &9567 (comment 1471872477). We need to find a way to add this without fetching any data from API.
Relevant links
Non-functional requirements
-
Documentation: no documentation changes are needed until feature flag is enabled by default -
Feature flag: overall feature should be released behind feature flag security_policies_branch_exceptions
, if FF is disabled we should not considerbranch_exceptions
when evaluating if policy is applicable, -
Performance: -
Testing:
Implementation plan
- MR1:
- frontend ...
Verification steps
- Create a new Project
- Create a new Scan Result Policy in YAML mode and add
branch_exceptions: ["dev", { full_path: "path/to/project", "name": "main" }]
- Create a new Scan Execution Policy in YAML mode and add
branch_exceptions: ["dev", { full_path: "path/to/project", "name": "main" }]
- Go to Policies page and look how Policy Drawer is updated
Edited by Alan (Maciej) Paruszewski