Move monitoring integrations to `Integrations::` [RUN ALL RSPEC] [RUN AS-IF-FOSS]
What does this MR do?
This MR namespaces the "monitoring" integrations to the Integrations::
namespace as part of #201855 (closed).
It builds on the groundwork in !60968 (merged) to safely rename STI models.
As the old PrometheusService
model was used as a GraphQL GlobalID argument, it adds a new deprecation to allow backwards-compatibility with clients who still use the old GlobalID string (gid://gitlab/PrometheusService/<id>
), or name (PrometheusServiceID
), in arguments supplied to the mutations. Support of deprecated GlobalIDs was added in !62870 (merged).
QA
To test that this branch supports the old GraphQL mutations:
1. Create a Prometheus integration
Open a Rails console (replace "myproject"
with a project full path):
project = Project.find_by_full_path("myproject")
integration = Integrations::Prometheus.create(project: project)
Note down the integration.id
.
2. Call mutations using GraphiQL
Visit http://127.0.0.1:3000/-/graphql-explorer.
At the bottom, in the QUERY VARIABLES
panel, paste (replacing <id>
with the id
of the prometheus integration you created earlier):
{
"id": "gid://gitlab/PrometheusService/<id>",
"active": true
}
(Screenshot example)
In the main query pane, paste and then run these (click the play button to run):
A mutation query with the input.id
argument named as ID!
:
mutation updatePrometheusIntegration($id: ID!, $active: Boolean!) {
prometheusIntegrationUpdate(input: { id: $id, active: $active }) {
errors
integration {
id
active
}
}
}
A mutation query with the input.id
argument named as PrometheusServiceID!
:
mutation updatePrometheusIntegration($id: PrometheusServiceID!, $active: Boolean!) {
prometheusIntegrationUpdate(input: { id: $id, active: $active }) {
errors
integration {
id
active
}
}
}
The above will also work on master
so this is backwards-compatible
Additionally, this branch also accepts the newer query format (this is the format that is now documented in the GraphQL docs):
input.id
named as IntegrationsPrometheusID!
mutation updatePrometheusIntegration($id: IntegrationsPrometheusID!, $active: Boolean!) {
prometheusIntegrationUpdate(input: { id: $id, active: $active }) {
errors
integration {
id
active
}
}
}
And variables using the new-format GlobalID (this is the format this is now documented in the GraphQL docs, and expressed by the PrometheusType#id
field):
{
"id": "gid://gitlab/Integrations::Prometheus/98",
"active": false
}
Does this MR meet the acceptance criteria?
Conformity
- [-] I have included a changelog entry, or it's not needed. (Does this MR need a changelog?)
-
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) - [-] I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?)
-
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) - [-] I have tested this MR in all supported browsers, or it's not needed.
- [-] I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Related to #201855 (closed)