Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-07-23 00:09:43 +00:00
parent f05ceb978a
commit 46c2316f92
20 changed files with 104 additions and 62 deletions

View file

@ -17,7 +17,7 @@ class Projects::PipelinesController < Projects::ApplicationController
push_frontend_feature_flag(:filter_pipelines_search, project, default_enabled: true)
push_frontend_feature_flag(:dag_pipeline_tab, project, default_enabled: true)
push_frontend_feature_flag(:pipelines_security_report_summary, project)
push_frontend_feature_flag(:new_pipeline_form, default_enabled: true)
push_frontend_feature_flag(:new_pipeline_form)
end
before_action :ensure_pipeline, only: [:show]

View file

@ -6,6 +6,8 @@ module IconsHelper
extend self
include FontAwesome::Rails::IconHelper
DEFAULT_ICON_SIZE = 16
# Creates an icon tag given icon name(s) and possible icon modifiers.
#
# Right now this method simply delegates directly to `fa_icon` from the
@ -21,7 +23,7 @@ module IconsHelper
options.include?(:base) ? fa_stacked_icon(names, options) : fa_icon(names, options)
end
def custom_icon(icon_name, size: 16)
def custom_icon(icon_name, size: DEFAULT_ICON_SIZE)
# We can't simply do the below, because there are some .erb SVGs.
# File.read(Rails.root.join("app/views/shared/icons/_#{icon_name}.svg")).html_safe
render "shared/icons/#{icon_name}.svg", size: size
@ -52,7 +54,13 @@ module IconsHelper
css_classes = []
css_classes << "s#{size}" if size
css_classes << "#{css_class}" unless css_class.blank?
content_tag(:svg, content_tag(:use, "", { "xlink:href" => "#{sprite_icon_path}##{icon_name}" } ), class: css_classes.empty? ? nil : css_classes.join(' '))
content_tag(
:svg,
content_tag(:use, '', { 'xlink:href' => "#{sprite_icon_path}##{icon_name}" } ),
class: css_classes.empty? ? nil : css_classes.join(' '),
data: { testid: "#{icon_name}-icon" }
)
end
def loading_icon(container: false, color: 'orange', size: 'sm', css_class: nil)
@ -98,7 +106,7 @@ module IconsHelper
end
end
def visibility_level_icon(level, fw: true, options: {})
def visibility_level_icon(level, options: {})
name =
case level
when Gitlab::VisibilityLevel::PRIVATE
@ -106,13 +114,10 @@ module IconsHelper
when Gitlab::VisibilityLevel::INTERNAL
'shield'
else # Gitlab::VisibilityLevel::PUBLIC
'globe'
'earth'
end
name = [name]
name << "fw" if fw
icon(name.join(' '), options)
sprite_icon(name, size: DEFAULT_ICON_SIZE, css_class: 'gl-vertical-align-text-bottom')
end
def file_type_icon_class(type, mode, name)

View file

@ -22,15 +22,15 @@
= render_if_exists 'admin/groups/marked_for_deletion_badge', group: group, css_class: 'gl-ml-5'
%span.gl-ml-5
= icon('bookmark')
= sprite_icon('bookmark', size: 16, css_class: 'gl-vertical-align-text-bottom')
= number_with_delimiter(group.projects.count)
%span.gl-ml-5
= icon('users')
= sprite_icon('users', size: 16, css_class: 'gl-vertical-align-text-bottom')
= number_with_delimiter(group.users.count)
%span.gl-ml-5.visibility-icon.has-tooltip{ data: { container: 'body', placement: 'left' }, title: visibility_icon_description(group) }
= visibility_level_icon(group.visibility_level, fw: false)
= visibility_level_icon(group.visibility_level)
.controls.gl-flex-shrink-0.gl-ml-5
= link_to _('Edit'), admin_group_edit_path(group), id: "edit_#{dom_id(group)}", class: 'btn'

View file

@ -12,7 +12,7 @@
%h1.home-panel-title.gl-mt-3.gl-mb-2
= @group.name
%span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) }
= visibility_level_icon(@group.visibility_level, fw: false, options: {class: 'icon'})
= visibility_level_icon(@group.visibility_level, options: {class: 'icon'})
.home-panel-metadata.d-flex.align-items-center.text-secondary
%span
= _("Group ID: %{group_id}") % { group_id: @group.id }

View file

@ -13,7 +13,7 @@
%h1.home-panel-title.gl-mt-3.gl-mb-2{ data: { qa_selector: 'project_name_content' } }
= @project.name
%span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@project) }
= visibility_level_icon(@project.visibility_level, fw: false, options: {class: 'icon'})
= visibility_level_icon(@project.visibility_level, options: {class: 'icon'})
= render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project
.home-panel-metadata.d-flex.flex-wrap.text-secondary
- if can?(current_user, :read_project, @project)

View file

@ -6,7 +6,7 @@
= s_('Pipeline|Run Pipeline')
%hr
- if Feature.enabled?(:new_pipeline_form, default_enabled: true)
- if Feature.enabled?(:new_pipeline_form)
#js-new-pipeline{ data: { project_id: @project.id, pipelines_path: project_pipelines_path(@project), ref_param: params[:ref] || @project.default_branch, var_param: params[:var].to_json, file_param: params[:file_var].to_json, ref_names: @project.repository.ref_names.to_json.html_safe, settings_link: project_settings_ci_cd_path(@project) } }
- else

View file

@ -18,12 +18,12 @@
.stats.gl-text-gray-700.gl-flex-shrink-0
%span.gl-ml-5
= icon('bookmark')
= sprite_icon('bookmark', size: 16, css_class: 'gl-vertical-align-text-bottom')
= number_with_delimiter(group.projects.non_archived.count)
%span.gl-ml-5
= icon('users')
= sprite_icon('users', size: 16, css_class: 'gl-vertical-align-text-bottom')
= number_with_delimiter(group.users.count)
%span.gl-ml-5.visibility-icon.has-tooltip{ data: { container: 'body', placement: 'left' }, title: visibility_icon_description(group) }
= visibility_level_icon(group.visibility_level, fw: false)
= visibility_level_icon(group.visibility_level)

View file

@ -40,7 +40,7 @@
= project.name
%span.metadata-info.visibility-icon.gl-mr-3.gl-mt-3.text-secondary.has-tooltip{ data: { container: 'body', placement: 'top' }, title: visibility_icon_description(project) }
= visibility_level_icon(project.visibility_level, fw: true)
= visibility_level_icon(project.visibility_level)
- if explore_projects_tab? && project_license_name(project)
%span.metadata-info.d-inline-flex.align-items-center.gl-mr-3.gl-mt-3

View file

@ -3,7 +3,7 @@
.snippet-box.has-tooltip.inline.gl-mr-2{ title: snippet_visibility_level_description(@snippet.visibility_level, @snippet), data: { container: "body" } }
%span.sr-only
= visibility_level_label(@snippet.visibility_level)
= visibility_level_icon(@snippet.visibility_level, fw: false)
= visibility_level_icon(@snippet.visibility_level)
%span.creator
Authored
= time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago')

View file

@ -16,7 +16,7 @@
%li
%span.sr-only
= visibility_level_label(snippet.visibility_level)
= visibility_level_icon(snippet.visibility_level, fw: false)
= visibility_level_icon(snippet.visibility_level)
.snippet-info
#{snippet.to_reference} &middot;

View file

@ -0,0 +1,5 @@
---
title: Replace some FA icons on groups listing page with GitLab SVG icons
merge_request: 37162
author:
type: changed

View file

@ -658,6 +658,13 @@ internal traffic from the GitLab application to the Praefect nodes. The
specifics on which load balancer to use or the exact configuration is beyond the
scope of the GitLab documentation.
NOTE: **Note:**
The load balancer must be configured to accept traffic from the Gitaly nodes in
addition to the GitLab nodes. Some requests handled by
[`gitaly-ruby`](index.md#gitaly-ruby) sidecar processes call into the main Gitaly
process. `gitaly-ruby` uses the Gitaly address set in the GitLab server's
`git_data_dirs` setting to make this connection.
We hope that if youre managing HA systems like GitLab, you have a load balancer
of choice already. Some examples include [HAProxy](https://www.haproxy.org/)
(open-source), [Google Internal Load Balancer](https://cloud.google.com/load-balancing/docs/internal/),

View file

@ -446,12 +446,24 @@ to be in read-only mode for a while. During this time,
you can pull from the Container Registry, but you cannot push.
1. Optional: To reduce the amount of data to be migrated, run the [garbage collection tool without downtime](#performing-garbage-collection-without-downtime).
1. Copy initial data to your S3 bucket, for example with the AWS CLI [`cp`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/cp.html)
1. This example uses the `aws` CLI. If you haven't configured the
CLI before, you have to configure your credentials by running `sudo aws configure`.
Because a non-admin user likely can't access the Container Registry folder,
ensure you use `sudo`. To check your credential configuration, run [`ls`]
to list all buckets.
```shell
sudo aws --endpoint-url https://your-object-storage-backend.com s3 ls
```
If you are using AWS as your back end, you do not need the [`--endpoint-url`](https://docs.aws.amazon.com/cli/latest/reference/#:~:text=--endpoint-url).
1. Copy initial data to your S3 bucket, for example with the `aws` CLI
[`cp`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/cp.html)
or [`sync`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html)
command. Make sure to keep the `docker` folder as the top-level folder inside the bucket.
```shell
aws s3 sync registry s3://mybucket
sudo aws --endpoint-url https://your-object-storage-backend.com s3 sync registry s3://mybucket
```
1. To perform the final data sync,
@ -460,11 +472,16 @@ you can pull from the Container Registry, but you cannot push.
1. Sync any changes since the initial data load to your S3 bucket and delete files that exist in the destination bucket but not in the source:
```shell
aws s3 sync registry s3://mybucket --delete
sudo aws --endpoint-url https://your-object-storage-backend.com s3 sync registry s3://mybucket --delete --dryrun
```
After verifying the command is going to perform as expected, remove the
[`--dryrun`](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html)
flag and run the command.
DANGER: **Danger:**
The `--delete` flag will delete files that exist in the destination but not in the source.
The [`--delete`](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html)
flag will delete files that exist in the destination but not in the source.
Make sure not to swap the source and destination, or you will delete all data in the Registry.
1. Configure your registry to [use the S3 bucket for storage](#use-object-storage).

View file

@ -32,8 +32,11 @@ request removing the feature flag or the merge request where the default value o
the feature flag is set to true. If the feature contains any DB migration it
should include a changelog entry for DB changes.
If you need the feature flag to be on automatically, use `default_enabled: true`
when checking:
NOTE: **Note:**
All newly-introduced feature flags should be [off by default](./process.md#feature-flags-in-gitlab-development).
In rare cases you may need to set the feature flag on by default. If so, please explain the reasoning
in the merge request. To enable an active feature flag, use `default_enabled: true` when checking:
```ruby
Feature.enabled?(:feature_flag, project, default_enabled: true)

View file

@ -9,10 +9,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/5483) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.0.
## Overview
If you are using [GitLab CI/CD](../../../ci/README.md), you can search your project dependencies for their licenses
using License Compliance.
If you're using [GitLab CI/CD](../../../ci/README.md), you can use License Compliance to search your
project's dependencies for their licenses. You can then decide whether to allow or deny the use of
each license. For example, if your application uses an external (open source) library whose license
is incompatible with yours, then you can deny the use of that license.
You can take advantage of License Compliance by either [including the job](#configuration)
in your existing `.gitlab-ci.yml` file or by implicitly using
@ -48,28 +48,21 @@ You can view and modify existing policies from the [policies](#policies) tab.
![Edit Policy](img/policies_maintainer_edit_v13_2.png)
## Use cases
It helps you find what licenses your project uses in its dependencies, and decide for each of then
whether to allow it or forbid it. For example, your application is using an external (open source)
library whose license is incompatible with yours.
## Supported languages and package managers
The following languages and package managers are supported.
| Language | Package managers | Scan Tool |
|------------|-------------------------------------------------------------------|----------------------------------------------------------|
| JavaScript | [Bower](https://bower.io/), [npm](https://www.npmjs.com/) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| Go | [Godep](https://github.com/tools/godep), [go mod](https://github.com/golang/go/wiki/Modules) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| Java | [Gradle](https://gradle.org/), [Maven](https://maven.apache.org/) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| .NET | [Nuget](https://www.nuget.org/) (.NET Framework is supported via the [mono project](https://www.mono-project.com/). Windows specific dependencies are not supported at this time.) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| Python | [pip](https://pip.pypa.io/en/stable/) (Python is supported through [requirements.txt](https://pip.pypa.io/en/stable/user_guide/#requirements-files) and [Pipfile.lock](https://github.com/pypa/pipfile#pipfilelock).) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| Ruby | [gem](https://rubygems.org/) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| Objective-C, Swift | [Carthage](https://github.com/Carthage/Carthage) |[License Finder](https://github.com/pivotal/LicenseFinder)|
| Language | Package managers | Notes | Scan Tool |
|------------|------------------|-------|-----------|
| JavaScript | [Bower](https://bower.io/), [npm](https://www.npmjs.com/) | | [License Finder](https://github.com/pivotal/LicenseFinder) |
| Go | [Godep](https://github.com/tools/godep), [go mod](https://github.com/golang/go/wiki/Modules) | | [License Finder](https://github.com/pivotal/LicenseFinder) |
| Java | [Gradle](https://gradle.org/), [Maven](https://maven.apache.org/) | | [License Finder](https://github.com/pivotal/LicenseFinder) |
| .NET | [Nuget](https://www.nuget.org/) | The .NET Framework is supported via the [mono project](https://www.mono-project.com/). There are, however, some limitations. The scanner doesn't support Windows-specific dependencies and doesn't report dependencies of your project's listed dependencies. Also, the scanner always marks detected licenses for all dependencies as `unknown`. | [License Finder](https://github.com/pivotal/LicenseFinder) |
| Python | [pip](https://pip.pypa.io/en/stable/) | Python is supported through [requirements.txt](https://pip.pypa.io/en/stable/user_guide/#requirements-files) and [Pipfile.lock](https://github.com/pypa/pipfile#pipfilelock). | [License Finder](https://github.com/pivotal/LicenseFinder) |
| Ruby | [gem](https://rubygems.org/) | | [License Finder](https://github.com/pivotal/LicenseFinder)|
| Objective-C, Swift | [Carthage](https://github.com/Carthage/Carthage) | | [License Finder](https://github.com/pivotal/LicenseFinder) |
NOTE: **Note:**
Java 8 and Gradle 1.x projects are not supported.
### Experimental support

View file

@ -15,14 +15,26 @@ Jira issues import is an MVC, project-level feature, meaning that issues from mu
Jira projects can be imported into a GitLab project. MVC version imports issue title and description
as well as some other issue metadata as a section in the issue description.
## Future iterations
## Known limitations
As of GitLab 12.10, the Jira issue importer only brings across the title and description of
an issue.
The information imported into GitLab fields from Jira depends on the version of GitLab:
There is an [epic](https://gitlab.com/groups/gitlab-org/-/epics/2738) tracking the
addition of items such as issue assignees, labels, comments, user mapping, and much more.
These will be included in the future iterations of the GitLab Jira importer.
- From GitLab 12.10 to GitLab 13.1, only the issue's title and description are imported
directly.
- From GitLab 13.2:
- The issue's labels are also imported directly.
- You're also able to map Jira users to GitLab project members when preparing for the
import.
Other Jira issue metadata that is not formally mapped to GitLab issue fields is
imported into the GitLab issue's description as plain text.
Our parser for converting text in Jira issues to GitLab Flavored Markdown is only compatible with
Jira V3 REST API.
There is an [epic](https://gitlab.com/groups/gitlab-org/-/epics/2738) tracking the addition of
items, such as issue assignees, comments, and much more. These will be included in the future
iterations of the GitLab Jira importer.
## Prerequisites

View file

@ -34,7 +34,7 @@ RSpec.describe 'Group' do
expect(group.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
expect(current_path).to eq(group_path(group))
expect(page).to have_selector '.visibility-icon .fa-globe'
expect(page).to have_selector '.visibility-icon [data-testid="earth-icon"]'
end
end

View file

@ -56,8 +56,8 @@ RSpec.describe 'User edits snippet', :js do
click_button 'Save changes'
wait_for_requests
expect(page).to have_no_xpath("//i[@class='fa fa-lock']")
expect(page).to have_xpath("//i[@class='fa fa-shield']")
expect(page).to have_no_selector('[data-testid="lock-icon"]')
expect(page).to have_selector('[data-testid="shield-icon"]')
end
it 'updates the snippet to make it public' do
@ -66,8 +66,8 @@ RSpec.describe 'User edits snippet', :js do
click_button 'Save changes'
wait_for_requests
expect(page).to have_no_xpath("//i[@class='fa fa-lock']")
expect(page).to have_xpath("//i[@class='fa fa-globe']")
expect(page).to have_no_selector('[data-testid="lock-icon"]')
expect(page).to have_selector('[data-testid="earth-icon"]')
end
context 'when the git operation fails' do

View file

@ -127,7 +127,7 @@ RSpec.describe Ci::StatusHelper do
subject { helper.render_status_with_link("success", icon_size: 24) }
it "has the svg class to change size" do
is_expected.to include("<svg class=\"s24\">")
is_expected.to include("<svg class=\"s24\"")
end
end
end

View file

@ -50,17 +50,17 @@ RSpec.describe IconsHelper do
it 'returns svg icon html' do
expect(sprite_icon(icon_name).to_s)
.to eq "<svg><use xlink:href=\"#{icons_path}##{icon_name}\"></use></svg>"
.to eq "<svg data-testid=\"#{icon_name}-icon\"><use xlink:href=\"#{icons_path}##{icon_name}\"></use></svg>"
end
it 'returns svg icon html + size classes' do
expect(sprite_icon(icon_name, size: 72).to_s)
.to eq "<svg class=\"s72\"><use xlink:href=\"#{icons_path}##{icon_name}\"></use></svg>"
.to eq "<svg class=\"s72\" data-testid=\"#{icon_name}-icon\"><use xlink:href=\"#{icons_path}##{icon_name}\"></use></svg>"
end
it 'returns svg icon html + size classes + additional class' do
expect(sprite_icon(icon_name, size: 72, css_class: 'icon-danger').to_s)
.to eq "<svg class=\"s72 icon-danger\"><use xlink:href=\"#{icons_path}##{icon_name}\"></use></svg>"
.to eq "<svg class=\"s72 icon-danger\" data-testid=\"#{icon_name}-icon\"><use xlink:href=\"#{icons_path}##{icon_name}\"></use></svg>"
end
describe 'non existing icon' do