Add GraphQL API to add issuable resource links
What does this MR do and why?
This MR adds a GraphQL API to add resource links to an incident. Currently, there is no frontend development for this, this MR adds the base classes for mutation and service. This change is behind a feature flag.
This MR is big because it also adds some base classes and services to lay the foundation for delete
GraphQL API.
Screenshots or screen recordings
Mutation | Result |
---|---|
Mutation
mutation CreateIssuableResourceLink($input: IssuableResourceLinkCreateInput!) {
issuableResourceLinkCreate(input: $input) {
issuableResourceLink {
id
issue { id title }
link
linkText
linkType
}
errors
}
}
Query variables
{
"input": {
"id": "<global id of the incident>",
"link": "http://docs.gitlab.com/incident-info",
"linkText": "Doclink for incident",
"linkType": "general"
}
}
How to set up and validate locally
- Enable the feature flag
incident_resource_links_widget
usingFeature.enable(:incident_resource_links_widget)
- Make sure you have the premium+ license installed.
- Make sure you have at least reporter permissions.
- Create an incident manually by navigating to Monitor > Incidents from the left sidebar menu of your GitLab project.
- Find the global id of the incident and pass in the input parameters of the GraphQL query.
- Run the above GraphQL query inside
http://localhost:3000/-/graphql-explorer
. - Check
IncidentManagement::IssuableResourceLink.find(<ID>)
in therails console
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #363338 (closed)
Edited by Rajendra Kadam