Add GraphQL support for removing alert integrations
What does this MR do?
Issues: #255515 (closed), #245333 (closed)
This MR adds a new mutation for managing alerting integrations - a delete mutation for just HTTP integrations. There can only be one Prometheus integration, and project services don't currently support deletion. If we wanted to add that functionality specifically, we could certainly research & do it, but I think it's out of scope for this feature set.
Expected responses:
- User doesn't have permissions: 200 OK, but errors includes 'The resource that you are attempting to access does not exist or you don't have permission to perform this action'
- Failure to remove the integration: 200 OK, but errors includes message related to what might have gone wrong
Sample mutation info for httpIntegrationDestroy
Sample Mutation:
mutation destroy($input: HttpIntegrationDestroyInput!) {
httpIntegrationDestroy(input: $input) {
integration {
active
apiUrl
url
token
id
name
}
errors
}
}
Sample Input:
{
"input": {
"id": "gid://gitlab/AlertManagement::HttpIntegration/120040"
}
}
Sample Response:
{
"data": {
"httpIntegrationDestroy": {
"integration": {
"active": false,
"apiUrl": null,
"url": "http://192.168.1.152:3000/Commit451/lab-coat/alerts/notify/name-modified-via-api/d9b54ccf55d99506.json",
"token": "d25ab41ddd9f1677a24fc806ae184e2d",
"id": "gid://gitlab/AlertManagement::HttpIntegration/120040",
"name": "Name modified via API"
},
"errors": []
}
}
}
Sibling MRs:
- Query: !45622 (merged)
- Create Mutation: !45842 (merged)
- Update/Reset token Mutations: !45844 (merged)
- Destroy Mutation: !45843 (merged) (HTTP integrations only)
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry - feature flag
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Sarah Yasonik