From c99c30fdd6f3adf4fb29aad4b10e265be69d2d67 Mon Sep 17 00:00:00 2001 From: charlieablett Date: Wed, 19 Jun 2019 14:37:54 +0200 Subject: [PATCH] Remove potentially noisy warning - If Gitaly calls are missing, it could be due to a conditional and may just become noise --- app/graphql/types/base_field.rb | 2 -- spec/graphql/types/base_field_spec.rb | 4 ---- 2 files changed, 6 deletions(-) diff --git a/app/graphql/types/base_field.rb b/app/graphql/types/base_field.rb index ee23146f711..95db116d6f9 100644 --- a/app/graphql/types/base_field.rb +++ b/app/graphql/types/base_field.rb @@ -60,8 +60,6 @@ module Types # involved with the request. if @calls_gitaly && Gitlab::GitalyClient.get_request_count == 0 raise "Gitaly is called for field '#{name}' - please add `calls_gitaly: true` to the field declaration" - elsif !@calls_gitaly && Gitlab::GitalyClient.get_request_count > 0 - raise "Gitaly not called for field '#{name}' - please remove `calls_gitaly: true` from the field declaration" end rescue => e Gitlab::Sentry.track_exception(e) diff --git a/spec/graphql/types/base_field_spec.rb b/spec/graphql/types/base_field_spec.rb index ebdfa3eaf4d..d7360872508 100644 --- a/spec/graphql/types/base_field_spec.rb +++ b/spec/graphql/types/base_field_spec.rb @@ -127,10 +127,6 @@ describe Types::BaseField do it 'does not raise an error if calls_gitaly is true' do expect { gitaly_field.send(:calls_gitaly_check) }.not_to raise_error end - - it 'raises an error if calls_gitaly is not decalared' do - expect { no_gitaly_field.send(:calls_gitaly_check) }.to raise_error(/please remove `calls_gitaly: true`/) - end end end end