Skip to content

Explicitly handle class constant references

Sarah Yasonik requested to merge fix-metrics-reload into master

What does this MR do?

  1. Updates ReactiveCachingWorker to use String#constantize instead of Kernel#const_get.

    Why: After a reload!, calling Kernel.const_get("Clusters::Applications::Prometheus") returns the module Prometheus instead of the class Clusters::Applications::Prometheus (likely due to lack of support for nesting in Kernel#const_get).

  2. Updates every reference to the Metrics class within lib/gitlab/metrics is explicitly called referenced as ::Gitlab::Metrics

    Why: Rails can't find which Metrics class is required after reload. Plus some consistency is nice.

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/54320

Does this MR meet the acceptance criteria?

Edited by Sarah Yasonik

Merge request reports