Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-11-02 09:09:38 +00:00
parent 96100bc70c
commit aa84824d04
19 changed files with 55 additions and 246 deletions

View File

@ -96,8 +96,6 @@ Capybara/TestidFinders:
- 'spec/features/nav/new_nav_callout_spec.rb'
- 'spec/features/nav/new_nav_toggle_spec.rb'
- 'spec/features/nav/pinned_nav_items_spec.rb'
- 'spec/features/nav/top_nav_responsive_spec.rb'
- 'spec/features/nav/top_nav_spec.rb'
- 'spec/features/populate_new_pipeline_vars_with_params_spec.rb'
- 'spec/features/profile_spec.rb'
- 'spec/features/profiles/account_spec.rb'

View File

@ -43,6 +43,8 @@ class ProjectsController < Projects::ApplicationController
push_frontend_feature_flag(:explain_code_chat, current_user)
push_frontend_feature_flag(:service_desk_custom_email, @project)
push_frontend_feature_flag(:issue_email_participants, @project)
# TODO: We need to remove the FF eventually when we rollout page_specific_styles
push_frontend_feature_flag(:page_specific_styles, current_user)
push_licensed_feature(:file_locks) if @project.present? && @project.licensed_feature_available?(:file_locks)
push_licensed_feature(:security_orchestration_policies) if @project.present? && @project.licensed_feature_available?(:security_orchestration_policies)
push_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?)

View File

@ -70,7 +70,7 @@ module Emails
setup_issue_mail(issue_id, recipient_id)
@label_names = label_names
@labels_url = project_labels_url(@project)
@labels_url = project_labels_url(@project, subscribed: true)
mail_answer_thread(
@issue,
issue_thread_options(

View File

@ -65,7 +65,7 @@ module Emails
setup_merge_request_mail(merge_request_id, recipient_id)
@label_names = label_names
@labels_url = project_labels_url(@project)
@labels_url = project_labels_url(@project, subscribed: true)
mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, reason))
end

View File

@ -358,7 +358,7 @@ class NotificationService
def review_requested_of_merge_request(merge_request, current_user, reviewer)
recipients = NotificationRecipients::BuildService.build_requested_review_recipients(merge_request, current_user, reviewer)
deliver_option = review_request_deliver_options(merge_request.project, reviewer)
deliver_option = review_request_deliver_options(merge_request.project)
recipients.each do |recipient|
mailer
@ -975,7 +975,7 @@ class NotificationService
{}
end
def review_request_deliver_options(project, user)
def review_request_deliver_options(project)
# Overridden in EE
{}
end

View File

@ -2,10 +2,6 @@
- site_name = _('GitLab')
- omit_og = sign_in_with_redirect?
-# This is a temporary place for the page specific style migrations to be included on all pages like page_specific_files
- if Feature.disabled?(:page_specific_styles, current_user)
- add_page_specific_style('page_bundles/projects')
%head{ omit_og ? { } : { prefix: "og: http://ogp.me/ns#" } }
%meta{ charset: "utf-8" }
%meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' }

View File

@ -1,17 +1,18 @@
- page_classes = page_class.push(@html_class).flatten.compact
!!! 5
%html{ lang: I18n.locale, class: page_classes }
%html.gl-h-full{ lang: I18n.locale, class: page_classes }
= render "layouts/head"
%body{ data: body_data, class: system_message_class }
%body.gl-h-full{ data: body_data, class: system_message_class }
= header_message
= render 'peek/bar'
= render 'layouts/published_experiments'
= render "layouts/header/empty"
.layout-page
.layout-page.gl-h-full.borderless.gl-display-flex.gl-flex-wrap
.content-wrapper.gl-pt-6{ class: 'gl-md-pt-11!' }
%div{ class: container_class }
%main#content-body.content
= render "layouts/flash" unless @hide_flash
= yield
= yield :footer
= footer_message

View File

@ -169,19 +169,34 @@ Nesting of components is not possible. For example:
## Release a component
To create a release for a CI/CD component, use either:
To create a release for a CI/CD component, use the [`release`](../yaml/index.md#release)
keyword in a CI/CD pipeline.
- The [`release`](../yaml/index.md#release) keyword in a CI/CD pipeline. Like in the
[component testing example](#test-the-component), you can set a component to automatically
be released after all tests pass in pipelines for new tags.
- The [UI for creating a release](../../user/project/releases/index.md#create-a-release).
For example:
All released versions of the components are displayed in the [CI/CD Catalog](catalog.md)
page for the given resource, providing users with information about official releases.
```yaml
create-release:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+/
script: echo "Creating release $CI_COMMIT_TAG"
release:
tag_name: $CI_COMMIT_TAG
description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH"
```
In this example, the job runs only for tags formatted as `v` + version number.
If all previous jobs succeed, the release is created.
Like in the [component testing example](#test-the-component), you can set a component to automatically
be released after all tests pass in pipelines for new tags.
All released versions of the components repositories are displayed in the [CI/CD Catalog](catalog.md),
providing users with information about official releases.
Components [can be used](#use-a-component-in-a-cicd-configuration) without being released,
but only with a commit SHA or a branch name. To enable the use of tags or the `~latest` version keyword,
you must create a release.
by using the commit SHA or ref. However, the `~latest` version keyword can only be used with released tags.
## Use a component in a CI/CD configuration

View File

@ -154,7 +154,11 @@ developers must familiarize themselves with our [Deprecation and Removal process
Breaking changes are:
- Removing or renaming a field, argument, enum value, or mutation.
- Changing the type of a field, argument or enum value.
- Changing the type or type name of an argument. This is because the type of an argument
is declared by the client when [using variables](https://graphql.org/learn/queries/#variables),
and queries with the old type name would be rejected by the API.
- Changing the _scalar type_ of a field or enum value. Object types can be changed so long as all
scalar type fields of the object remain the same.
- Raising the [complexity](#max-complexity) of a field or complexity multipliers in a resolver.
- Changing a field from being _not_ nullable (`null: false`) to nullable (`null: true`), as
discussed in [Nullable fields](#nullable-fields).

View File

@ -117,6 +117,9 @@ For example, use any of these trigger words to close the Jira issue `PROJECT-1`:
The commit or merge request must target your project's [default branch](../../user/project/repository/branches/default.md).
You can change your project's default branch in [project settings](../../user/project/settings/index.md).
When your branch name matches the Jira issue ID, `Closes <JIRA-ID>` is automatically appended to your existing merge request template.
If you do not want to close the issue, [disable automatic issue closing](../../user/project/issues/managing_issues.md#disable-automatic-issue-closing).
### Use case for closing issues
Consider this example:

View File

@ -12,8 +12,8 @@ RSpec.describe 'Issues > User uses quick actions', :js, feature_category: :team_
context "issuable common quick actions" do
let(:new_url_opts) { {} }
let(:maintainer) { create(:user, :no_super_sidebar) }
let(:project) { create(:project, :public) }
let(:maintainer) { create(:user) }
let_it_be(:project) { create(:project, :public) }
let!(:label_bug) { create(:label, project: project, title: 'bug') }
let!(:label_feature) { create(:label, project: project, title: 'feature') }
let!(:milestone) { create(:milestone, project: project, title: 'ASAP') }
@ -25,7 +25,7 @@ RSpec.describe 'Issues > User uses quick actions', :js, feature_category: :team_
end
describe 'issue-only commands' do
let(:user) { create(:user, :no_super_sidebar) }
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository) }
let(:issue) { create(:issue, project: project, due_date: Date.new(2016, 8, 28)) }

View File

@ -1,101 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'top nav responsive', :js, feature_category: :navigation do
include MobileHelpers
include Features::InviteMembersModalHelpers
let_it_be(:user) { create(:user, :no_super_sidebar) }
before do
sign_in(user)
resize_screen_xs
end
context 'when outside groups and projects' do
before do
visit explore_projects_path
end
context 'when menu is closed' do
it 'has page content and hides responsive menu', :aggregate_failures do
expect(page).to have_css('.page-title', text: 'Explore projects')
expect(page).to have_link('Homepage', id: 'logo')
expect(page).to have_no_css('.top-nav-responsive')
end
end
context 'when menu is opened' do
before do
click_button('Menu')
end
it 'hides everything and shows responsive menu', :aggregate_failures do
expect(page).to have_no_css('.page-title', text: 'Explore projects')
expect(page).to have_no_link('Homepage', id: 'logo')
within '.top-nav-responsive' do
expect(page).to have_link(nil, href: search_path)
expect(page).to have_button('Projects')
expect(page).to have_button('Groups')
expect(page).to have_link('Your work', href: dashboard_projects_path)
expect(page).to have_link('Explore', href: explore_projects_path)
end
end
it 'has new dropdown', :aggregate_failures do
create_new_button.click
expect(page).to have_link('New project', href: new_project_path)
expect(page).to have_link('New group', href: new_group_path)
expect(page).to have_link('New snippet', href: new_snippet_path)
end
end
end
context 'when inside a project' do
let_it_be(:project) { create(:project).tap { |record| record.add_owner(user) } }
before do
visit project_path(project)
end
it 'the add menu contains invite members dropdown option and opens invite modal' do
invite_members_from_menu
page.within invite_modal_selector do
expect(page).to have_content("You're inviting members to the #{project.name} project")
end
end
end
context 'when inside a group' do
let_it_be(:group) { create(:group).tap { |record| record.add_owner(user) } }
before do
visit group_path(group)
end
it 'the add menu contains invite members dropdown option and opens invite modal' do
invite_members_from_menu
page.within invite_modal_selector do
expect(page).to have_content("You're inviting members to the #{group.name} group")
end
end
end
def invite_members_from_menu
click_button('Menu')
create_new_button.click
click_button('Invite members')
end
def create_new_button
find('[data-testid="plus-icon"]')
end
end

View File

@ -1,51 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'top nav responsive', :js, feature_category: :navigation do
include Features::InviteMembersModalHelpers
let_it_be(:user) { create(:user, :no_super_sidebar) }
before do
sign_in(user)
end
context 'when inside a project' do
let_it_be(:project) { create(:project).tap { |record| record.add_owner(user) } }
before do
visit project_path(project)
end
it 'the add menu contains invite members dropdown option and opens invite modal' do
invite_members_from_menu
page.within invite_modal_selector do
expect(page).to have_content("You're inviting members to the #{project.name} project")
end
end
end
context 'when inside a group' do
let_it_be(:group) { create(:group).tap { |record| record.add_owner(user) } }
before do
visit group_path(group)
end
it 'the add menu contains invite members dropdown option and opens invite modal' do
invite_members_from_menu
page.within invite_modal_selector do
expect(page).to have_content("You're inviting members to the #{group.name} group")
end
end
end
def invite_members_from_menu
find('[data-testid="new-menu-toggle"]').click
click_link('Invite members')
end
end

View File

@ -1,25 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'top nav tooltips', :js, feature_category: :navigation do
let_it_be(:user) { create(:user) }
before do
sign_in(user)
visit explore_projects_path
end
it 'clicking new dropdown hides tooltip', :aggregate_failures,
quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/382786' do
btn = '#js-onboarding-new-project-link'
page.find(btn).hover
expect(page).to have_content('Create new...')
page.find(btn).click
expect(page).not_to have_content('Create new...')
end
end

View File

@ -6,8 +6,8 @@ RSpec.describe 'Unsubscribe links', :sidekiq_inline, feature_category: :shared d
include Warden::Test::Helpers
let_it_be(:project) { create(:project, :public) }
let_it_be(:author) { create(:user, :no_super_sidebar).tap { |u| project.add_reporter(u) } }
let_it_be(:recipient) { create(:user, :no_super_sidebar) }
let_it_be(:author) { create(:user).tap { |u| project.add_reporter(u) } }
let_it_be(:recipient) { create(:user) }
let(:params) { { title: 'A bug!', description: 'Fix it!', assignee_ids: [recipient.id] } }
let(:issue) { Issues::CreateService.new(container: project, current_user: author, params: params).execute[:issue] }
@ -22,10 +22,6 @@ RSpec.describe 'Unsubscribe links', :sidekiq_inline, feature_category: :shared d
end
context 'when logged out' do
before do
stub_feature_flags(super_sidebar_logged_out: false)
end
context 'when visiting the link from the body' do
it 'shows the unsubscribe confirmation page and redirects to root path when confirming' do
visit body_link

View File

@ -5,6 +5,10 @@ require 'spec_helper'
RSpec.describe 'Session TTLs', :clean_gitlab_redis_shared_state, feature_category: :system_access do
include SessionHelpers
before do
expire_session
end
it 'creates a session with a short TTL when login fails' do
visit new_user_session_path
# The session key only gets created after a post
@ -18,10 +22,10 @@ RSpec.describe 'Session TTLs', :clean_gitlab_redis_shared_state, feature_categor
end
it 'increases the TTL when the login succeeds' do
user = create(:user, :no_super_sidebar)
user = create(:user)
gitlab_sign_in(user)
expect(page).to have_content(user.name)
expect(find('.js-super-sidebar')['data-sidebar']).to include(user.name)
expect_single_session_with_authenticated_ttl
end

View File

@ -3759,8 +3759,6 @@
- './spec/features/milestones/user_views_milestone_spec.rb'
- './spec/features/milestones/user_views_milestones_spec.rb'
- './spec/features/monitor_sidebar_link_spec.rb'
- './spec/features/nav/top_nav_responsive_spec.rb'
- './spec/features/nav/top_nav_tooltip_spec.rb'
- './spec/features/oauth_login_spec.rb'
- './spec/features/oauth_provider_authorize_spec.rb'
- './spec/features/one_trust_spec.rb'
@ -4109,7 +4107,6 @@
- './spec/features/user_opens_link_to_comment_spec.rb'
- './spec/features/users/active_sessions_spec.rb'
- './spec/features/users/add_email_to_existing_account_spec.rb'
- './spec/features/users/anonymous_sessions_spec.rb'
- './spec/features/users/bizible_csp_spec.rb'
- './spec/features/users/confirmation_spec.rb'
- './spec/features/user_sees_revert_modal_spec.rb'

View File

@ -230,6 +230,8 @@ end
RSpec.shared_examples 'an email with a labels subscriptions link in its footer' do
it { is_expected.to have_body_text('label subscriptions') }
it { is_expected.to have_body_text(%(href="#{project_labels_url(project, subscribed: true)}")) }
end
RSpec.shared_examples 'a note email' do

View File

@ -1,32 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/snippets', feature_category: :source_code_management do
before do
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
end
describe 'sidebar' do
context 'when signed in' do
let(:user) { build_stubbed(:user, :no_super_sidebar) }
it 'renders the "Your work" sidebar' do
render
expect(rendered).to have_css('aside.nav-sidebar[aria-label="Your work"]')
end
end
context 'when not signed in' do
let(:user) { nil }
it 'renders no sidebar' do
render
expect(rendered).not_to have_css('aside.nav-sidebar')
end
end
end
end