Move metrics controller EE methods into Core
What does this MR do?
Issue: #42639 (closed)
This MR moves the EE metrics controller code into the core metrics controller.
This is the third MR in a chain of MRs.
Changes in this MR:
- Move
ee/app/controllers/ee/projects/prometheus/metrics_controller.rb
intoapp/controllers/projects/prometheus/metrics_controller.rb
. - Move
ee/spec/controllers/projects/prometheus/metrics_controller_spec.rb
intospec/controllers/projects/prometheus/metrics_controller_spec.rb
. - Move
validate_query
route fromee/config/routes/project.rb
intoconfig/routes/project.rb
sincevalidate_query
is one of the controller endpoints being moved. - Move
ee/spec/fixtures/api/schemas/prometheus/metrics.json
tospec/fixtures/api/schemas/prometheus/metrics.json
since it is used by theprometheus_metrics_controller_spec.rb
file. - Move
ee/lib/gitlab/prometheus/queries/validate_query.rb
tolib/gitlab/prometheus/queries/validate_query.rb
. - Move
ee/app/serializers/prometheus_metric_serializer.rb
toapp/serializers/prometheus_metric_serializer.rb
since it is only used by the MetricsController. - Move
ee/app/serializers/prometheus_metric_entity.rb
toapp/serializers/prometheus_metric_entity.rb
since it is only used by the PrometheusMetricSerializer. - Move
ee/app/views/projects/prometheus/metrics/edit.html.haml
toapp/views/projects/prometheus/metrics/edit.html.haml
since it is used by the MetricsController#edit endpoint. - Move
ee/app/views/projects/prometheus/metrics/new.html.haml
toapp/views/projects/prometheus/metrics/new.html.haml
since it is used by the MetricsController#new endpoint. - Move
ee/app/views/projects/prometheus/metrics/_form.html.haml
toapp/views/projects/prometheus/metrics/_form.html.haml
since the view is used by the new and edit HTML files.
Manual testing
To test the EE product, follow the steps in the issue to test create/edit/delete a custom metric.
To test the CE product, remove the ee
folder (you can rename it instead) of your GDK and verify that the Prometheus integration settings page (Settings > Integrations > Prometheus) works fine. The custom metrics feature will not show up in CE until the frontend MR is merged.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
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 🤖 GitLab Bot 🤖