diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index bc2c708ca42c784a74d3b14bd47e42a444bc9ec7..bc2d78190809603560ccb1d5d016c70d5c1c26a3 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -221,21 +221,6 @@ rspec system pg16: variables: DEBUG_GITLAB_TRANSACTION_STACK: "true" -rspec system pg16 classic-ui: - tags: - - $GLCI_MEDIUM_RUNNER_REQUIRED - extends: - - .rspec-base-pg16 - - .rspec-system-parallel - - .rails:rules:ee-only-system - variables: - DEBUG_GITLAB_TRANSACTION_STACK: "true" - GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED: "false" - rules: - - if: '$CI_MERGE_REQUEST_IID == null' - when: never - - !reference [.rails:rules:ee-only-system, rules] - rspec system pg16 vue3: extends: - rspec system pg16 @@ -1001,20 +986,6 @@ rspec-ee system pg16: - .rspec-ee-system-parallel - .rails:rules:ee-only-system -rspec-ee system pg16 classic-ui: - tags: - - $GLCI_MEDIUM_RUNNER_REQUIRED - extends: - - .rspec-ee-base-pg16 - - .rspec-ee-system-parallel - - .rails:rules:ee-only-system - variables: - GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED: "false" - rules: - - if: '$CI_MERGE_REQUEST_IID == null' - when: never - - !reference [.rails:rules:ee-only-system, rules] - rspec-ee system pg16 single-db: extends: - rspec-ee system pg16 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d80672e13f0ed214c140aa84c3a03a7688917b2b..446dbbc635b5eb167400624306df611564fdecde 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -132,7 +132,7 @@ def simple_sanitize(str) end def project_studio_enabled? - Users::ProjectStudio.new(current_user).enabled? + true end def body_data diff --git a/app/models/users/project_studio.rb b/app/models/users/project_studio.rb deleted file mode 100644 index 47b79996353b9ae67bd7bc3f9bb3a5fbd704be15..0000000000000000000000000000000000000000 --- a/app/models/users/project_studio.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -module Users - class ProjectStudio - # Convenience class method for checking if Project Studio is enabled for a user. - def self.enabled_for_user?(user) - new(user).enabled? - end - - def initialize(user) - @user = user - end - - def enabled? - return false if ENV["GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED"] == "false" - - Feature.enabled?(:paneled_view, user) - end - - private - - attr_reader :user - end -end diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb index 338861d589b2bbcd0f4eedeb8b510c46b46c5a5a..ebb29df728a2b3643c6f99d8e29b68eba2e6bcab 100644 --- a/app/policies/global_policy.rb +++ b/app/policies/global_policy.rb @@ -47,7 +47,7 @@ class GlobalPolicy < BasePolicy end condition(:project_studio_available, scope: :user, score: 0) do - ::Users::ProjectStudio.new(@user).enabled? + true end rule { bot & ~bot_with_quick_actions_permitted }.policy do diff --git a/config/feature_flags/beta/paneled_view.yml b/config/feature_flags/beta/paneled_view.yml deleted file mode 100644 index c1e3d745a86c24995da3945c1784cb76cab3c2dd..0000000000000000000000000000000000000000 --- a/config/feature_flags/beta/paneled_view.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: paneled_view -description: -feature_issue_url: -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/201307 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/work_items/574049 -milestone: '18.3' -group: group::project management -type: beta -default_enabled: true diff --git a/doc/user/interface_redesign.md b/doc/user/interface_redesign.md index 6086fa5f334c756f05cd9dd6aa1e14ea2b490ef2..07a28f9ede50702d14386333bfcf1e89dcdab86c 100644 --- a/doc/user/interface_redesign.md +++ b/doc/user/interface_redesign.md @@ -19,6 +19,7 @@ description: Learn about an upcoming redesign of GitLab user interface. Disabled by default. - [Enabled on GitLab.com, GitLab Self-Managed, and GitLab Dedicated](https://gitlab.com/gitlab-org/gitlab/-/work_items/574049) in GitLab 18.6. - Toggle [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/212303) in GitLab 18.7. +- [Generally available](https://gitlab.com/gitlab-org/gitlab/-/work_items/574049) in GitLab 18.8. Feature flag `paneled_view` removed. {{< /history >}} diff --git a/ee/spec/features/admin/admin_mode_spec.rb b/ee/spec/features/admin/admin_mode_spec.rb index 4db8a2fbf148a4acf3c39545e9421ca47f063cff..ab44b6f0c9701c004835348206198c50a49d3ea0 100644 --- a/ee/spec/features/admin/admin_mode_spec.rb +++ b/ee/spec/features/admin/admin_mode_spec.rb @@ -18,7 +18,7 @@ it 'can enter admin mode via admin button' do visit root_dashboard_path - find_by_testid('user-avatar-content').click if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + find_by_testid('user-avatar-content').click click_link 'Admin' wait_for_requests @@ -38,6 +38,7 @@ it 'can access admin dashboard without entering admin mode' do visit root_dashboard_path + expect(page).to have_link('Admin') click_link 'Admin' expect(page).to have_current_path(admin_root_path) @@ -53,6 +54,7 @@ it 'can access admin dashboard without entering admin mode' do visit root_dashboard_path + expect(page).to have_link('Admin') click_link 'Admin' expect(page).to have_current_path(admin_root_path) diff --git a/ee/spec/features/ai_sidepanel_spec.rb b/ee/spec/features/ai_sidepanel_spec.rb index 443626f8ae515e80aae92e3ecb81f4790d36ebf3..5e4296f319b5605430dddecfa91958e97bf6c104 100644 --- a/ee/spec/features/ai_sidepanel_spec.rb +++ b/ee/spec/features/ai_sidepanel_spec.rb @@ -32,141 +32,120 @@ allow(::Gitlab::Llm::TanukiBot).to receive_messages(chat_disabled_reason: nil, credits_available?: true) end - context 'when Project Studio IS NOT enabled' do - before do - # NOTE: We will stub all existing methods on Users::ProjectStudio to return false, to ensure that - # it always is disabled, regardless of how it may be refactored in the future. - project_studio_instance = instance_double(Users::ProjectStudio, enabled?: false) - allow(Users::ProjectStudio).to receive_messages(new: project_studio_instance, enabled_for_user?: false) - end + describe 'sidepanel visibility' do + it 'shows the AI sidepanel toggle and can expand' do + # Enable Agentic mode so sessions toggle appears + set_cookie('duo_agentic_mode_on', 'true') - it 'does not show AI sidepanel' do visit project_path(project) - expect(page).not_to have_css(ai_sidepanel_selector) + expect(page).to have_css(ai_sidepanel_selector) + + expect(page).not_to have_content("Sessions") + + within(ai_sidepanel_selector) do + find_by_testid(sessions_toggle_selector).click + end + + # Verify we're now in the agent sessions view + expect(page).to have_content("Sessions") end end - context 'when Project Studio IS enabled' do - before do - skip 'Test not applicable in classic UI' unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + describe 'agent sessions in sidepanel' do + let_it_be(:workflow1) do + create(:duo_workflows_workflow, + project: project, + user: user, + goal: 'Fix pipeline issues', + workflow_definition: 'issue_to_mr', + environment: :web) end - describe 'sidepanel visibility' do - it 'shows the AI sidepanel toggle and can expand' do - # Enable Agentic mode so sessions toggle appears - set_cookie('duo_agentic_mode_on', 'true') - - visit project_path(project) - - expect(page).to have_css(ai_sidepanel_selector) + let_it_be(:workflow2) do + create(:duo_workflows_workflow, + project: project, + user: user, + goal: 'Review code changes', + workflow_definition: 'code_review', + environment: :web) + end - expect(page).not_to have_content("Sessions") + before do + # Enable Agentic mode so sessions toggle appears + set_cookie('duo_agentic_mode_on', 'true') - within(ai_sidepanel_selector) do - find_by_testid(sessions_toggle_selector).click - end + visit project_path(project) - # Verify we're now in the agent sessions view - expect(page).to have_content("Sessions") + within(ai_sidepanel_selector) do + find_by_testid(sessions_toggle_selector).click end end - describe 'agent sessions in sidepanel' do - let_it_be(:workflow1) do - create(:duo_workflows_workflow, - project: project, - user: user, - goal: 'Fix pipeline issues', - workflow_definition: 'issue_to_mr', - environment: :web) - end + it 'displays the sessions list' do + expect(page).to have_content("Issue to mr ##{workflow1.id}") + expect(page).to have_content("Code review ##{workflow2.id}") + end - let_it_be(:workflow2) do - create(:duo_workflows_workflow, - project: project, - user: user, - goal: 'Review code changes', - workflow_definition: 'code_review', - environment: :web) - end + it 'navigates to session details when clicked' do + expect(page).not_to have_content('Activity') + expect(page).not_to have_content('Details') - before do - # Enable Agentic mode so sessions toggle appears - set_cookie('duo_agentic_mode_on', 'true') + expect(page).to have_selector('a[href*="/agent-sessions/"]') + find('a[href*="/agent-sessions/"]', match: :first).click - visit project_path(project) + expect(page).to have_content('Activity') + expect(page).to have_content('Details') - within(ai_sidepanel_selector) do - find_by_testid(sessions_toggle_selector).click - end - end - - it 'displays the sessions list' do - expect(page).to have_content("Issue to mr ##{workflow1.id}") - expect(page).to have_content("Code review ##{workflow2.id}") - end + expect(page).to have_selector('.gl-tab-nav-item.active', text: 'Activity') + expect(page).to have_no_content('GraphQL error:') + end - it 'navigates to session details when clicked' do - expect(page).not_to have_content('Activity') - expect(page).not_to have_content('Details') + it 'can view session details tab' do + find('a[href*="/agent-sessions/"]', match: :first).click - expect(page).to have_selector('a[href*="/agent-sessions/"]') - find('a[href*="/agent-sessions/"]', match: :first).click + click_link 'Details' - expect(page).to have_content('Activity') - expect(page).to have_content('Details') + expect(page).to have_content('Details') + expect(page).to have_content(project.name) + expect(page).to have_no_content('GraphQL error:') + end + end - expect(page).to have_selector('.gl-tab-nav-item.active', text: 'Activity') - expect(page).to have_no_content('GraphQL error:') - end + describe 'agent sessions empty state in sidepanel' do + before do + Ai::DuoWorkflows::Workflow.where(project: project, user: user).delete_all - it 'can view session details tab' do - find('a[href*="/agent-sessions/"]', match: :first).click + # Enable Agentic mode so sessions toggle appears + set_cookie('duo_agentic_mode_on', 'true') - click_link 'Details' + visit project_path(project) + end - expect(page).to have_content('Details') - expect(page).to have_content(project.name) - expect(page).to have_no_content('GraphQL error:') + it 'shows empty state when no sessions exist' do + within(ai_sidepanel_selector) do + find_by_testid(sessions_toggle_selector).click end + + expect(page).to have_content('No agent sessions yet', wait: 10) end - describe 'agent sessions empty state in sidepanel' do + context 'when duo features are disabled' do before do - Ai::DuoWorkflows::Workflow.where(project: project, user: user).delete_all - - # Enable Agentic mode so sessions toggle appears - set_cookie('duo_agentic_mode_on', 'true') - + project.project_setting.update!(duo_features_enabled: false) + allow(::Gitlab::Llm::TanukiBot).to receive(:chat_disabled_reason).and_return(:project) visit project_path(project) end - it 'shows empty state when no sessions exist' do + it 'prevents access to sessions tab' do within(ai_sidepanel_selector) do - find_by_testid(sessions_toggle_selector).click - end - - expect(page).to have_content('No agent sessions yet', wait: 10) - end - - context 'when duo features are disabled' do - before do - project.project_setting.update!(duo_features_enabled: false) - allow(::Gitlab::Llm::TanukiBot).to receive(:chat_disabled_reason).and_return(:project) - visit project_path(project) - end - - it 'prevents access to sessions tab' do - within(ai_sidepanel_selector) do - sessions_button = find_by_testid(sessions_toggle_selector) + sessions_button = find_by_testid(sessions_toggle_selector) - expect(sessions_button['aria-disabled']).to eq('true') + expect(sessions_button['aria-disabled']).to eq('true') - sessions_button.click + sessions_button.click - expect(page).not_to have_content('No agent sessions yet') - end + expect(page).not_to have_content('No agent sessions yet') end end end diff --git a/ee/spec/features/duo_chat/user_navigates_duo_chat_history_spec.rb b/ee/spec/features/duo_chat/user_navigates_duo_chat_history_spec.rb index 1742d3d64f67feb3aa9c848d62aa7d20869401e9..afc37df7adcd647dfb3a817060f1b7bf0a94f259 100644 --- a/ee/spec/features/duo_chat/user_navigates_duo_chat_history_spec.rb +++ b/ee/spec/features/duo_chat/user_navigates_duo_chat_history_spec.rb @@ -46,7 +46,6 @@ def close_popover allow(::Gitlab::Llm::TanukiBot).to receive(:credits_available?).and_return(true) sign_in(user) - skip 'Test not applicable in classic UI' unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout visit project_path(project) open_duo_chat diff --git a/ee/spec/features/duo_chat/user_opens_duo_chat_spec.rb b/ee/spec/features/duo_chat/user_opens_duo_chat_spec.rb index 7ed16391bfe46e3acdadf70c1e3cfdef6a38c401..bbef8fe71e5979747fd2051bb117798bd6fa46ec 100644 --- a/ee/spec/features/duo_chat/user_opens_duo_chat_spec.rb +++ b/ee/spec/features/duo_chat/user_opens_duo_chat_spec.rb @@ -23,9 +23,6 @@ describe 'opening Duo Chat' do before do visit project_path(project) - - # close button for the popover - find_by_testid('close-button').click unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout end it 'shows the Duo Chat button' do @@ -36,37 +33,23 @@ find('button.js-tanuki-bot-chat-toggle').click wait_for_requests - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).to have_css('.ai-panel') - else - expect(page).to have_css('.duo-chat-container') - end + expect(page).to have_css('.ai-panel') end end describe 'closing Duo Chat' do before do visit project_path(project) - find_by_testid('close-button').click unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find('button.js-tanuki-bot-chat-toggle').click wait_for_requests end it 'closes Duo Chat drawer when close button is clicked' do - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - if has_testid?('duo-chat-promo-callout-popover', wait: 1) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - within_testid('duo-chat-promo-callout-popover') { find_by_testid('close-icon').click } - end + within_testid('duo-chat-promo-callout-popover') { find_by_testid('close-icon').click } - find_by_testid('content-container-collapse-button').click + find_by_testid('content-container-collapse-button').click - expect(page).not_to have_css('.ai-panel') - else - find_by_testid('chat-close-button').click - - expect(page).not_to have_css('.duo-chat-container') - end + expect(page).not_to have_css('.ai-panel') end end @@ -95,12 +78,7 @@ find_by_testid('rca-duo-button').click wait_for_requests - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).to have_css('.ai-panel') - else - expect(page).to have_css('.duo-chat-container') - end - + expect(page).to have_css('.ai-panel') expect(page).to have_content(/troubleshoot/i) end end diff --git a/ee/spec/features/epic_boards/epic_boards_sidebar_spec.rb b/ee/spec/features/epic_boards/epic_boards_sidebar_spec.rb index c111358aba69d49903d8187bf245b636ee53cd39..8e7370715f294814b835a564df4b5823749d167c 100644 --- a/ee/spec/features/epic_boards/epic_boards_sidebar_spec.rb +++ b/ee/spec/features/epic_boards/epic_boards_sidebar_spec.rb @@ -35,11 +35,7 @@ expect(page).to have_testid('work-item-drawer') - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - click_button 'Close panel' - else - click_button 'Close drawer' - end + click_button 'Close panel' expect(page).not_to have_testid('work-item-drawer') end diff --git a/ee/spec/features/learn_gitlab_spec.rb b/ee/spec/features/learn_gitlab_spec.rb index dc8439ac598ddd410d80970ff41c15c250cf428c..880cf655b01cee44b09c73c97dd26bd472a7169a 100644 --- a/ee/spec/features/learn_gitlab_spec.rb +++ b/ee/spec/features/learn_gitlab_spec.rb @@ -147,7 +147,7 @@ it 'shows the duo chat promo popover after a page refresh' do page.refresh - find_by_testid('ai-chat-toggle').click if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + find_by_testid('ai-chat-toggle').click expect(page).to have_selector('[data-testid="duo-chat-promo-callout-popover"]') end end @@ -162,7 +162,7 @@ end it 'shows the duo chat promo popover' do - find_by_testid('ai-chat-toggle').click if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + find_by_testid('ai-chat-toggle').click expect(page).to have_selector('[data-testid="duo-chat-promo-callout-popover"]') end diff --git a/ee/spec/features/projects/security/vulnerability_details_spec.rb b/ee/spec/features/projects/security/vulnerability_details_spec.rb index ecba877803b826515104af23c5395739230e1c41..e3496cf2da1aaf537fa4a7751cdf62aafdb65237 100644 --- a/ee/spec/features/projects/security/vulnerability_details_spec.rb +++ b/ee/spec/features/projects/security/vulnerability_details_spec.rb @@ -151,7 +151,6 @@ def visit_vulnerability_and_open_ai_dropdown(vulnerability) sign_in(user) visit vulnerability_url(vulnerability) - close_promotion_popover unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout # Open the dropdown click_button 'Explain or Resolve with AI' diff --git a/ee/spec/features/tanuki_bot_chat_spec.rb b/ee/spec/features/tanuki_bot_chat_spec.rb index 88c1068d6f058ddb421a85d637cd2d7b74c820f4..2abfc3dcecf78417f85f8faccbc20f0b903c7c2f 100644 --- a/ee/spec/features/tanuki_bot_chat_spec.rb +++ b/ee/spec/features/tanuki_bot_chat_spec.rb @@ -40,13 +40,7 @@ context "when opening the drawer from the breadcrumbs or side panel" do before do - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_by_testid('ai-chat-toggle').click - else - within_testid('top-bar') do - click_button('GitLab Duo Chat') - end - end + find_by_testid('ai-chat-toggle').click end it_behaves_like 'GitLab Duo drawer' @@ -81,13 +75,7 @@ context "when opening the drawer from the breadcrumbs or side panel" do before do - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_by_testid('ai-chat-toggle').click - else - within_testid('top-bar') do - click_button('GitLab Duo Chat') - end - end + find_by_testid('ai-chat-toggle').click end it_behaves_like 'GitLab Duo drawer' diff --git a/ee/spec/features/user_interacts_with_explore_duo_core_banner_spec.rb b/ee/spec/features/user_interacts_with_explore_duo_core_banner_spec.rb index 73bed308578725da30791c99b09fddfa8e4a24da..4be1513b2a6d00ae25bc8cffbeab6c258dcc2cd4 100644 --- a/ee/spec/features/user_interacts_with_explore_duo_core_banner_spec.rb +++ b/ee/spec/features/user_interacts_with_explore_duo_core_banner_spec.rb @@ -7,8 +7,6 @@ it 'dismisses the banner when clicking the close button' do expect(page).to have_content(banner_content) - close_promotion_popover unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - page.within('.explore-duo-core-banner') do find('.gl-banner-close').click # Need to wait for requests or else the queries from this request will get @@ -22,8 +20,6 @@ it 'dismisses the banner when clicking the CTA' do expect(page).to have_content(banner_content) - close_promotion_popover unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - page.within('.explore-duo-core-banner') do click_link 'Explore GitLab Duo Core' wait_for_all_requests diff --git a/ee/spec/features/work_items/issues/new/user_creates_issue_spec.rb b/ee/spec/features/work_items/issues/new/user_creates_issue_spec.rb index 9ec1436c9ca209feb0d599898a4435d889329c50..2645396375e061a14d20bf125d0caa39fb491347 100644 --- a/ee/spec/features/work_items/issues/new/user_creates_issue_spec.rb +++ b/ee/spec/features/work_items/issues/new/user_creates_issue_spec.rb @@ -57,8 +57,7 @@ end it 'has disabled GitLab Duo button' do - skip 'https://gitlab.com/gitlab-org/gitlab/-/issues/578218' if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).to have_button('GitLab Duo', disabled: true) + expect(find_by_testid('ai-chat-toggle')['aria-disabled']).to eq('true') end end end diff --git a/ee/spec/features/work_items/list/user_interacts_with_drawer_spec.rb b/ee/spec/features/work_items/list/user_interacts_with_drawer_spec.rb index 666a882be9b5002e9351229aaec57cd05c63cd29..c83c08786d9b7a0b9f6096ff7e68c8773df1b93b 100644 --- a/ee/spec/features/work_items/list/user_interacts_with_drawer_spec.rb +++ b/ee/spec/features/work_items/list/user_interacts_with_drawer_spec.rb @@ -71,161 +71,79 @@ end end - context 'when project studio is disabled' do - context 'if user is signed in as developer' do - let(:issuable_container) { '[data-testid="issuable-container"]' } + context 'if user is signed in as developer' do + let(:issuable_container) { '[data-testid="issuable-container"]' } - before_all do - group.add_developer(user) - end + before_all do + group.add_developer(user) + end - context 'when accessing work item from project work item list' do - before do - stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) + context 'when accessing work item from project work item list' do + before do + stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - sign_in(user) + sign_in(user) - visit project_work_items_path(project) - close_work_item_feedback_popover_if_present + visit project_work_items_path(project) + close_work_item_feedback_popover_if_present - first_card.click + first_card.click - wait_for_requests - end - - include_examples 'updates weight of a work item on the list' - include_examples 'updates health status of a work item on the list' - include_examples 'updates iteration of a work item on the list' + wait_for_requests end - context 'when accessing work item from group work item list' do - before do - stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - - sign_in(user) + include_examples 'updates weight of a work item on the list' + include_examples 'updates health status of a work item on the list' + include_examples 'updates iteration of a work item on the list' + end - visit group_work_items_path(group) - close_work_item_feedback_popover_if_present + context 'when accessing work item from group work item list' do + before do + stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - first_card.click + sign_in(user) - wait_for_requests - end + visit group_work_items_path(group) + close_work_item_feedback_popover_if_present - it_behaves_like 'work item drawer on the list page' + first_card.click - include_examples 'updates weight of a work item on the list' - include_examples 'updates health status of a work item on the list' - include_examples 'updates iteration of a work item on the list' + wait_for_requests end - context 'when accessing work item from group epics list' do - before do - stub_feature_flags(work_item_planning_view: false) - stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - - sign_in(user) - - visit group_epics_path(group) - close_work_item_feedback_popover_if_present + it_behaves_like 'work item drawer on the list page' - first_card.click - - wait_for_requests - end - - it_behaves_like 'work item drawer on the list page' do - let(:issue) { epic } - let(:label) { label_group } - let(:milestone) { milestone_group } - end - - it_behaves_like 'updates health status of a work item on the list' do - let(:issue) { epic } - end + context 'with quarantine', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/570546' do + include_examples 'updates weight of a work item on the list' end - end - end - context 'when project studio is enabled' do - before do - skip 'Test not applicable in classic UI' unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + include_examples 'updates health status of a work item on the list' + include_examples 'updates iteration of a work item on the list' end - context 'if user is signed in as developer' do - let(:issuable_container) { '[data-testid="issuable-container"]' } - - before_all do - group.add_developer(user) - end - - context 'when accessing work item from project work item list' do - before do - stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - - sign_in(user) + context 'when accessing work item from group epics list' do + before do + stub_feature_flags(work_item_planning_view: false) + stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - visit project_work_items_path(project) - close_work_item_feedback_popover_if_present + sign_in(user) - first_card.click + visit group_epics_path(group) + close_work_item_feedback_popover_if_present - wait_for_requests - end + first_card.click - include_examples 'updates weight of a work item on the list' - include_examples 'updates health status of a work item on the list' - include_examples 'updates iteration of a work item on the list' + wait_for_requests end - context 'when accessing work item from group work item list' do - before do - stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - - sign_in(user) - - visit group_work_items_path(group) - close_work_item_feedback_popover_if_present - - first_card.click - - wait_for_requests - end - - it_behaves_like 'work item drawer on the list page' - - context 'with quarantine', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/570546' do - include_examples 'updates weight of a work item on the list' - end - - include_examples 'updates health status of a work item on the list' - include_examples 'updates iteration of a work item on the list' + it_behaves_like 'work item drawer on the list page' do + let(:issue) { epic } + let(:label) { label_group } + let(:milestone) { milestone_group } end - context 'when accessing work item from group epics list' do - before do - stub_feature_flags(work_item_planning_view: false) - stub_licensed_features(epics: true, issuable_health_status: true, iterations: true) - - sign_in(user) - - visit group_epics_path(group) - close_work_item_feedback_popover_if_present - - first_card.click - - wait_for_requests - end - - it_behaves_like 'work item drawer on the list page' do - let(:issue) { epic } - let(:label) { label_group } - let(:milestone) { milestone_group } - end - - it_behaves_like 'updates health status of a work item on the list' do - let(:issue) { epic } - end + it_behaves_like 'updates health status of a work item on the list' do + let(:issue) { epic } end end end diff --git a/ee/spec/helpers/ee/nav_helper_spec.rb b/ee/spec/helpers/ee/nav_helper_spec.rb index 22b394eac531fb43a4a1a93b1ada60271c51b9e4..9128bb40a841770956d47f4c8b17b85fa830c212 100644 --- a/ee/spec/helpers/ee/nav_helper_spec.rb +++ b/ee/spec/helpers/ee/nav_helper_spec.rb @@ -30,41 +30,4 @@ end end end - - describe '#top_bar_duo_button_enabled?' do - before do - skip 'Test not applicable in new UI' if Users::ProjectStudio.enabled_for_user?(user) - end - - context 'when TanukiBot.show_breadcrumbs_entry_point? returns true' do - before do - allow(::Gitlab::Llm::TanukiBot).to receive(:show_breadcrumbs_entry_point?).with(user: user).and_return(true) - end - - it 'returns true' do - expect(helper).to be_top_bar_duo_button_enabled - end - end - - context 'when TanukiBot.show_breadcrumbs_entry_point? returns false' do - before do - allow(::Gitlab::Llm::TanukiBot).to receive(:show_breadcrumbs_entry_point?).with(user: user).and_return(false) - end - - it 'returns false' do - expect(helper).not_to be_top_bar_duo_button_enabled - end - end - - context 'when current_user is nil' do - before do - allow(helper).to receive(:current_user).and_return(nil) - allow(::Gitlab::Llm::TanukiBot).to receive(:show_breadcrumbs_entry_point?).with(user: nil).and_return(false) - end - - it 'returns false' do - expect(helper).not_to be_top_bar_duo_button_enabled - end - end - end end diff --git a/ee/spec/views/layouts/_page.html.haml_spec.rb b/ee/spec/views/layouts/_page.html.haml_spec.rb deleted file mode 100644 index d01cdb6c2839e374864d113488e4e90d3d78180d..0000000000000000000000000000000000000000 --- a/ee/spec/views/layouts/_page.html.haml_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'layouts/_page', feature_category: :global_search do - let_it_be(:user) { build_stubbed(:user) } - let_it_be(:project) { build_stubbed(:project) } - - describe 'EE tanuki_bot_chat' do - before do - skip 'Test not applicable in new UI' if Users::ProjectStudio.enabled_for_user?(user) - assign(:project, project) - allow(view).to receive_messages(current_user: user, current_user_mode: Gitlab::Auth::CurrentUserMode.new(user)) - end - - describe 'when project is nil' do - let_it_be(:project) { nil } - - it 'does not render #js-tanuki-bot-chat-app' do - render - - expect(rendered).not_to have_selector('#js-tanuki-bot-chat-app') - end - end - - describe 'when ::Gitlab::Llm::TanukiBot.enabled_for?(user) is true' do - before do - allow(::Gitlab::Llm::TanukiBot).to receive(:enabled_for?) - .with(user: user, container: nil).and_return(true) - end - - it 'renders #js-tanuki-bot-chat-app' do - render - - expect(rendered).to have_selector('#js-tanuki-bot-chat-app') - end - end - - describe 'when ::Gitlab::Llm::TanukiBot.enabled_for?(user) is false' do - before do - allow(::Gitlab::Llm::TanukiBot).to receive(:enabled_for?) - .with(user: user, container: nil).and_return(false) - end - - it 'does not render #js-tanuki-bot-chat-app' do - render - - expect(rendered).not_to have_selector('#js-tanuki-bot-chat-app') - end - end - end -end diff --git a/ee/spec/views/layouts/_tanuki_bot_chat.html.haml_spec.rb b/ee/spec/views/layouts/_tanuki_bot_chat.html.haml_spec.rb index fb312256000b2ed4268c8add3a9b2af1edb2fa08..a5900dee0ffdc7a762aa37dd2977e7494a631de1 100644 --- a/ee/spec/views/layouts/_tanuki_bot_chat.html.haml_spec.rb +++ b/ee/spec/views/layouts/_tanuki_bot_chat.html.haml_spec.rb @@ -73,40 +73,4 @@ expect(rendered).not_to have_css("#js-duo-agentic-chat-app[data-namespace-id]") end end - - describe 'Tanuki bot chat app' do - before do - skip 'Test not applicable in new UI' if Users::ProjectStudio.enabled_for_user?(current_user) - end - - it 'includes the root_namespace_id in the data attributes' do - render - - expect(rendered).to have_css("#js-tanuki-bot-chat-app[data-root-namespace-id='test_root_namespace_id']") - end - - context 'when AmazonQ is enabled' do - before do - allow(::Ai::AmazonQ).to receive(:enabled?).and_return(true) - end - - it 'sets the correct chat title' do - render - - expect(rendered).to have_css("#js-tanuki-bot-chat-app[data-chat-title='GitLab Duo Chat with Amazon Q']") - end - end - - context 'when AmazonQ is not enabled' do - before do - allow(::Ai::AmazonQ).to receive(:enabled?).and_return(false) - end - - it 'sets the correct chat title' do - render - - expect(rendered).to have_css("#js-tanuki-bot-chat-app[data-chat-title='GitLab Duo Chat']") - end - end - end end diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index ff4b60d2c0a13b0755e87ac082ae1f6d55885256..3dbcf1b23cbbcbee89b60b3de2c52bd85dfa93fd 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -106,13 +106,12 @@ def add_gon_feature_flags push_frontend_feature_flag(:glql_work_items, current_user) push_frontend_feature_flag(:glql_aggregation, current_user, type: :wip) push_frontend_feature_flag(:glql_typescript, current_user, type: :wip) - push_frontend_feature_flag(:paneled_view, current_user) push_frontend_feature_flag(:archive_group) push_frontend_feature_flag(:accessible_loading_button, current_user) push_frontend_feature_flag(:allow_iframes_in_markdown, current_user) # Expose the Project Studio user preference as if it were a feature flag - push_force_frontend_feature_flag(:project_studio_enabled, Users::ProjectStudio.new(current_user).enabled?) + push_force_frontend_feature_flag(:project_studio_enabled, true) end # Exposes the state of a feature flag to the frontend code. diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index ce24eda655840e6ef7690e2a229703471beea459..47bb36e72aa430a36d7f2ee714b753791bbda486 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -5,44 +5,26 @@ RSpec.describe 'Project issue boards sidebar', :js, feature_category: :portfolio_management do include BoardHelpers - let_it_be(:user) { create(:user) } - let_it_be(:group) { create(:group, :public) } + let_it_be(:user) { create(:user) } + let_it_be(:group) { create(:group, :public) } let_it_be(:project) { create(:project, :public, namespace: group) } - let_it_be(:board) { create(:board, project: project) } - let_it_be(:label) { create(:label, project: project, name: 'Label') } - let_it_be(:list) { create(:list, board: board, label: label, position: 0) } + let_it_be(:board) { create(:board, project: project) } + let_it_be(:label) { create(:label, project: project, name: 'Label') } + let_it_be(:list) { create(:list, board: board, label: label, position: 0) } let_it_be(:issue, reload: true) { create(:issue, project: project, relative_position: 1) } before do project.add_maintainer(user) - end - - context 'when project studio is enabled' do - before do - skip 'Test not applicable in classic UI' unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - sign_in(user) + sign_in(user) - visit project_board_path(project, board) - click_button 'Collapse sidebar' # otherwise panel opens as drawer and intercepts clicks + visit project_board_path(project, board) + click_button 'Collapse sidebar' # otherwise panel opens as drawer and intercepts clicks - wait_for_requests - end - - it_behaves_like 'work item drawer on the boards' + wait_for_requests end - context 'when project studio is disabled' do - before do - sign_in(user) - - visit project_board_path(project, board) - - wait_for_requests - end - - it_behaves_like 'work item drawer on the boards' - end + it_behaves_like 'work item drawer on the boards' def first_card find('[data-testid="board-list"]:nth-child(1)').first("[data-testid='board-card']") diff --git a/spec/features/global_search_spec.rb b/spec/features/global_search_spec.rb index 12b731a30dc6190966e98804fb8d43e835325966..69a7e714ea82e002adfe8a70438a4ce48495a102 100644 --- a/spec/features/global_search_spec.rb +++ b/spec/features/global_search_spec.rb @@ -17,11 +17,7 @@ shared_examples 'header search' do it 'renders search button' do - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).to have_selector('[data-testid="super-topbar-search-button"]') - else - expect(page).to have_selector('[data-testid="super-sidebar-search-button"]') - end + expect(page).to have_selector('[data-testid="super-topbar-search-button"]') end it 'opens search modal when shortcut "s" is pressed' do diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb index 49652a8c61a50fb91a2a1f8ed10a9cebda7268a8..f88db64430e250cbca04799070e66995d5743a4b 100644 --- a/spec/features/groups/milestone_spec.rb +++ b/spec/features/groups/milestone_spec.rb @@ -51,10 +51,6 @@ click_button 'Create milestone' - if page.has_css?('.milestone-sidebar .js-sidebar-expand', wait: 0) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find('.milestone-sidebar .js-sidebar-expand').click - end - expect(find('.start_date')).to have_content(Date.today.at_beginning_of_month.strftime('%b %-d, %Y')) end diff --git a/spec/features/incidents/incident_details_spec.rb b/spec/features/incidents/incident_details_spec.rb index f80df4e0b6ce964a35c10d36bacd880c4c6d2324..f04701bd88a5f451e90395145ea0bc701b5c88cd 100644 --- a/spec/features/incidents/incident_details_spec.rb +++ b/spec/features/incidents/incident_details_spec.rb @@ -216,10 +216,6 @@ def current_status end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(developer) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/merge_request/batch_comments_spec.rb b/spec/features/merge_request/batch_comments_spec.rb index 2c1c7069a2a39864984dff8547a329f6b39e5700..0ef17d6bc803956f7bff512872764d007048bcca 100644 --- a/spec/features/merge_request/batch_comments_spec.rb +++ b/spec/features/merge_request/batch_comments_spec.rb @@ -70,11 +70,7 @@ wait_for_requests # make sure comment form is in view - if Users::ProjectStudio.enabled_for_user?(user) - execute_script("document.querySelector('.js-static-panel-inner').scrollBy(0, 200)") - else - execute_script("window.scrollBy(0, 200)") - end + execute_script("document.querySelector('.js-static-panel-inner').scrollBy(0, 200)") write_comment(text: 'Testing update', button_text: 'Save comment') @@ -328,10 +324,6 @@ def write_reply_to_discussion(button_text: 'Start a review', text: 'Line is wron end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/merge_request/user_comments_on_diff_spec.rb b/spec/features/merge_request/user_comments_on_diff_spec.rb index 5e62427afdd8e7cb84cf77dd7e3be549e13c5f8d..35926408cfc28c9cc2d5d2b728171dca10c98d81 100644 --- a/spec/features/merge_request/user_comments_on_diff_spec.rb +++ b/spec/features/merge_request/user_comments_on_diff_spec.rb @@ -95,11 +95,7 @@ expect(find_in_page_or_panel_by_scrolling(".js-discussion-container", index: 0)).to have_content('Line is correct') # Check the same comments in the side-by-side view. - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - page.execute_script "document.querySelector('.js-static-panel-inner').scrollTo(0,0)" - else - execute_script "window.scrollTo(0,0)" - end + page.execute_script "document.querySelector('.js-static-panel-inner').scrollTo(0,0)" find('.js-show-diff-settings').click find_by_testid('listbox-item-parallel').click @@ -290,11 +286,7 @@ def add_comment(start_line) def find_in_page_or_panel_by_scrolling(selector, index: nil, **options) if index.nil? # rubocop:disable RSpec/AvoidConditionalStatements -- This is to make index param optional - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) else all(selector, **options)[index] end diff --git a/spec/features/merge_request/user_comments_on_whitespace_hidden_diff_spec.rb b/spec/features/merge_request/user_comments_on_whitespace_hidden_diff_spec.rb index 6fb95505c4598ab042d1ce45ea73013135d47e85..bd2b3b2dec54a960d2e3bb5a2d54e0947a8bff5f 100644 --- a/spec/features/merge_request/user_comments_on_whitespace_hidden_diff_spec.rb +++ b/spec/features/merge_request/user_comments_on_whitespace_hidden_diff_spec.rb @@ -167,10 +167,6 @@ def hide_whitespace end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb index 1ad7fec13f53d1f4f0733d42b32a9194cd46a91f..c87e4fe1ddd3504b2f19d04eaffc5562815deea6 100644 --- a/spec/features/merge_request/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb @@ -286,10 +286,6 @@ def assert_form_is_reset end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index a9bdfc34e5e82b3c3e308a0f2c8ab8fa786ca652..e12175a35f0311e0a8661201282dd511b903fb38 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -334,11 +334,7 @@ page.find('.discussion-next-btn').click end - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page.evaluate_script("document.querySelector('.js-static-panel-inner').scrollTop")).to be > 0 - else - expect(page.evaluate_script("window.pageYOffset")).to be > 0 - end + expect(page.evaluate_script("document.querySelector('.js-static-panel-inner').scrollTop")).to be > 0 end it 'updates updated text after resolving note' do diff --git a/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb b/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb index eab42268485df6a7baf57545cba2e4ed1631e580..f97b60bbe0100668a9e7c7f1b4d378800a2507a9 100644 --- a/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb +++ b/spec/features/merge_request/user_scrolls_to_note_on_load_spec.rb @@ -22,19 +22,11 @@ expect(page).to have_selector(fragment_id.to_s) expect(find(fragment_id).visible?).to eq true - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - panel_scroll_top = page.evaluate_script("document.querySelector('.js-static-panel-inner').scrollTop") - fragment_position_top = page.evaluate_script("Math.round(document.querySelector('#{fragment_id}').getBoundingClientRect().top + document.querySelector('.js-static-panel-inner').scrollTop)") - - expect(fragment_position_top).to be >= panel_scroll_top - expect(page.evaluate_script("document.querySelector('.js-static-panel-inner').scrollTop")).to be > 0 - else - page_scroll_y = page.evaluate_script("window.scrollY") - fragment_position_top = page.evaluate_script("Math.round(document.querySelector('#{fragment_id}').getBoundingClientRect().top + window.pageYOffset)") - - expect(fragment_position_top).to be >= page_scroll_y - expect(page.evaluate_script("window.pageYOffset")).to be > 0 - end + panel_scroll_top = page.evaluate_script("document.querySelector('.js-static-panel-inner').scrollTop") + fragment_position_top = page.evaluate_script("Math.round(document.querySelector('#{fragment_id}').getBoundingClientRect().top + document.querySelector('.js-static-panel-inner').scrollTop)") + + expect(fragment_position_top).to be >= panel_scroll_top + expect(page.evaluate_script("document.querySelector('.js-static-panel-inner').scrollTop")).to be > 0 end it 'renders un-collapsed notes with diff' do @@ -42,11 +34,7 @@ visit "#{project_merge_request_path(project, merge_request)}#{fragment_id}" - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - page.execute_script "document.querySelector('.js-static-panel-inner').scrollTo(0,0)" - else - page.execute_script "window.scrollTo(0,0)" - end + page.execute_script "document.querySelector('.js-static-panel-inner').scrollTo(0,0)" note_element = find(fragment_id) note_container = note_element.ancestor('.js-discussion-container') diff --git a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb index 8cb078f4c549405198f47ca73ed31a4c987d5df9..f4eb4ca27047f0d8ae708a22b3c7acff01615252 100644 --- a/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb +++ b/spec/features/merge_request/user_sees_avatar_on_diff_notes_spec.rb @@ -126,11 +126,7 @@ it 'removes avatar when note is deleted', quarantine: 'https://gitlab.com/gitlab-org/quality/test-failure-issues/-/issues/4253' do - if Users::ProjectStudio.enabled_for_user?(user) - open_more_actions_dropdown_in_panel(note) - else - open_more_actions_dropdown(note) - end + open_more_actions_dropdown_in_panel(note) accept_gl_confirm(button_text: 'Delete comment') do find(".note-row-#{note.id} .js-note-delete").click @@ -211,10 +207,6 @@ def find_line(line_code) end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/merge_request/user_sees_diff_spec.rb b/spec/features/merge_request/user_sees_diff_spec.rb index 2621f4c1057dedb9533aab9995515f4e31373893..6a29912b3e7e75048e30d4a5c428c44089003b6c 100644 --- a/spec/features/merge_request/user_sees_diff_spec.rb +++ b/spec/features/merge_request/user_sees_diff_spec.rb @@ -208,11 +208,7 @@ def create_file(branch_name, file_name, content) end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end end diff --git a/spec/features/merge_request/user_sees_versions_spec.rb b/spec/features/merge_request/user_sees_versions_spec.rb index d1d0e0805089ed3225aac597b213919e24ecd8c5..baec36d9051ddbf36e18c1ee7d619fca517365c9 100644 --- a/spec/features/merge_request/user_sees_versions_spec.rb +++ b/spec/features/merge_request/user_sees_versions_spec.rb @@ -30,11 +30,7 @@ line_code_element = page.find('.diff-grid-row', text: line_text) # scrolling to element's bottom is required in order for .hover action to work # otherwise, the element could be hidden underneath a sticky header - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - scroll_to_panel_elements_bottom(line_code_element) - else - scroll_to_elements_bottom(line_code_element) - end + scroll_to_panel_elements_bottom(line_code_element) line_code_element.hover find_by_testid('left-comment-button', visible: true).click @@ -286,10 +282,6 @@ end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb index 9b9db16f9a8a954077c83204dd6a23c0fefc7a4f..a411fa6c2173323694bce50196f415a2a3305809 100644 --- a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb +++ b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb @@ -22,9 +22,6 @@ def expect_suggestion_has_content(element, expected_changing_content, expected_s let(:user) { create(:user) } before do - # -- temporary Project Studio rollout - skip 'Test not applicable in classic UI' unless Users::ProjectStudio.enabled_for_user?(user) - project.add_maintainer(user) sign_in(user) @@ -451,10 +448,6 @@ def diffs_metadata end def find_in_page_or_panel_by_scrolling(selector, **options) - if Users::ProjectStudio.enabled_for_user?(user) - find_in_panel_by_scrolling(selector, **options) - else - find_by_scrolling(selector, **options) - end + find_in_panel_by_scrolling(selector, **options) end end diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb index b507e89ee3b7f8552b06b9698c789ed55aa6da6c..620e966938ed1fd619b9b2af87e85314e64ff65d 100644 --- a/spec/features/milestone_spec.rb +++ b/spec/features/milestone_spec.rb @@ -81,10 +81,6 @@ wait_for_requests - if page.has_css?('.milestone-sidebar .js-sidebar-expand', wait: 0) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find('.milestone-sidebar .js-sidebar-expand').click - end - within_testid('noTrackingPane') do expect(page).to have_content 'No estimate or time spent' end @@ -103,10 +99,6 @@ wait_for_requests - if page.has_css?('.milestone-sidebar .js-sidebar-expand', wait: 0) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - find('.milestone-sidebar .js-sidebar-expand').click - end - within_testid('spentOnlyPane') do expect(page).to have_content 'Spent: 3h' end diff --git a/spec/features/projects/ci/editor_spec.rb b/spec/features/projects/ci/editor_spec.rb index f920d618f98d02c5848f13a8a872a011aa3b270f..26e620eec7ec65fe7e86f770d44872c024f29aed 100644 --- a/spec/features/projects/ci/editor_spec.rb +++ b/spec/features/projects/ci/editor_spec.rb @@ -216,7 +216,7 @@ describe 'Branch Switcher' do def switch_to_branch(branch) # close button for the popover - find_by_testid('close-button').click if page.has_css?('[data-testid="close-button"]', wait: 0) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + find_by_testid('close-button').click within_testid 'branch-selector' do toggle_listbox select_listbox_item(branch, exact_text: true) diff --git a/spec/features/projects/repository/file_tree_browser_spec.rb b/spec/features/projects/repository/file_tree_browser_spec.rb index ea134d970bf313182a52975629260111894aedd1..483125bcbf3d736fc6a5bd96320dab5183ececa5 100644 --- a/spec/features/projects/repository/file_tree_browser_spec.rb +++ b/spec/features/projects/repository/file_tree_browser_spec.rb @@ -20,20 +20,12 @@ describe 'basic functionality' do it 'shows and hides the file tree browser' do - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).to have_css('.file-tree-browser-peek') - else - expect(page).to have_css('.file-tree-browser-expanded') - end + expect(page).to have_css('.file-tree-browser-peek') click_button 'Hide file tree browser' wait_for_requests - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).not_to have_css('.file-tree-browser-peek') - else - expect(page).not_to have_css('.file-tree-browser-expanded') - end + expect(page).not_to have_css('.file-tree-browser-peek') end it 'displays files and directories' do @@ -68,8 +60,8 @@ it 'expands parent directories when navigating directly to a nested file' do visit project_blob_path(project, "#{project.default_branch}/files/ruby/popen.rb") wait_for_requests - # File tree starts collapsed in Project Studio - click_button('Show file tree browser') if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout + # File tree starts collapsed + click_button('Show file tree browser') within('.file-tree-browser') do # Should auto-expand parent directories diff --git a/spec/features/projects/show/user_sees_collaboration_links_spec.rb b/spec/features/projects/show/user_sees_collaboration_links_spec.rb index e4364e296a96c4431abaacff070f73f5159d1eec..38dcb8d4d62ad664000c38038d331664964cc40b 100644 --- a/spec/features/projects/show/user_sees_collaboration_links_spec.rb +++ b/spec/features/projects/show/user_sees_collaboration_links_spec.rb @@ -18,9 +18,7 @@ def find_new_menu_toggle end def within_navigation_panel(&block) - # We search for .super-topbar to account for the Project Studio UI - selector = page.has_css?('.super-topbar') ? '.super-topbar' : '[data-testid="super-sidebar"]' # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - within(selector, &block) + within('.super-topbar', &block) end context 'with developer user' do diff --git a/spec/features/projects/snippets/user_updates_snippet_spec.rb b/spec/features/projects/snippets/user_updates_snippet_spec.rb index d8d3b204f34e632d33516196bc0cf4eb4566261f..e7ab39a4f35e95cd5cadd9ed84f14d00b2feacfe 100644 --- a/spec/features/projects/snippets/user_updates_snippet_spec.rb +++ b/spec/features/projects/snippets/user_updates_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Projects > Snippets > User updates a snippet', :js, feature_category: :source_code_management do +RSpec.describe 'Projects > Snippets > User updates a snippet', :js, feature_category: :source_code_management, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/580358' do include Features::SnippetSpecHelpers let_it_be(:user) { create(:user) } @@ -10,7 +10,6 @@ let_it_be(:snippet, reload: true) { create(:project_snippet, :repository, project: project, author: user) } before do - skip 'Test skipped when Project Studio enabled as page load can timeout - https://gitlab.com/gitlab-org/gitlab/-/issues/580358' if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout project.add_maintainer(user) sign_in(user) diff --git a/spec/features/projects/user_sees_sidebar_spec.rb b/spec/features/projects/user_sees_sidebar_spec.rb index 14b084f1e6034dffe902493e1acb5c0449e5c7f1..06f1cbd57451b16713ed03e58fe8e7dfd90ec337 100644 --- a/spec/features/projects/user_sees_sidebar_spec.rb +++ b/spec/features/projects/user_sees_sidebar_spec.rb @@ -19,27 +19,16 @@ expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :visible) find_by_testid('super-sidebar-collapse-button').click - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(find_by_testid('super-sidebar')[:class]).to include('super-sidebar-is-icon-only') - else - expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :hidden) - end + expect(find_by_testid('super-sidebar')[:class]).to include('super-sidebar-is-icon-only') end end shared_examples 'has a collapsed nav sidebar' do it 'has a collapsed nav sidebar on load that can be expanded' do - if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - expect(page).not_to have_selector('[data-testid="super-sidebar-collapse-button"]') - - find_by_testid('super-sidebar-toggle-button').click - expect(page).to have_selector('[data-testid="nav-container"]', visible: :visible) - else - expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :hidden) + expect(page).not_to have_selector('[data-testid="super-sidebar-collapse-button"]') - page.find('.js-super-sidebar-toggle-expand').click - expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :visible) - end + find_by_testid('super-sidebar-toggle-button').click + expect(page).to have_selector('[data-testid="nav-container"]', visible: :visible) end end diff --git a/spec/features/snippets/user_edits_snippet_spec.rb b/spec/features/snippets/user_edits_snippet_spec.rb index 43112ace16ec17754445c831c1cd87a6716f02c6..3a615b0496508b87d864aa29bcdee5cb84c348bd 100644 --- a/spec/features/snippets/user_edits_snippet_spec.rb +++ b/spec/features/snippets/user_edits_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User edits snippet', :js, feature_category: :source_code_management do +RSpec.describe 'User edits snippet', :js, feature_category: :source_code_management, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/580358' do include DropzoneHelper include Features::SnippetSpecHelpers @@ -21,7 +21,6 @@ end before do - skip 'Test skipped when Project Studio enabled as page load can timeout - https://gitlab.com/gitlab-org/gitlab/-/issues/580358' if Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout sign_in(user) visit edit_snippet_path(snippet) diff --git a/spec/features/work_items/list/user_interacts_with_drawer_spec.rb b/spec/features/work_items/list/user_interacts_with_drawer_spec.rb index cc2e6141d3fd932f473201ee6c1c0d9ff5e3782f..94500717236571e4378ea7c5893efcdcbe2907e8 100644 --- a/spec/features/work_items/list/user_interacts_with_drawer_spec.rb +++ b/spec/features/work_items/list/user_interacts_with_drawer_spec.rb @@ -13,142 +13,68 @@ let_it_be(:label) { create(:label, project: project, title: "testing-label") } let_it_be(:milestone) { create(:milestone, project: project) } - context 'when project studio is enabled' do - before do - skip 'Test not applicable in classic UI' unless Users::ProjectStudio.enabled_for_user?(user) # rubocop:disable RSpec/AvoidConditionalStatements -- temporary Project Studio rollout - end - - context 'if user is signed in as developer' do - let(:issuable_container) { '[data-testid="issuable-container"]' } - - before_all do - project.add_developer(user) - end - - context 'when accessing work item from project work item list' do - before do - sign_in(user) + context 'if user is signed in as developer' do + let(:issuable_container) { '[data-testid="issuable-container"]' } - visit project_work_items_path(project) - - first_card.click - - wait_for_requests - end + before_all do + project.add_developer(user) + end - it_behaves_like 'work item drawer on the list page' + context 'when accessing work item from project work item list' do + before do + sign_in(user) - it 'updates start and due date on the list', :aggregate_failures do - within_testid('work-item-drawer') do - within_testid 'work-item-due-dates' do - click_button 'Edit' - fill_in 'Start', with: '2025-01-01' - fill_in 'Due', with: '2025-12-31' - end + visit project_work_items_path(project) - close_drawer - end + first_card.click - expect(first_card).to have_content('Jan 1 – Dec 31, 2025') - end + wait_for_requests end - context 'when accessing work item from project issue list' do - before do - stub_feature_flags(work_item_planning_view: false) - - sign_in(user) - - visit project_issues_path(project) + it_behaves_like 'work item drawer on the list page' - first_card.click - - wait_for_requests - end - - it_behaves_like 'work item drawer on the list page' - - it 'updates start and due date on the list', :aggregate_failures do - within_testid('work-item-drawer') do - within_testid 'work-item-due-dates' do - click_button 'Edit' - fill_in 'Start', with: '2025-01-01' - fill_in 'Due', with: '2025-12-31' - end - - close_drawer + it 'updates start and due date on the list', :aggregate_failures do + within_testid('work-item-drawer') do + within_testid 'work-item-due-dates' do + click_button 'Edit' + fill_in 'Start', with: '2025-01-01' + fill_in 'Due', with: '2025-12-31' end - expect(first_card).to have_content('Jan 1 – Dec 31, 2025') + close_drawer end - end - end - end - - context 'when project studio is disabled' do - context 'if user is signed in as developer' do - let(:issuable_container) { '[data-testid="issuable-container"]' } - before_all do - project.add_developer(user) + expect(first_card).to have_content('Jan 1 – Dec 31, 2025') end + end - context 'when accessing work item from project work item list' do - before do - sign_in(user) - - visit project_work_items_path(project) - - first_card.click - - wait_for_requests - end + context 'when accessing work item from project issue list' do + before do + stub_feature_flags(work_item_planning_view: false) - it_behaves_like 'work item drawer on the list page' + sign_in(user) - it 'updates start and due date on the list', :aggregate_failures do - within_testid('work-item-drawer') do - within_testid 'work-item-due-dates' do - click_button 'Edit' - fill_in 'Start', with: '2025-01-01' - fill_in 'Due', with: '2025-12-31' - end + visit project_issues_path(project) - close_drawer - end + first_card.click - expect(first_card).to have_content('Jan 1 – Dec 31, 2025') - end + wait_for_requests end - context 'when accessing work item from project issue list' do - before do - stub_feature_flags(work_item_planning_view: false) - - sign_in(user) - - visit project_issues_path(project) + it_behaves_like 'work item drawer on the list page' - first_card.click - - wait_for_requests - end - - it_behaves_like 'work item drawer on the list page' - - it 'updates start and due date on the list', :aggregate_failures do - within_testid('work-item-drawer') do - within_testid 'work-item-due-dates' do - click_button 'Edit' - fill_in 'Start', with: '2025-01-01' - fill_in 'Due', with: '2025-12-31' - end - - close_drawer + it 'updates start and due date on the list', :aggregate_failures do + within_testid('work-item-drawer') do + within_testid 'work-item-due-dates' do + click_button 'Edit' + fill_in 'Start', with: '2025-01-01' + fill_in 'Due', with: '2025-12-31' end - expect(first_card).to have_content('Jan 1 – Dec 31, 2025') + close_drawer end + + expect(first_card).to have_content('Jan 1 – Dec 31, 2025') end end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index ecd431ca322ffcc4352378b82f4d9a7abd4bd4cf..4723714d5ace1c4ad96b85233268ce824b6d29d4 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -512,22 +512,6 @@ def expect_autocomplete_data_sources_to_contain(object, noteable_type, source_ke end end - describe '#project_studio_enabled?' do - let(:user) { build(:user) } - - before do - allow(helper).to receive_messages(current_user: user, cookies: { studio: 'true' }) - end - - it 'calls ProjectStudio#enabled?' do - expect_next_instance_of(Users::ProjectStudio, user) do |studio| - expect(studio).to receive(:enabled?) - end - - helper.project_studio_enabled? - end - end - describe '#body_data' do context 'when @project is not set' do it 'does not include project data in the body data elements' do diff --git a/spec/models/users/project_studio_spec.rb b/spec/models/users/project_studio_spec.rb deleted file mode 100644 index 6f041e24673faff004e4a4817a180697fa78a23f..0000000000000000000000000000000000000000 --- a/spec/models/users/project_studio_spec.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Users::ProjectStudio, feature_category: :user_profile do - using RSpec::Parameterized::TableSyntax - - let_it_be(:user) { create(:user) } - - describe "sanity check that project studio is default enabled" do - before do - # -- temporary Project Studio rollout - skip 'Test not applicable in classic UI' if ENV["GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED"] == "false" - end - - it "passes", quarantine: 'https://gitlab.com/gitlab-org/quality/test-failure-issues/-/issues/17820' do - expect(described_class.new(user).enabled?).to be(true) - expect(described_class.enabled_for_user?(user)).to be(true) - end - end - - describe '#enabled?' do - context 'when user is nil' do - context 'when the Project Studio is not available' do - before do - stub_feature_flags(paneled_view: false) - end - - it 'returns `false`' do - expect(described_class.new(nil).enabled?).to be false - end - end - - context 'when the Project Studio is available' do - before do - stub_feature_flags(paneled_view: true) - end - - it 'returns `true`' do - expect(described_class.new(nil).enabled?).to be true - end - end - end - - context 'when user is present' do - let(:project_studio) { described_class.new(user) } - - context 'when the Project Studio is not available' do - before do - stub_feature_flags(paneled_view: false) - stub_env('GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED', 'false') - end - - it 'returns `false`' do - expect(project_studio.enabled?).to be false - end - end - - context 'when the Project Studio is available' do - before do - stub_feature_flags(paneled_view: true) - end - - it 'returns true' do - expect(project_studio.enabled?).to be true - end - end - end - end - - describe '#enabled? with GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED set to false' do - before do - stub_env('GLCI_OVERRIDE_PROJECT_STUDIO_ENABLED', 'false') - end - - context 'when user is nil' do - it 'returns false' do - expect(described_class.new(nil).enabled?).to be false - end - end - - context 'when user is present' do - where( - :paneled_view_flag, - :expected_result - ) do - false | false - true | false - end - - with_them do - before do - stub_feature_flags(paneled_view: paneled_view_flag) - end - - it 'returns expected result' do - expect(described_class.new(user).enabled?).to be expected_result - end - end - end - end -end diff --git a/spec/policies/global_policy_spec.rb b/spec/policies/global_policy_spec.rb index 22793569a98a4082142d01f9ac69d7d91626bddb..f4ce191e0e7b29f2fc2553def4c3be4c81c6ad0f 100644 --- a/spec/policies/global_policy_spec.rb +++ b/spec/policies/global_policy_spec.rb @@ -659,25 +659,7 @@ end describe 'enable_project_studio' do - context 'when ProjectStudio is available' do - before do - allow_next_instance_of(Users::ProjectStudio) do |instance| - allow(instance).to receive(:enabled?).and_return(true) - end - end - - it { is_expected.to be_allowed(:enable_project_studio) } - end - - context 'when ProjectStudio is not available' do - before do - allow_next_instance_of(Users::ProjectStudio) do |instance| - allow(instance).to receive(:enabled?).and_return(false) - end - end - - it { is_expected.to be_disallowed(:enable_project_studio) } - end + it { is_expected.to be_allowed(:enable_project_studio) } end describe 'log in' do diff --git a/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb b/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb index 2af7b1fea90a44886168b9408f438fd1787c8699..4e7f6bc0329745eb261431b7a7cb52e0eadb6bfb 100644 --- a/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb +++ b/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb @@ -2,11 +2,7 @@ RSpec.shared_examples 'comment on merge request file' do it 'adds a comment' do - if Users::ProjectStudio.enabled_for_user?(user) - click_diff_line(find_in_panel_by_scrolling("[id='#{sample_commit.line_code}']")) - else - click_diff_line(find_by_scrolling("[id='#{sample_commit.line_code}']")) - end + click_diff_line(find_in_panel_by_scrolling("[id='#{sample_commit.line_code}']")) page.within('.js-discussion-note-form') do fill_in(:note_note, with: 'Line is wrong') diff --git a/spec/views/layouts/application.html.haml_spec.rb b/spec/views/layouts/application.html.haml_spec.rb index 72fb38b77c14aec47e84bf4610f71a029477a6c3..5077e018f9e6aa94819bafdc4d7db129838e1fba 100644 --- a/spec/views/layouts/application.html.haml_spec.rb +++ b/spec/views/layouts/application.html.haml_spec.rb @@ -46,11 +46,9 @@ end end - context 'when user has `project studio` feature enabled' do - it 'renders the new global topbar' do - render - expect(rendered).to include('super-topbar') - end + it 'renders the new global topbar' do + render + expect(rendered).to include('super-topbar') end end diff --git a/spec/views/profiles/preferences/show.html.haml_spec.rb b/spec/views/profiles/preferences/show.html.haml_spec.rb index 8fbe203b3295de3040c7cbbcf94314655f967afb..6ba5984946ee2a10bb179ca8f32d5e3f2f8cfd65 100644 --- a/spec/views/profiles/preferences/show.html.haml_spec.rb +++ b/spec/views/profiles/preferences/show.html.haml_spec.rb @@ -22,17 +22,6 @@ end end - context 'navigation theme' do - before do - skip 'Test not applicable in new UI' if Users::ProjectStudio.enabled_for_user?(user) - render - end - - it 'has an id for anchoring' do - expect(rendered).to have_css('#navigation-theme') - end - end - context 'syntax highlighting theme' do before do render