Clarify when policy is blocking change
Problem to solve
Currently when a user is trying to make a modification to Branch rules, a generic error is provided.
"Something went wrong while updating branch rule."
The change isn't possible because of a security policy and it even GraphQL doesn't give full clarity on the reason. Though it does give a bit more.
"graphql_errors": [
{
"message": "The resource that you are attempting to access does not exist or you don't have permission to perform this action",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"branchRuleUpdate"
]
}
],
Steps to reproduce
-
Ensure that a project above the project running the steps below has an active security policy that prevents the change of these rules, such as
approval_settings: block_branch_modification: true -
Go to Settings - Repository - Branch rules - Details.
-
Edit any existing branch rule.
-
Try to change merge access:
- Assign Developers (30).
- Or overwrite Maintainers (40), even if Maintainer is already set.
-
Save changes.
Proposal
Provide a direct and clear error message when a security policy (or other feature) is blocking the change instead of the fairly general error.
Something such as "A security policy is preventing this change."
Intended users
Developers, project managers, maintainers, anyone who has access to make changes to policies and branch rules.
Feature Usage Metrics
Unsure how to track the usage of this.
Does this feature require an audit event?
Require, no, but likely would benefit from one if existing branch rule changes are audited.
I'm unsure if this is the right group, but felt as the policy was the blocking feature it was the right place.