Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-01-10 06:13:42 +00:00
parent 52cde49c28
commit ff16b71bc7
9 changed files with 53 additions and 37 deletions

View File

@ -336,7 +336,7 @@ module SearchHelper
link_to search_path(search_params) do link_to search_path(search_params) do
concat label concat label
concat ' ' concat ' '
concat content_tag(:span, count, class: ['badge badge-pill gl-badge badge-muted sm', badge_class], data: badge_data) concat gl_badge_tag(count, { size: :sm }, { class: badge_class, data: badge_data })
end end
end end
end end

View File

@ -364,7 +364,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
if clusters.empty? if clusters.empty?
AnchorData.new(false, AnchorData.new(false,
statistic_icon + _('Add Kubernetes cluster'), statistic_icon + _('Add Kubernetes cluster'),
new_project_cluster_path(project)) project_clusters_path(project))
else else
cluster_link = clusters.count == 1 ? project_cluster_path(project, clusters.first) : project_clusters_path(project) cluster_link = clusters.count == 1 ? project_cluster_path(project, clusters.first) : project_clusters_path(project)

View File

@ -1,8 +1,7 @@
--- ---
stage: Manage stage: Manage
group: Workspace group: Workspace
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments" info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
type: reference
--- ---
# Organize work with projects **(FREE)** # Organize work with projects **(FREE)**
@ -43,9 +42,9 @@ Projects include the following [features](https://about.gitlab.com/features/):
- [Issue tracker](issues/index.md): Discuss implementations with your team. - [Issue tracker](issues/index.md): Discuss implementations with your team.
- [Issue boards](issue_board.md): Organize and prioritize your workflow. - [Issue boards](issue_board.md): Organize and prioritize your workflow.
- [Multiple issue boards](issue_board.md#multiple-issue-boards): Create team-specific workflows (issue boards) for a project. - [Multiple issue boards](issue_board.md#multiple-issue-boards): Create team-specific workflows (issue boards) for a project.
- [Merge Requests](merge_requests/index.md): Apply a branching - [Merge requests](merge_requests/index.md): Apply a branching
strategy and get reviewed by your team. strategy and get reviewed by your team.
- [Merge Request Approvals](merge_requests/approvals/index.md): Ask for approval before - [Merge request approvals](merge_requests/approvals/index.md): Ask for approval before
implementing a change. implementing a change.
- [Fix merge conflicts from the UI](merge_requests/conflicts.md): View Git diffs from the GitLab UI. - [Fix merge conflicts from the UI](merge_requests/conflicts.md): View Git diffs from the GitLab UI.
- [Review Apps](../../ci/review_apps/index.md): By branch, preview the results - [Review Apps](../../ci/review_apps/index.md): By branch, preview the results
@ -144,7 +143,7 @@ There are numerous [APIs](../../api/index.md) to use with your projects:
- [Issue board](../../api/boards.md) - [Issue board](../../api/boards.md)
- [Labels](../../api/labels.md) - [Labels](../../api/labels.md)
- [Markdown](../../api/markdown.md) - [Markdown](../../api/markdown.md)
- [Merge Requests](../../api/merge_requests.md) - [Merge requests](../../api/merge_requests.md)
- [Milestones](../../api/milestones.md) - [Milestones](../../api/milestones.md)
- [Services](../../api/integrations.md) - [Services](../../api/integrations.md)
- [Snippets](../../api/project_snippets.md) - [Snippets](../../api/project_snippets.md)

View File

@ -47,40 +47,43 @@ module QA
fill_element :members_token_select_input, username fill_element :members_token_select_input, username
Support::WaitForRequests.wait_for_requests Support::WaitForRequests.wait_for_requests
click_button username click_button username
set_access_level(access_level)
# Guest option is selected by default, skipping these steps if desired option is 'Guest'
unless access_level == 'Guest'
click_element :access_level_dropdown
click_button access_level
end
click_element :invite_button
end end
Support::WaitForRequests.wait_for_requests send_invite
page.refresh
end end
def invite_group(group_name, group_access = Resource::Members::AccessLevel::GUEST) def invite_group(group_name, access_level = 'Guest')
open_invite_group_modal open_invite_group_modal
fill_element :access_level_dropdown, with: group_access within_element(:invite_members_modal_content) do
click_button 'Select a group'
click_button 'Select a group' # Helps stabilize race condition with concurrent group API calls while searching
# TODO: Replace with `fill_element :group_select_dropdown_search_field, group_name` when this bug is resolved: https://gitlab.com/gitlab-org/gitlab/-/issues/349379
send_keys_to_element(:group_select_dropdown_search_field, group_name)
# Helps stabilize race condition with concurrent group API calls while searching Support::WaitForRequests.wait_for_requests
# TODO: Replace with `fill_element :group_select_dropdown_search_field, group_name` when this bug is resolved: https://gitlab.com/gitlab-org/gitlab/-/issues/349379 click_button group_name
send_keys_to_element(:group_select_dropdown_search_field, group_name) set_access_level(access_level)
end
Support::WaitForRequests.wait_for_requests send_invite
end
click_button group_name private
def set_access_level(access_level)
# Guest option is selected by default, skipping these steps if desired option is 'Guest'
unless access_level == 'Guest'
click_element :access_level_dropdown
click_button access_level
end
end
def send_invite
click_element :invite_button click_element :invite_button
Support::WaitForRequests.wait_for_requests Support::WaitForRequests.wait_for_requests
page.refresh page.refresh
end end
end end

View File

@ -5,10 +5,10 @@ module QA
RSpec.describe 'Manage', :requires_admin, :transient, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/349379' do RSpec.describe 'Manage', :requires_admin, :transient, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/349379' do
describe 'Invite group' do describe 'Invite group' do
shared_examples 'invites group to project' do shared_examples 'invites group to project' do
it 'verifies group is added and members can access project' do it 'verifies group is added and members can access project with correct access level' do
Page::Project::Menu.perform(&:click_members) Page::Project::Menu.perform(&:click_members)
Page::Project::Members.perform do |project_members| Page::Project::Members.perform do |project_members|
project_members.invite_group(group.path) project_members.invite_group(group.path, 'Developer')
expect(project_members).to have_group(group.path) expect(project_members).to have_group(group.path)
end end
@ -16,7 +16,7 @@ module QA
Flow::Login.sign_in(as: @user) Flow::Login.sign_in(as: @user)
Page::Dashboard::Projects.perform do |projects| Page::Dashboard::Projects.perform do |projects|
expect(projects).to have_project_with_access_role(project.name, 'Guest') expect(projects).to have_project_with_access_role(project.name, 'Developer')
end end
project.visit! project.visit!
@ -28,13 +28,13 @@ module QA
end end
before(:context) do before(:context) do
Runtime::Feature.enable(:invite_members_group_modal)
@user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) @user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
end end
before do before do
Runtime::Feature.enable(:invite_members_group_modal)
Flow::Login.sign_in Flow::Login.sign_in
group.add_member(@user, Resource::Members::AccessLevel::GUEST) group.add_member(@user, Resource::Members::AccessLevel::MAINTAINER)
project.visit! project.visit!
end end
@ -78,6 +78,9 @@ module QA
after do after do
project&.remove_via_api! project&.remove_via_api!
group&.remove_via_api! group&.remove_via_api!
end
after(:context) do
Runtime::Feature.disable(:invite_members_group_modal) Runtime::Feature.disable(:invite_members_group_modal)
end end
end end

View File

@ -11,6 +11,14 @@ module QA
end end
end end
let!(:runner) do
Resource::Runner.fabricate_via_api! do |runner|
runner.project = project
runner.name = random_test_string
runner.tags = [random_test_string]
end
end
let!(:commit) do let!(:commit) do
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project commit.project = project
@ -21,6 +29,7 @@ module QA
file_path: '.gitlab-ci.yml', file_path: '.gitlab-ci.yml',
content: <<~YAML content: <<~YAML
test_job: test_job:
tags: ['#{random_test_string}']
script: script:
- echo "Simple test!" - echo "Simple test!"
YAML YAML
@ -33,11 +42,12 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
project.visit! project.visit!
Support::Waiter.wait_until { project.pipelines.first[:status] == 'success' }
Page::Project::Menu.perform(&:go_to_pipeline_editor) Page::Project::Menu.perform(&:go_to_pipeline_editor)
end end
after do after do
project.remove_via_api! [runner, project].each(&:remove_via_api!)
end end
it 'creates new pipeline and target branch', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349005' do it 'creates new pipeline and target branch', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349005' do
@ -50,7 +60,7 @@ module QA
expect(show.target_branch_name).to eq(random_test_string) expect(show.target_branch_name).to eq(random_test_string)
expect(show.current_branch).to eq(random_test_string) expect(show.current_branch).to eq(random_test_string)
expect(show.editing_content).to have_content(random_test_string) expect(show.editing_content).to have_content(random_test_string)
expect(show.pipeline_id).to eq(project.pipelines.first[:id]) expect { show.pipeline_id }.to eventually_eq(project.pipelines.pluck(:id).max).within(max_duration: 60, sleep_interval: 3)
end end
end end

View File

@ -316,7 +316,7 @@ RSpec.describe 'Projects > Show > User sees setup shortcut buttons' do
visit project_path(project) visit project_path(project)
page.within('.project-buttons') do page.within('.project-buttons') do
expect(page).to have_link('Add Kubernetes cluster', href: new_project_cluster_path(project)) expect(page).to have_link('Add Kubernetes cluster', href: project_clusters_path(project))
end end
end end

View File

@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe SearchHelper do RSpec.describe SearchHelper do
include MarkupHelper include MarkupHelper
include BadgesHelper
# Override simple_sanitize for our testing purposes # Override simple_sanitize for our testing purposes
def simple_sanitize(str) def simple_sanitize(str)

View File

@ -554,7 +554,7 @@ RSpec.describe ProjectPresenter do
expect(presenter.kubernetes_cluster_anchor_data).to have_attributes( expect(presenter.kubernetes_cluster_anchor_data).to have_attributes(
is_link: false, is_link: false,
label: a_string_including('Add Kubernetes cluster'), label: a_string_including('Add Kubernetes cluster'),
link: presenter.new_project_cluster_path(project) link: presenter.project_clusters_path(project)
) )
end end
end end