Development / test failure : uninitialized constant Applications::Helm
Am seeing this often when running specs with Spring.
NameError:
uninitialized constant Applications::Helm
# ./app/models/clusters/cluster.rb:14:in `<class:Cluster>'
# ./app/models/clusters/cluster.rb:4:in `<module:Clusters>'
# ./app/models/clusters/cluster.rb:3:in `<main>'
# ./config/initializers/postgresql_cte.rb:98:in `build_arel'
# ./app/models/clusters/clusters_hierarchy.rb:105:in `project_clusters_base_query'
# ./app/models/clusters/clusters_hierarchy.rb:37:in `recursive_cte'
# ./app/models/clusters/clusters_hierarchy.rb:14:in `base_and_ancestors'
# ./app/models/concerns/deployment_platform.rb:25:in `find_platform_kubernetes_with_cte'
# ./ee/app/models/concerns/ee/deployment_platform.rb:9:in `find_platform_kubernetes_with_cte'
# ./app/models/concerns/deployment_platform.rb:19:in `find_deployment_platform'
# ./app/models/concerns/deployment_platform.rb:9:in `deployment_platform'
# ./app/models/environment.rb:317:in `block in deployment_platform'
# ./lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'
# ./app/models/environment.rb:316:in `deployment_platform'
# ./app/models/environment.rb:252:in `block in deployment_namespace'
# ./lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'
# ./app/models/environment.rb:251:in `deployment_namespace'
# ./lib/gitlab/prometheus/query_variables.rb:9:in `call'
# ./app/services/prometheus/proxy_variable_substitution_service.rb:69:in `predefined_context'
# ./app/services/prometheus/proxy_variable_substitution_service.rb:55:in `substitute_ruby_variables'
# ./app/models/concerns/stepable.rb:14:in `call'
# ./app/models/concerns/stepable.rb:14:in `block in execute_steps'
# ./app/models/concerns/stepable.rb:13:in `each'
# ./app/models/concerns/stepable.rb:13:in `inject'
# ./app/models/concerns/stepable.rb:13:in `execute_steps'
# ./app/services/prometheus/proxy_variable_substitution_service.rb:17:in `execute'
# ./app/controllers/projects/environments/prometheus_api_controller.rb:11:in `proxy'
# ./ee/lib/gitlab/ip_address_state.rb:10:in `with'
# ./ee/app/controllers/ee/application_controller.rb:43:in `set_current_ip_address'
# ./lib/gitlab/auth/current_user_mode.rb:45:in `with_current_admin'
# ./app/controllers/application_controller.rb:481:in `set_current_admin'
# ./lib/gitlab/session.rb:11:in `with_session'
# ./app/controllers/application_controller.rb:469:in `set_session_storage'
# ./lib/gitlab/i18n.rb:55:in `with_locale'
# ./lib/gitlab/i18n.rb:61:in `with_user_locale'
# ./app/controllers/application_controller.rb:463:in `set_locale'
# ./lib/gitlab/application_context.rb:46:in `block in use'
# ./lib/gitlab/application_context.rb:46:in `use'
# ./lib/gitlab/application_context.rb:19:in `with_context'
# ./app/controllers/application_controller.rb:454:in `set_current_context'
# ./lib/gitlab/error_tracking.rb:34:in `with_context'
# ./app/controllers/application_controller.rb:554:in `sentry_context'
# ./spec/controllers/projects/environments/prometheus_api_controller_spec.rb:58:in `block (6 levels) in <main>'
# ./spec/spec_helper.rb:236:in `block (3 levels) in <main>'
# ./spec/spec_helper.rb:236:in `block (2 levels) in <main>'
# -e:1:in `<main>'
# ------------------
# --- Caused by: ---
# NameError:
# uninitialized constant Applications::Helm
# ./app/models/clusters/cluster.rb:14:in `<class:Cluster>'
I think the issue is the reference to another class at the class level. We should change the values of Clusters::Cluster::APPLICATIONS to be strings instead
Edited by Thong Kuah