Fix Spring Loading Wrong Instrumentation Class
What does this MR do?
I've been getting errors like the following recently while trying to run specs with spring:
Running via Spring preloader in process 67353
An error occurred while loading ./ee/spec/services/ee/merge_requests/create_pipeline_service_spec.rb.
Failure/Error: schema_definition.instrument(:field, Instrumentation.new)
NoMethodError:
undefined method `new' for Gitlab::Instrumentation:Module
# ./lib/gitlab/graphql/present.rb:18:in `use'
# ./app/graphql/gitlab_schema.rb:15:in `<class:GitlabSchema>'
# ./app/graphql/gitlab_schema.rb:3:in `<main>'
# ./spec/support/helpers/graphql_helpers.rb:397:in `<main>'
# ./spec/spec_helper.rb:47:in `block in <main>'
# ./spec/spec_helper.rb:47:in `each'
# ./spec/spec_helper.rb:47:in `<main>'
# ./ee/spec/services/ee/merge_requests/create_pipeline_service_spec.rb:3:in `<main>'
# -e:1:in `<main>'
/Users/jason/code/gdk/gitlab/spec/support/helpers/graphql_helpers.rb:4: warning: already initialized constant GraphqlHelpers::MutationDefinition
/Users/jason/code/gdk/gitlab/spec/support/helpers/graphql_helpers.rb:4: warning: previous definition of MutationDefinition was here
/Users/jason/code/gdk/gitlab/spec/support/helpers/graphql_helpers.rb:6: warning: already initialized constant GraphqlHelpers::NoData
/Users/jason/code/gdk/gitlab/spec/support/helpers/graphql_helpers.rb:6: warning: previous definition of NoData was here
An error occurred while loading ./ee/spec/services/ee/merge_requests/create_service_spec.rb.
Failure/Error: schema_definition.instrument(:field, Instrumentation.new)
This change seems to fix the issue.
It looks like !27735 (merged) introduced a new Gitlab::Instrumentation
module that didn't exist before: !27735 (diffs).
I suppose that's why this has started happening now.
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