Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-12-02 09:09:50 +00:00
parent d5e4aa5266
commit 43ae0b9e40
31 changed files with 231 additions and 103 deletions

View File

@ -1,10 +1,17 @@
<script>
import { createNamespacedHelpers, mapState, mapActions, mapGetters } from 'vuex';
import { GlFormGroup, GlFormInput, GlFormCheckbox, GlIcon, GlLink, GlSprintf } from '@gitlab/ui';
import {
GlFormGroup,
GlFormInput,
GlFormCheckbox,
GlIcon,
GlLink,
GlSprintf,
GlButton,
} from '@gitlab/ui';
import { s__ } from '~/locale';
import ClusterFormDropdown from '~/create_cluster/components/cluster_form_dropdown.vue';
import { KUBERNETES_VERSIONS } from '../constants';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
const { mapState: mapRolesState, mapActions: mapRolesActions } = createNamespacedHelpers('roles');
const { mapState: mapKeyPairsState, mapActions: mapKeyPairsActions } = createNamespacedHelpers(
@ -29,7 +36,7 @@ export default {
GlIcon,
GlLink,
GlSprintf,
LoadingButton,
GlButton,
},
props: {
gitlabManagedClusterHelpPath: {
@ -508,13 +515,16 @@ export default {
</p>
</div>
<div class="form-group">
<loading-button
class="js-create-cluster btn-success"
<gl-button
variant="success"
category="primary"
class="js-create-cluster"
:disabled="createClusterButtonDisabled"
:loading="isCreatingCluster"
:label="createClusterButtonLabel"
@click="createCluster()"
/>
>
{{ createClusterButtonLabel }}
</gl-button>
</div>
</form>
</template>

View File

@ -85,6 +85,7 @@ export default {
v-model="filter"
:placeholder="$options.i18n.searchPlaceholder"
class="gl-align-self-center gl-ml-auto fork-filtered-search"
data-qa-selector="fork_groups_list_search_field"
/>
</template>
</gl-tabs>

View File

@ -1,7 +1,11 @@
<script>
import { GlIcon } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
export default {
components: {
GlIcon,
},
props: {
user: {
type: Object,
@ -46,6 +50,6 @@ export default {
class="avatar avatar-inline m-0"
data-qa-selector="avatar_image"
/>
<i v-if="hasMergeIcon" aria-hidden="true" class="fa fa-exclamation-triangle merge-icon"></i>
<gl-icon v-if="hasMergeIcon" name="warning-solid" aria-hidden="true" class="merge-icon" />
</span>
</template>

View File

@ -112,11 +112,12 @@ export default {
/>
<button v-if="hasMoreThanTwoAssignees" class="btn-link" type="button">
<span class="avatar-counter sidebar-avatar-counter"> {{ sidebarAvatarCounter }} </span>
<i
<gl-icon
v-if="isMergeRequest && !allAssigneesCanMerge"
name="warning-solid"
aria-hidden="true"
class="fa fa-exclamation-triangle merge-icon"
></i>
class="merge-icon"
/>
</button>
</div>
</template>

View File

@ -97,11 +97,12 @@ export default {
<collapsed-reviewer v-for="user in collapsedUsers" :key="user.id" :user="user" />
<button v-if="hasMoreThanTwoReviewers" class="btn-link" type="button">
<span class="avatar-counter sidebar-avatar-counter"> {{ sidebarAvatarCounter }} </span>
<i
<gl-icon
v-if="!allReviewersCanMerge"
name="warning-solid"
aria-hidden="true"
class="fa fa-exclamation-triangle merge-icon"
></i>
class="merge-icon"
/>
</button>
</div>
</template>

View File

@ -1,9 +1,13 @@
<script>
// NOTE! For the first iteration, we are simply copying the implementation of Assignees
// It will soon be overhauled in Issue https://gitlab.com/gitlab-org/gitlab/-/issues/233736
import { GlIcon } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
export default {
components: {
GlIcon,
},
props: {
user: {
type: Object,
@ -38,6 +42,6 @@ export default {
class="avatar avatar-inline m-0"
data-qa-selector="avatar_image"
/>
<i v-if="hasMergeIcon" aria-hidden="true" class="fa fa-exclamation-triangle merge-icon"></i>
<gl-icon v-if="hasMergeIcon" name="warning-solid" aria-hidden="true" class="merge-icon" />
</span>
</template>

View File

@ -796,7 +796,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) {
const mergeIcon =
issuableType === 'merge_request' && !user.can_merge
? `${spriteIcon('warning-solid', 's12 merge-icon')}`
? spriteIcon('warning-solid', 's12 merge-icon')
: '';
return `<span class="position-relative mr-2">

View File

@ -113,7 +113,7 @@
position: absolute;
bottom: 0;
right: 0;
text-shadow: -1px -1px 2px $white, 1px -1px 2px $white, -1px 1px 2px $white, 1px 1px 2px $white;
filter: drop-shadow(0 0 0.5px $white) drop-shadow(0 0 1px $white) drop-shadow(0 0 2px $white);
}
}
@ -392,6 +392,13 @@
text-align: center;
}
.merge-icon {
height: 12px;
width: 12px;
bottom: -5px;
right: 4px;
}
.sidebar-collapsed-icon {
display: flex;
flex-direction: column;
@ -402,7 +409,7 @@
text-align: center;
color: $gl-text-color-secondary;
svg {
> svg {
fill: $gl-text-color-secondary;
}
@ -410,7 +417,7 @@
&:hover .todo-undone {
color: $gl-text-color;
svg {
> svg {
fill: $gl-text-color;
}
}
@ -482,10 +489,6 @@
display: none;
}
.merge-icon {
font-size: 10px;
}
.multiple-users {
position: relative;
height: 24px;

View File

@ -287,10 +287,6 @@ $mr-widget-min-height: 69px;
margin-top: 0;
margin-bottom: 0;
&.has-conflicts .fa-exclamation-triangle {
color: $orange-500;
}
time {
font-weight: $gl-font-weight-normal;
}

View File

@ -10,7 +10,7 @@
- if current_user.admin?
.text-warning
%p
= icon("exclamation-triangle fw")
= sprite_icon('warning-solid')
= html_escape(_('You are an admin, which means granting access to %{client_name} will allow them to interact with GitLab as an admin as well. Proceed with caution.')) % { client_name: tag.strong(@pre_auth.client.name) }
%p
- link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer')

View File

@ -1,5 +1,5 @@
- if project.archived?
.text-warning.center.prepend-top-20
%p
= icon("exclamation-triangle fw")
= sprite_icon('warning-solid')
= _('Archived project! Repository and other project resources are read only')

View File

@ -37,7 +37,9 @@
= _('Add previously merged commits')
- if commits.size == 0 && context_commits.nil?
.mt-4.text-center
.bold
.commits-empty.gl-mt-6
= custom_icon('illustration_no_commits')
%h4
= _('Your search didn\'t match any commits.')
= _('Try changing or removing filters.')
%p
= _('Try changing or removing filters.')

View File

@ -1,5 +1,5 @@
%h4
= icon('exclamation-triangle')
= sprite_icon('warning-solid')
This merge request failed to be merged automatically
%p

View File

@ -1,6 +1,6 @@
%tr.tree-truncated-warning
%td{ colspan: '3' }
= icon('exclamation-triangle fw')
= sprite_icon('warning-solid')
%span
Too many items to show. To preserve performance only
%strong #{number_with_delimiter(limit)} of #{number_with_delimiter(total)}

View File

@ -28,7 +28,7 @@
- if referenced_users
.referenced-users.hide
%span
= icon("exclamation-triangle")
= sprite_icon('warning-solid')
You are about to add
%strong
%span.js-referenced-users-count 0

View File

@ -0,0 +1,5 @@
---
title: Update empty state for no commits result
merge_request: 48538
author:
type: changed

View File

@ -0,0 +1,5 @@
---
title: Replace fa-exclamation-triangle icons with GitLab SVG warning-solid icon
merge_request: 47089
author:
type: changed

View File

@ -143,16 +143,39 @@ jq 'select(."grpc.code" != null and ."grpc.code" != "OK")' current
jq 'select(."grpc.time_ms" > 30000)' current
```
#### Print top three projects by request volume and their three longest durations
#### Print top ten projects by request volume and their three longest durations
```shell
jq -s -r 'map(select(."grpc.request.glProjectPath" != null and ."grpc.request.glProjectPath" != "" and ."grpc.time_ms" != null)) | group_by(."grpc.request.glProjectPath") | sort_by(-length) | limit(3; .[]) | sort_by(-."grpc.time_ms") | "CT: \(length)\tPROJECT: \(.[0]."grpc.request.glProjectPath")\tDURS: \(.[0]."grpc.time_ms"), \(.[1]."grpc.time_ms"), \(.[2]."grpc.time_ms")"' current
jq --raw-output --slurp '
map(
select(
."grpc.request.glProjectPath" != null
and ."grpc.request.glProjectPath" != ""
and ."grpc.time_ms" != null
)
)
| group_by(."grpc.request.glProjectPath")
| sort_by(-length)
| limit(10; .[])
| sort_by(-."grpc.time_ms")
| [
length,
.[0]."grpc.time_ms",
.[1]."grpc.time_ms",
.[2]."grpc.time_ms",
.[0]."grpc.request.glProjectPath"
]
| @sh' /var/log/gitlab/gitaly/current \
| awk 'BEGIN { printf "%7s %10s %10s %10s\t%s\n", "CT", "MAX DURS", "", "", "PROJECT" }
{ printf "%7u %7u ms, %7u ms, %7u ms\t%s\n", $1, $2, $3, $4, $5 }'
```
**Example output**
```plaintext
CT: 635 PROJECT: groupA/project1 DURS: 4292.269, 4228.853, 2885.548
CT: 462 PROJECT: groupB/project5 DURS: 4368.981, 3623.553, 361.399
CT: 455 PROJECT: groupC/project7 DURS: 387.295, 381.874, 373.988
CT MAX DURS PROJECT
206 4898 ms, 1101 ms, 1032 ms 'groupD/project4'
109 1420 ms, 962 ms, 875 ms 'groupEF/project56'
663 106 ms, 96 ms, 94 ms 'groupABC/project123'
...
```

View File

@ -8,62 +8,81 @@ type: reference
# The .gitlab-ci.yml file
<!-- markdownlint-enable MD044 -->
To use GitLab CI/CD, you need an application codebase hosted in a
Git repository, and for your build, test, and deployment
scripts to be specified in a file called [`.gitlab-ci.yml`](README.md),
located in the root path of your repository.
To use GitLab CI/CD, you need:
In this file, you can define the scripts you want to run, define include and
cache dependencies, choose commands you want to run in sequence
and those you want to run in parallel, define where you want to
deploy your app, and specify whether you want to run the scripts automatically
or trigger any of them manually. After you're familiar with
GitLab CI/CD you can add more advanced steps into the configuration file.
- Application code hosted in a Git repository.
- A file called [`.gitlab-ci.yml`](README.md) in the root of your repository, which
contains the CI/CD configuration.
To add scripts to that file, you need to organize them in a
sequence that suits your application and are in accordance with
the tests you wish to perform. To visualize the process, imagine
that all the scripts you add to the configuration file are the
same as the commands you run on a terminal on your computer.
In the `.gitlab-ci.yml` file, you can define:
After you've added your `.gitlab-ci.yml` configuration file to your
repository, GitLab detects it and run your scripts with the
tool called [GitLab Runner](https://docs.gitlab.com/runner/), which
works similarly to your terminal.
- The scripts you want to run.
- Other configuration files and templates you want to include.
- Dependencies and caches.
- The commands you want to run in sequence and those you want to run in parallel.
- The location to deploy your application to.
- Whether you want to run the scripts automatically or trigger any of them manually.
The scripts are grouped into **jobs**, and together they compose
a **pipeline**. A minimalist example of `.gitlab-ci.yml` file
could contain:
The scripts are grouped into **jobs**, and jobs run as part of a larger
**pipeline**. You can group multiple independent jobs into **stages** that run in a defined order.
You should organize your jobs in a sequence that suits your application and is in accordance with
the tests you wish to perform. To [visualize](visualization.md) the process, imagine
the scripts you add to jobs are the same as CLI commands you run on your computer.
When you add a `.gitlab-ci.yml` file to your
repository, GitLab detects it and an application called [GitLab Runner](https://docs.gitlab.com/runner/)
runs the scripts defined in the jobs.
A `.gitlab-ci.yml` file might contain:
```yaml
before_script:
- apt-get install rubygems ruby-dev -y
stages:
- build
- test
run-test:
build-code-job:
stage: build
script:
- ruby --version
- echo "Check the ruby version, then build some Ruby project files:"
- ruby -v
- rake
test-code-job1:
stage: test
script:
- echo "If the files are built successfully, test some files with one command:"
- rake test1
test-code-job2:
stage: test
script:
- echo "If the files are built successfully, test other files with a different command:"
- rake test2
```
The `before_script` attribute would install the dependencies
for your app before running anything, and a **job** called
`run-test` would print the Ruby version of the current system.
Both of them compose a **pipeline** triggered at every push
to any branch of the repository.
In this example, the `build-code-job` job in the `build` stage runs first. It outputs
the Ruby version the job is using, then runs `rake` to build project files.
If this job completes successfully, the two `test-code-job` jobs in the `test` stage start
in parallel and run tests on the files.
GitLab CI/CD not only executes the jobs you've
set but also shows you what's happening during execution, as you
would see in your terminal:
The full pipeline in the example is composed of three jobs, grouped into two stages,
`build` and `test`. The pipeline runs every time changes are pushed to any
branch in the project.
GitLab CI/CD not only executes the jobs but also shows you what's happening during execution,
just as you would see in your terminal:
![job running](img/job_running.png)
You create the strategy for your app and GitLab runs the pipeline
for you according to what you've defined. Your pipeline status is also
according to what you've defined. Your pipeline status is also
displayed by GitLab:
![pipeline status](img/pipeline_status.png)
At the end, if anything goes wrong, you can easily
[roll back](../environments/index.md#retrying-and-rolling-back) all the changes:
If anything goes wrong, you can
[roll back](../environments/index.md#retrying-and-rolling-back) the changes:
![rollback button](img/rollback.png)

View File

@ -228,7 +228,7 @@ module QA
def finished_loading_block?
wait_for_requests
has_no_css?('.fa-spinner.block-loading', wait: Capybara.default_max_wait_time)
has_no_css?('.gl-spinner', wait: Capybara.default_max_wait_time)
end
def has_loaded_all_images?

View File

@ -9,9 +9,17 @@ module QA
element :fork_namespace_button
end
view 'app/assets/javascripts/pages/projects/forks/new/components/fork_groups_list.vue' do
element :fork_groups_list_search_field
end
def choose_namespace(namespace = Runtime::Namespace.path)
click_element(:fork_namespace_button, name: namespace)
end
def search_for_group(group_name)
find_element(:fork_groups_list_search_field).set(group_name)
end
end
end
end

View File

@ -76,6 +76,19 @@ module QA
visibility: 'public'
}
end
def api_put_path
"/groups/#{id}"
end
def update_group_setting(group_setting:, value:)
put_body = { "#{group_setting}": value }
response = put Runtime::API::Request.new(api_client, api_put_path).url, put_body
unless response.code == HTTP_STATUS_OK
raise ResourceUpdateFailedError, "Could not update #{group_setting} to #{value}. Request returned (#{response.code}): `#{response}`."
end
end
end
end
end

View File

@ -25,7 +25,7 @@ module QA
# https://gitlab.com/groups/gitlab-org/-/epics/956
# retry_on_exception added here due to `StaleElementReferenceError`. See: https://gitlab.com/gitlab-org/gitlab/-/issues/232485
Support::Retrier.retry_on_exception do
Capybara.page.has_no_css?('.gl-spinner, .fa-spinner, .spinner', wait: wait)
Capybara.page.has_no_css?('.gl-spinner', wait: wait)
end
end
end

View File

@ -19,7 +19,7 @@ RSpec.describe "User interacts with deploy keys", :js do
click_button("Enable")
expect(page).not_to have_selector(".fa-spinner")
expect(page).not_to have_selector(".gl-spinner")
expect(current_path).to eq(project_settings_repository_path(project))
find(".js-deployKeys-tab-enabled_keys").click

View File

@ -1,11 +1,42 @@
<div class="js-create-item-dropdown-fixture-root">
<input name="variable[environment]" type="hidden">
<div class="dropdown "><button class="dropdown-menu-toggle js-dropdown-menu-toggle" type="button" data-toggle="dropdown"><span class="dropdown-toggle-text ">some label</span><i aria-hidden="true" data-hidden="true" class="fa fa-chevron-down"></i></button><div class="dropdown-menu dropdown-select dropdown-menu-selectable"><div class="dropdown-input"><input type="search" id="" class="dropdown-input-field" autocomplete="off" /><i aria-hidden="true" data-hidden="true" class="fa fa-search dropdown-input-search"></i><i aria-hidden="true" data-hidden="true" role="button" class="fa fa-times dropdown-input-clear js-dropdown-input-clear"></i></div><div class="dropdown-content js-dropdown-content"></div><div class="dropdown-footer"><ul class="dropdown-footer-list">
<li>
<button class="dropdown-create-new-item-button js-dropdown-create-new-item">
Create wildcard
<code></code>
</button>
</li>
</ul>
</div><div class="dropdown-loading"><i aria-hidden="true" data-hidden="true" class="fa fa-spinner fa-spin"></i></div></div></div></div>
<input name="variable[environment]" type="hidden" />
<div class="dropdown ">
<button
class="dropdown-menu-toggle js-dropdown-menu-toggle"
type="button"
data-toggle="dropdown"
>
<span class="dropdown-toggle-text ">some label</span
><i aria-hidden="true" data-hidden="true" class="fa fa-chevron-down"></i>
</button>
<div class="dropdown-menu dropdown-select dropdown-menu-selectable">
<div class="dropdown-input">
<input type="search" id="" class="dropdown-input-field" autocomplete="off" /><i
aria-hidden="true"
data-hidden="true"
class="fa fa-search dropdown-input-search"
></i
><i
aria-hidden="true"
data-hidden="true"
role="button"
class="fa fa-times dropdown-input-clear js-dropdown-input-clear"
></i>
</div>
<div class="dropdown-content js-dropdown-content"></div>
<div class="dropdown-footer">
<ul class="dropdown-footer-list">
<li>
<button class="dropdown-create-new-item-button js-dropdown-create-new-item">
Create wildcard
<code></code>
</button>
</li>
</ul>
</div>
<div class="dropdown-loading">
<span aria-hidden="true" data-hidden="true" class="gl-spinner"></span>
</div>
</div>
</div>
</div>

View File

@ -32,7 +32,7 @@
</div>
<div class="dropdown-content"></div>
<div class="dropdown-loading">
<i class="fa fa-spinner fa-spin"></i>
<span class="gl-spinner"></span>
</div>
</div>
</div>

View File

@ -7,7 +7,7 @@
<ul></ul>
</li>
<li class="js-builds-dropdown-loading hidden">
<span class="fa fa-spinner"></span>
<span class="gl-spinner"></span>
</li>
</ul>
</div>

View File

@ -1,9 +1,9 @@
<div class="project-item-select-holder">
<input class="project-item-select" data-group-id="12345" data-relative-path="issues/new">
<a class="new-project-item-link" data-label="New issue" data-type="issues" href="">
<i class="fa fa-spinner spin"></i>
</a>
<a class="new-project-item-select-button">
<i class="fa fa-caret-down"></i>
</a>
<input class="project-item-select" data-group-id="12345" data-relative-path="issues/new" />
<a class="new-project-item-link" data-label="New issue" data-type="issues" href="">
<span class="gl-spinner"></span>
</a>
<a class="new-project-item-select-button">
<i class="fa fa-caret-down"></i>
</a>
</div>

View File

@ -1,5 +1,6 @@
import Vue from 'vue';
import { mount } from '@vue/test-utils';
import { GlLoadingIcon } from '@gitlab/ui';
import { setHTMLFixture } from 'helpers/fixtures';
import PipelineStore from '~/pipelines/stores/pipeline_store';
import GraphComponentLegacy from '~/pipelines/components/graph/graph_component_legacy.vue';
@ -42,7 +43,7 @@ describe('graph component', () => {
},
});
expect(wrapper.find('.gl-spinner').exists()).toBe(true);
expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
});
});
@ -85,7 +86,7 @@ describe('graph component', () => {
});
it('should not include the loading icon', () => {
expect(wrapper.find('.fa-spinner').exists()).toBe(false);
expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
});
it('should include the stage column', () => {

View File

@ -7,7 +7,8 @@ module Spec
module MergeRequestHelpers
def preload_view_requirements(merge_request, note)
# This will load the status fields of the author of the note and merge request
# to avoid queries in when rendering the view being tested.
# to avoid queries when rendering the view being tested.
#
merge_request.author.status
note.author.status
end

View File

@ -22,7 +22,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
}
within '.gpg-status-box' do
expect(page).not_to have_css('i.fa.fa-spinner.fa-spin')
expect(page).not_to have_css('.gl-spinner')
end
end
end