BE: Extend PolicyViolationInfo API to include ID and enforcement type
Why are we doing this work
In MR widget #510650[Multi-policies__dismissal.png] (comment 2703282954) , We need to show the list warn mode policies available for dismissal. The GraphQL API implemented in #561887 (closed) requires the ID of the policies to dismiss them.
The MergeRequest.PolicyViolations.Policies endpoint already returns the list of policies being violated. Therefor, we can update the PolicyViolationInfo type with the ID of the policies and enforcement_type to indicate if it's a warn mode policy.
Relevant links
From #561887 (comment 2740234236)
Update
Project.MergeRequest.PolicyViolations.policies.policyViolationInfoto include
- policy id to be used to send to backend for bypassing
- a status (e.g.
canBeBypassed,canUserBypass,isException, orisWarn)
for warn mode policies as well as policies that have user exceptions,
so the frontend can determine whether the bypass modal can be opened
and why the policy can be bypassed- a status (e.g.
state) to show in the MR widget if a policy has been bypassed or not
- a status (e.g.
state) to show in the MR widget if a policy has been bypassed or not- We can extend
MergeRequestApprovalStatetype with this info. This will be implemented in #569681 (closed)
- We can extend
Implementation plan
- Update PolicyViolationInfo to include ID and enforcement_type field
Verification steps
- The API is updated with the required field - ID and enforcement_type
Edited by Imam Hossain