Add the ability for a user to test their API-based approval rules
Problem to solve
As part of #219567 (closed) we'll allow the user to add API-based approval rules in the form of a URL.
The issue is that feedback for adding a URL is delayed, only once a merge request needs approval will the URL be requested. This could be a potential development blocker in the MR approval process.
Proposal
Add a Test Link
button to the approval modal that checks if the URL is valid / works and provides some feedback to the user.
Empty state | With data | Testing | Failed | Success |
---|---|---|---|---|
Links / References
Similar issues
In #233478 we'll be adding the ability to retry API based approval rules, the implementations for both are likely to share some logic.
Implementation approach
- Add button to form (ee/app/assets/javascripts/status_checks/components/form.vue)
- Add reactive text to button pressed state
- If api url path is valid =>
Validation passed
(in green) - If api url path is invalid =>
Validation failed
(in red)
- If api url path is valid =>
- Update docs (doc/user/project/merge_requests/status_checks.md)
- Add spec coverage
Edited by Jay Montal