From 58e354e44faae789eb8f40efc210af0149af0d37 Mon Sep 17 00:00:00 2001 From: Alper Akgun Date: Wed, 3 Sep 2025 18:48:18 +0300 Subject: [PATCH] Fix failing duo_workflow specs by using utils uuidv7 --- .../tasks/gitlab/duo_workflow/duo_workflow.rake | 6 +++--- .../gitlab/duo_workflow/duo_workflow_spec.rb | 17 ++++++----------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake b/ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake index ada477bbc20c93..ba2decd39d18e7 100644 --- a/ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake +++ b/ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake @@ -37,7 +37,7 @@ namespace :gitlab do # Create checkpoint JSONB data checkpoint_data = { "v" => 1, - "id" => SecureRandom.uuid_v7, + "id" => Gitlab::Utils.uuid_v7, "ts" => timestamp, "pending_sends" => [], "versions_seen" => { @@ -132,8 +132,8 @@ namespace :gitlab do } { - parent_ts: step > 0 ? SecureRandom.uuid_v7 : nil, - thread_ts: SecureRandom.uuid_v7, + parent_ts: step > 0 ? Gitlab::Utils.uuid_v7 : nil, + thread_ts: Gitlab::Utils.uuid_v7, checkpoint: checkpoint_data, metadata: metadata } diff --git a/ee/spec/tasks/gitlab/duo_workflow/duo_workflow_spec.rb b/ee/spec/tasks/gitlab/duo_workflow/duo_workflow_spec.rb index d9a48aedf3c573..fd8e2d756fe671 100644 --- a/ee/spec/tasks/gitlab/duo_workflow/duo_workflow_spec.rb +++ b/ee/spec/tasks/gitlab/duo_workflow/duo_workflow_spec.rb @@ -82,13 +82,12 @@ ) end - it 'creates checkpoints for each workflow', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/560512' do + it 'creates checkpoints for each workflow' do expect { run_rake_task('gitlab:duo_workflow:populate', '5', '2') } .to change { Ai::DuoWorkflows::Checkpoint.count }.by_at_least(5) end - it 'creates checkpoints with valid attributes', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/560512' do + it 'creates checkpoints with valid attributes' do run_rake_task('gitlab:duo_workflow:populate', '3', '1') checkpoint = Ai::DuoWorkflows::Checkpoint.last @@ -119,8 +118,7 @@ ) end - context 'when checkpoint creation based on workflow status', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/560512' do + context 'when checkpoint creation based on workflow status' do it 'creates checkpoints with correct status progression for different workflow states' do run_rake_task('gitlab:duo_workflow:populate', '10', '5') @@ -157,8 +155,7 @@ end end - it 'creates checkpoints with valid UI chat log entries', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/560512' do + it 'creates checkpoints with valid UI chat log entries' do run_rake_task('gitlab:duo_workflow:populate', '2', '1') checkpoint = Ai::DuoWorkflows::Checkpoint.last @@ -177,8 +174,7 @@ expect(ui_chat_log[6]['message_type']).to eq('workflow_end') end - it 'creates checkpoints with workflow goal referenced in chat log', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/560512' do + it 'creates checkpoints with workflow goal referenced in chat log' do run_rake_task('gitlab:duo_workflow:populate', '1', '1') workflow = Ai::DuoWorkflows::Workflow.last @@ -191,8 +187,7 @@ end end - it 'uses default values when no arguments provided', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/560512' do + it 'uses default values when no arguments provided' do expect { run_rake_task('gitlab:duo_workflow:populate') } .to change { Ai::DuoWorkflows::Workflow.count }.by(50) .and change { Ai::DuoWorkflows::Checkpoint.count }.by_at_least(50) -- GitLab