Commit 237e3dca authored by Nick Thomas's avatar Nick Thomas

Merge branch 'bvl-disable-git-ssh-key-update' into 'master'

Add FF disable setting last_used_at on SSH access [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!54335
parents 1ee2e8ce e1460a0f
---
name: disable_ssh_key_used_tracking
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54335
rollout_issue_url: https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/889
milestone: '13.9'
type: development
group: group::source code
default_enabled: false
......@@ -37,6 +37,8 @@ module API
end
def update_last_used_at!
return if Feature.enabled?(:disable_ssh_key_used_tracking)
key&.update_last_used_at
end
......
......@@ -152,6 +152,10 @@ RSpec.describe API::Support::GitAccessActor do
end
describe '#update_last_used_at!' do
before do
stub_feature_flags(disable_ssh_key_used_tracking: false)
end
context 'when initialized with a User' do
let(:user) { build(:user) }
......@@ -170,6 +174,14 @@ RSpec.describe API::Support::GitAccessActor do
subject.update_last_used_at!
end
it 'does not update `last_used_at` when the functionality is disabled' do
stub_feature_flags(disable_ssh_key_used_tracking: true)
expect(key).not_to receive(:update_last_used_at)
subject.update_last_used_at!
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment