Commit f2dea668 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'dz-enable-integrated-error-tracking-by-default' into 'master'

Change default value for integrated error tracking

See merge request gitlab-org/gitlab!71088
parents 9b586af3 85f46cde
# frozen_string_literal: true
class ChangeDefaultForIntegratedErrorTracking < Gitlab::Database::Migration[1.0]
def up
change_column_default :project_error_tracking_settings, :integrated, from: false, to: true
end
def down
change_column_default :project_error_tracking_settings, :integrated, from: true, to: false
end
end
30c135ab62a57208160dd0949d6615f42af39117e25769d70a9658de5417b7e4
\ No newline at end of file
......@@ -17828,7 +17828,7 @@ CREATE TABLE project_error_tracking_settings (
encrypted_token_iv character varying,
project_name character varying,
organization_name character varying,
integrated boolean DEFAULT false NOT NULL
integrated boolean DEFAULT true NOT NULL
);
CREATE TABLE project_export_jobs (
......@@ -8,6 +8,7 @@ FactoryBot.define do
token { 'access_token_123' }
project_name { 'Sentry Project' }
organization_name { 'Sentry Org' }
integrated { false }
trait :disabled do
enabled { false }
......
......@@ -97,7 +97,9 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
within '.js-error-tracking-settings' do
click_button('Expand')
choose('cloud-hosted Sentry')
end
expect(page).to have_content('Sentry API URL')
expect(page.body).to include('Error Tracking')
expect(page).to have_button('Connect')
......@@ -140,8 +142,10 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
within '.js-error-tracking-settings' do
click_button('Expand')
choose('cloud-hosted Sentry')
check('Active')
end
check('Active')
fill_in('error-tracking-api-host', with: 'http://sentry.example.com')
fill_in('error-tracking-token', with: 'token')
......
......@@ -294,10 +294,10 @@ RSpec.describe Projects::Operations::UpdateService do
end
context 'without setting' do
it 'does not create a setting' do
expect(result[:status]).to eq(:error)
expect(project.reload.error_tracking_setting).to be_nil
it 'creates setting with default values' do
expect(result[:status]).to eq(:success)
expect(project.error_tracking_setting.enabled).to be_truthy
expect(project.error_tracking_setting.integrated).to be_truthy
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