From 089353dc70ed8930cd36e6be58e48ce1227055f9 Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Fri, 17 Oct 2025 06:22:54 +0530 Subject: [PATCH 1/6] Add fail_on_cache_miss parameter to CI config variables GraphQL resolver --- app/graphql/types/project_type.rb | 12 +- .../ci/list_config_variables_service.rb | 13 +- doc/api/graphql/reference/_index.md | 1 + spec/graphql/types/project_type_spec.rb | 137 ++++++++++++++++++ .../api/graphql/ci/config_variables_spec.rb | 59 ++++++-- .../ci/list_config_variables_service_spec.rb | 15 ++ .../helpers/reactive_caching_helpers.rb | 2 + 7 files changed, 220 insertions(+), 19 deletions(-) diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index af6cb74ca0d633..89a33a1db451d2 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -5,6 +5,7 @@ class ProjectType < BaseObject graphql_name 'Project' include ::Namespaces::DeletableHelper + include Gitlab::Graphql::Authorize::AuthorizeResource connection_type_class Types::CountableConnectionType @@ -34,6 +35,10 @@ def self.authorization_scopes authorize: :create_pipeline, experiment: { milestone: '15.3' }, description: 'CI/CD config variable.' do + argument :fail_on_cache_miss, GraphQL::Types::Boolean, + required: false, + default_value: false, + description: 'Whether to throw an error if cache is not ready.' argument :ref, GraphQL::Types::String, required: true, description: 'Ref.' @@ -1027,14 +1032,17 @@ def ci_pipeline_creation_inputs(ref:) response.payload[:inputs].all_inputs end - def ci_config_variables(ref:) - result = ::Ci::ListConfigVariablesService.new(object, context[:current_user]).execute(ref) + def ci_config_variables(ref:, fail_on_cache_miss: false) + result = ::Ci::ListConfigVariablesService.new(object, context[:current_user]).execute(ref, + fail_on_cache_miss: fail_on_cache_miss) return if result.nil? result.map do |var_key, var_config| { key: var_key, **var_config } end + rescue ::Ci::ListConfigVariablesService::CacheNotReadyError => e + raise_resource_not_available_error! e.message end def job(id:) diff --git a/app/services/ci/list_config_variables_service.rb b/app/services/ci/list_config_variables_service.rb index 3e1c0ce3ff328e..7e46e425c5954b 100644 --- a/app/services/ci/list_config_variables_service.rb +++ b/app/services/ci/list_config_variables_service.rb @@ -4,6 +4,8 @@ module Ci class ListConfigVariablesService < ::BaseService include ReactiveCaching + CacheNotReadyError = Class.new(StandardError) + self.reactive_cache_key = ->(service) { [service.class.name, service.id] } self.reactive_cache_work_type = :external_dependency self.reactive_cache_worker_finder = ->(id, *_args) { from_cache(id) } @@ -17,11 +19,18 @@ def self.from_cache(id) new(project, user) end - def execute(ref) + def execute(ref, fail_on_cache_miss: false) # "ref" is not a enough for a cache key because the name is static but that branch can be changed any time sha = project.commit(ref).try(:sha) - with_reactive_cache(sha, ref) { |result| result } + result = with_reactive_cache(sha, ref) { |result| result } + + if result.nil? && fail_on_cache_miss + raise CacheNotReadyError, + "Failed to retrieve CI/CD variables from cache." + end + + result end def calculate_reactive_cache(sha, ref) diff --git a/doc/api/graphql/reference/_index.md b/doc/api/graphql/reference/_index.md index 4abf36ac582f61..5c385f7488cced 100644 --- a/doc/api/graphql/reference/_index.md +++ b/doc/api/graphql/reference/_index.md @@ -39867,6 +39867,7 @@ Returns [`[CiConfigVariable!]`](#ciconfigvariable). | Name | Type | Description | | ---- | ---- | ----------- | +| `failOnCacheMiss` | [`Boolean`](#boolean) | Whether to throw an error if cache is not ready. | | `ref` | [`String!`](#string) | Ref. | ##### `Project.ciPipelineCreationInputs` diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index 2c1e783cdbc12c..a5e394c0da5fb1 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -1785,4 +1785,141 @@ end end end + + describe 'ci_config_variables field' do + let_it_be(:project) { create(:project, :repository) } + let_it_be(:user) { create(:user) } + let(:ref) { project.default_branch } + + let(:query) do + %( + query { + project(fullPath: "#{project.full_path}") { + ciConfigVariables(ref: "#{ref}") { + key + value + description + } + } + } + ) + end + + subject { GitlabSchema.execute(query, context: { current_user: user }).as_json } + + before do + project.add_developer(user) + end + + context 'when cache is not ready' do + before do + allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| + allow(service).to receive(:execute).and_raise( + ::Ci::ListConfigVariablesService::CacheNotReadyError, + 'Failed to retrieve CI configuration variables from cache.' + ) + end + end + + it 'returns GraphQL error with expected message' do + expect(subject['errors']).to be_present + expect(subject['errors'].first['message']).to eq('Failed to retrieve CI configuration variables from cache.') + expect(subject['data']['project']['ciConfigVariables']).to be_nil + end + + it 'includes error path information' do + expect(subject['errors'].first['path']).to eq(%w[project ciConfigVariables]) + end + end + + context 'when variables are successfully fetched' do + let(:ci_config_variables) do + { + KEY1: { value: 'val 1', description: 'description 1' }, + KEY2: { value: 'val 2', description: '' }, + KEY3: { value: 'val 3' } + } + end + + before do + allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| + allow(service).to receive(:execute).and_return(ci_config_variables) + end + end + + it 'returns variables list' do + variables = subject.dig('data', 'project', 'ciConfigVariables') + + expect(variables).to contain_exactly( + { 'key' => 'KEY1', 'value' => 'val 1', 'description' => 'description 1' }, + { 'key' => 'KEY2', 'value' => 'val 2', 'description' => '' }, + { 'key' => 'KEY3', 'value' => 'val 3', 'description' => nil } + ) + end + + it 'does not return any errors' do + expect(subject['errors']).to be_nil + end + end + + context 'with fail_on_cache_miss argument' do + let(:fail_on_cache_miss) { nil } + let(:query) do + fail_on_cache_miss_arg = fail_on_cache_miss.nil? ? '' : ", failOnCacheMiss: #{fail_on_cache_miss}" + %( + query { + project(fullPath: "#{project.full_path}") { + ciConfigVariables(ref: "#{ref}"#{fail_on_cache_miss_arg}) { + key + value + description + } + } + } + ) + end + + context 'when service is called with fail_on_cache_miss parameter' do + before do + allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| + allow(service).to receive(:execute).and_return({}) + end + end + + context 'with default value (not specified)' do + it 'calls service with fail_on_cache_miss: false' do + expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| + expect(service).to receive(:execute).with(ref, fail_on_cache_miss: false) + end + + subject + end + end + + context 'with fail_on_cache_miss: false' do + let(:fail_on_cache_miss) { false } + + it 'calls service with fail_on_cache_miss: false' do + expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| + expect(service).to receive(:execute).with(ref, fail_on_cache_miss: false) + end + + subject + end + end + + context 'with fail_on_cache_miss: true' do + let(:fail_on_cache_miss) { true } + + it 'calls service with fail_on_cache_miss: true' do + expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| + expect(service).to receive(:execute).with(ref, fail_on_cache_miss: true) + end + + subject + end + end + end + end + end end diff --git a/spec/requests/api/graphql/ci/config_variables_spec.rb b/spec/requests/api/graphql/ci/config_variables_spec.rb index 6a9dcfee9667ad..03916d8a81b707 100644 --- a/spec/requests/api/graphql/ci/config_variables_spec.rb +++ b/spec/requests/api/graphql/ci/config_variables_spec.rb @@ -15,12 +15,13 @@ let(:service) { Ci::ListConfigVariablesService.new(project, user) } let(:ref) { project.default_branch } + let(:fail_on_cache_miss) { false } let(:query) do %( query { project(fullPath: "#{project.full_path}") { - ciConfigVariables(ref: "#{ref}") { + ciConfigVariables(ref: "#{ref}", failOnCacheMiss: #{fail_on_cache_miss}) { key value valueOptions @@ -40,19 +41,8 @@ end context 'when the cache is not empty' do - before do - synchronous_reactive_cache(service) - end - - it 'returns the CI variables for the config' do - expect(service) - .to receive(:execute) - .with(ref) - .and_call_original - - post_graphql(query, current_user: user) - - expect(graphql_data.dig('project', 'ciConfigVariables')).to contain_exactly( + let(:expected_ci_variables) do + [ { 'key' => 'KEY_VALUE_VAR', 'value' => 'value x', @@ -71,7 +61,32 @@ 'valueOptions' => ['env var value', 'env var value2'], 'description' => 'env var description' } - ) + ] + end + + shared_examples 'returns CI variables' do + it 'returns the CI variables for the config' do + expect(service) + .to receive(:execute) + .with(ref, fail_on_cache_miss: fail_on_cache_miss) + .and_call_original + + post_graphql(query, current_user: user) + + expect(graphql_data.dig('project', 'ciConfigVariables')).to match_array(expected_ci_variables) + end + end + + before do + synchronous_reactive_cache(service) + end + + it_behaves_like 'returns CI variables' + + context 'when failOnCacheMiss is true' do + let(:fail_on_cache_miss) { true } + + it_behaves_like 'returns CI variables' end end @@ -81,6 +96,20 @@ expect(graphql_data.dig('project', 'ciConfigVariables')).to be_nil end + + context 'when failOnCacheMiss is true' do + let(:fail_on_cache_miss) { true } + + it 'returns an error' do + post_graphql(query, current_user: user) + + expect(graphql_errors).to include( + a_hash_including( + 'message' => 'Failed to retrieve CI/CD variables from cache.' + ) + ) + end + end end end diff --git a/spec/services/ci/list_config_variables_service_spec.rb b/spec/services/ci/list_config_variables_service_spec.rb index 4c363412f3dfb8..fc9f1f0b8607b1 100644 --- a/spec/services/ci/list_config_variables_service_spec.rb +++ b/spec/services/ci/list_config_variables_service_spec.rb @@ -306,5 +306,20 @@ expect(result).to be_nil end + + context 'when fail_on_cache_miss is true' do + subject(:result) { service.execute(ref, fail_on_cache_miss: true) } + + it 'raises CacheNotReadyError' do + expect { result }.to raise_error(described_class::CacheNotReadyError) + end + + it 'raises error with expected message' do + expect { result }.to raise_error( + described_class::CacheNotReadyError, + 'Failed to retrieve CI/CD variables from cache.' + ) + end + end end end diff --git a/spec/support/helpers/reactive_caching_helpers.rb b/spec/support/helpers/reactive_caching_helpers.rb index 604abbe2edfd8e..b364772b58dffb 100644 --- a/spec/support/helpers/reactive_caching_helpers.rb +++ b/spec/support/helpers/reactive_caching_helpers.rb @@ -22,6 +22,8 @@ def synchronous_reactive_cache(subject) allow(subject).to receive(:with_reactive_cache) do |*args, &block| block.call(subject.calculate_reactive_cache(*args)) end + + allow(subject).to receive(:within_reactive_cache_lifetime?).and_return(true) end def read_reactive_cache(subject, *qualifiers) -- GitLab From a4088755acaaefdf47dc1da07c45864764ae1b3d Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Fri, 17 Oct 2025 06:43:56 +0530 Subject: [PATCH 2/6] Update spec error message --- spec/graphql/types/project_type_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index a5e394c0da5fb1..fc90535115a683 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -1816,14 +1816,14 @@ allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| allow(service).to receive(:execute).and_raise( ::Ci::ListConfigVariablesService::CacheNotReadyError, - 'Failed to retrieve CI configuration variables from cache.' + 'Failed to retrieve CI/CD variables from cache.' ) end end it 'returns GraphQL error with expected message' do expect(subject['errors']).to be_present - expect(subject['errors'].first['message']).to eq('Failed to retrieve CI configuration variables from cache.') + expect(subject['errors'].first['message']).to eq('Failed to retrieve CI/CD variables from cache.') expect(subject['data']['project']['ciConfigVariables']).to be_nil end -- GitLab From 7431ef34d07d50c1a8a3cdc257a987521ed051c0 Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Mon, 20 Oct 2025 12:47:33 +0530 Subject: [PATCH 3/6] Small fixes in project_type_spec --- spec/graphql/types/project_type_spec.rb | 28 +++++++------------------ 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index fc90535115a683..dea0dbc32fea73 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -1811,7 +1811,7 @@ project.add_developer(user) end - context 'when cache is not ready' do + context 'when cache is not ready and fail_on_cache_miss is enabled' do before do allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| allow(service).to receive(:execute).and_raise( @@ -1886,38 +1886,24 @@ end end - context 'with default value (not specified)' do - it 'calls service with fail_on_cache_miss: false' do + shared_examples 'calls service with expected fail_on_cache_miss value' do |expected_value| + it "calls service with fail_on_cache_miss: #{expected_value}" do expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| - expect(service).to receive(:execute).with(ref, fail_on_cache_miss: false) + expect(service).to receive(:execute).with(ref, fail_on_cache_miss: expected_value) end subject end end - context 'with fail_on_cache_miss: false' do - let(:fail_on_cache_miss) { false } - - it 'calls service with fail_on_cache_miss: false' do - expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| - expect(service).to receive(:execute).with(ref, fail_on_cache_miss: false) - end - - subject - end + context 'with default value (not specified)' do + it_behaves_like 'calls service with expected fail_on_cache_miss value', false end context 'with fail_on_cache_miss: true' do let(:fail_on_cache_miss) { true } - it 'calls service with fail_on_cache_miss: true' do - expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| - expect(service).to receive(:execute).with(ref, fail_on_cache_miss: true) - end - - subject - end + it_behaves_like 'calls service with expected fail_on_cache_miss value', true end end end -- GitLab From b7e2066f9199b0e68ef317f72caf5da475362d6b Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Tue, 21 Oct 2025 11:49:56 +0530 Subject: [PATCH 4/6] Move the project developer hook logic to user initialisation --- spec/graphql/types/project_type_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index dea0dbc32fea73..f9d172a4a18708 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -1788,7 +1788,7 @@ describe 'ci_config_variables field' do let_it_be(:project) { create(:project, :repository) } - let_it_be(:user) { create(:user) } + let_it_be(:user) { create(:user, developer_of: project) } let(:ref) { project.default_branch } let(:query) do @@ -1807,10 +1807,6 @@ subject { GitlabSchema.execute(query, context: { current_user: user }).as_json } - before do - project.add_developer(user) - end - context 'when cache is not ready and fail_on_cache_miss is enabled' do before do allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| -- GitLab From 17ffcaeed3f23fcc734971b0dd5a125a81c2128d Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Wed, 22 Oct 2025 14:07:24 +0530 Subject: [PATCH 5/6] Extract error out of ListConfigVariablesService into graphql resolver --- app/graphql/types/project_type.rb | 6 +- .../ci/list_config_variables_service.rb | 13 +--- spec/graphql/types/project_type_spec.rb | 61 +++++++------------ .../ci/list_config_variables_service_spec.rb | 15 ----- 4 files changed, 29 insertions(+), 66 deletions(-) diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index 89a33a1db451d2..e2aa20e30bc401 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -1036,13 +1036,15 @@ def ci_config_variables(ref:, fail_on_cache_miss: false) result = ::Ci::ListConfigVariablesService.new(object, context[:current_user]).execute(ref, fail_on_cache_miss: fail_on_cache_miss) + if result.nil? && fail_on_cache_miss + raise_resource_not_available_error! "Failed to retrieve CI/CD variables from cache." + end + return if result.nil? result.map do |var_key, var_config| { key: var_key, **var_config } end - rescue ::Ci::ListConfigVariablesService::CacheNotReadyError => e - raise_resource_not_available_error! e.message end def job(id:) diff --git a/app/services/ci/list_config_variables_service.rb b/app/services/ci/list_config_variables_service.rb index 7e46e425c5954b..3e1c0ce3ff328e 100644 --- a/app/services/ci/list_config_variables_service.rb +++ b/app/services/ci/list_config_variables_service.rb @@ -4,8 +4,6 @@ module Ci class ListConfigVariablesService < ::BaseService include ReactiveCaching - CacheNotReadyError = Class.new(StandardError) - self.reactive_cache_key = ->(service) { [service.class.name, service.id] } self.reactive_cache_work_type = :external_dependency self.reactive_cache_worker_finder = ->(id, *_args) { from_cache(id) } @@ -19,18 +17,11 @@ def self.from_cache(id) new(project, user) end - def execute(ref, fail_on_cache_miss: false) + def execute(ref) # "ref" is not a enough for a cache key because the name is static but that branch can be changed any time sha = project.commit(ref).try(:sha) - result = with_reactive_cache(sha, ref) { |result| result } - - if result.nil? && fail_on_cache_miss - raise CacheNotReadyError, - "Failed to retrieve CI/CD variables from cache." - end - - result + with_reactive_cache(sha, ref) { |result| result } end def calculate_reactive_cache(sha, ref) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index f9d172a4a18708..e6bb6d37548b4e 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -1790,31 +1790,36 @@ let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user, developer_of: project) } let(:ref) { project.default_branch } + let(:fail_on_cache_miss) { nil } let(:query) do + fail_on_cache_miss_arg = fail_on_cache_miss.nil? ? '' : ", failOnCacheMiss: #{fail_on_cache_miss}" %( - query { - project(fullPath: "#{project.full_path}") { - ciConfigVariables(ref: "#{ref}") { - key - value - description + query { + project(fullPath: "#{project.full_path}") { + ciConfigVariables(ref: "#{ref}"#{fail_on_cache_miss_arg}) { + key + value + description + } } } - } - ) + ) end subject { GitlabSchema.execute(query, context: { current_user: user }).as_json } - context 'when cache is not ready and fail_on_cache_miss is enabled' do + def mock_config_variables_service(return_value) + allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| + allow(service).to receive(:execute).and_return(return_value) + end + end + + context 'when service returns nil and fail_on_cache_miss is enabled' do + let(:fail_on_cache_miss) { true } + before do - allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| - allow(service).to receive(:execute).and_raise( - ::Ci::ListConfigVariablesService::CacheNotReadyError, - 'Failed to retrieve CI/CD variables from cache.' - ) - end + mock_config_variables_service(nil) end it 'returns GraphQL error with expected message' do @@ -1829,7 +1834,7 @@ end context 'when variables are successfully fetched' do - let(:ci_config_variables) do + let_it_be(:ci_config_variables) do { KEY1: { value: 'val 1', description: 'description 1' }, KEY2: { value: 'val 2', description: '' }, @@ -1838,9 +1843,7 @@ end before do - allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| - allow(service).to receive(:execute).and_return(ci_config_variables) - end + mock_config_variables_service(ci_config_variables) end it 'returns variables list' do @@ -1859,27 +1862,9 @@ end context 'with fail_on_cache_miss argument' do - let(:fail_on_cache_miss) { nil } - let(:query) do - fail_on_cache_miss_arg = fail_on_cache_miss.nil? ? '' : ", failOnCacheMiss: #{fail_on_cache_miss}" - %( - query { - project(fullPath: "#{project.full_path}") { - ciConfigVariables(ref: "#{ref}"#{fail_on_cache_miss_arg}) { - key - value - description - } - } - } - ) - end - context 'when service is called with fail_on_cache_miss parameter' do before do - allow_next_instance_of(::Ci::ListConfigVariablesService) do |service| - allow(service).to receive(:execute).and_return({}) - end + mock_config_variables_service({}) end shared_examples 'calls service with expected fail_on_cache_miss value' do |expected_value| diff --git a/spec/services/ci/list_config_variables_service_spec.rb b/spec/services/ci/list_config_variables_service_spec.rb index fc9f1f0b8607b1..4c363412f3dfb8 100644 --- a/spec/services/ci/list_config_variables_service_spec.rb +++ b/spec/services/ci/list_config_variables_service_spec.rb @@ -306,20 +306,5 @@ expect(result).to be_nil end - - context 'when fail_on_cache_miss is true' do - subject(:result) { service.execute(ref, fail_on_cache_miss: true) } - - it 'raises CacheNotReadyError' do - expect { result }.to raise_error(described_class::CacheNotReadyError) - end - - it 'raises error with expected message' do - expect { result }.to raise_error( - described_class::CacheNotReadyError, - 'Failed to retrieve CI/CD variables from cache.' - ) - end - end end end -- GitLab From 9b3bc53cb5951b5700ce0b5c1f71b3c84305f157 Mon Sep 17 00:00:00 2001 From: Sahil Sharma Date: Wed, 22 Oct 2025 14:44:06 +0530 Subject: [PATCH 6/6] Remove extra argument from ListConfigVariablesService execute method --- app/graphql/types/project_type.rb | 3 +-- spec/graphql/types/project_type_spec.rb | 2 +- spec/requests/api/graphql/ci/config_variables_spec.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index e2aa20e30bc401..8363de4247524d 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -1033,8 +1033,7 @@ def ci_pipeline_creation_inputs(ref:) end def ci_config_variables(ref:, fail_on_cache_miss: false) - result = ::Ci::ListConfigVariablesService.new(object, context[:current_user]).execute(ref, - fail_on_cache_miss: fail_on_cache_miss) + result = ::Ci::ListConfigVariablesService.new(object, context[:current_user]).execute(ref) if result.nil? && fail_on_cache_miss raise_resource_not_available_error! "Failed to retrieve CI/CD variables from cache." diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index e6bb6d37548b4e..51451b053ae0dc 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -1870,7 +1870,7 @@ def mock_config_variables_service(return_value) shared_examples 'calls service with expected fail_on_cache_miss value' do |expected_value| it "calls service with fail_on_cache_miss: #{expected_value}" do expect_next_instance_of(::Ci::ListConfigVariablesService) do |service| - expect(service).to receive(:execute).with(ref, fail_on_cache_miss: expected_value) + expect(service).to receive(:execute).with(ref) end subject diff --git a/spec/requests/api/graphql/ci/config_variables_spec.rb b/spec/requests/api/graphql/ci/config_variables_spec.rb index 03916d8a81b707..34bb4ba6261ffd 100644 --- a/spec/requests/api/graphql/ci/config_variables_spec.rb +++ b/spec/requests/api/graphql/ci/config_variables_spec.rb @@ -68,7 +68,7 @@ it 'returns the CI variables for the config' do expect(service) .to receive(:execute) - .with(ref, fail_on_cache_miss: fail_on_cache_miss) + .with(ref) .and_call_original post_graphql(query, current_user: user) -- GitLab