diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 15:08:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 15:08:01 +0000 |
commit | 53b1f4eaa2a451aaba908a5fee7ce97a930021ac (patch) | |
tree | 66501ec0de9f529ee1cfc7cd6c4b481b1fc76662 | |
parent | 684d65316ac77c62f47d68b9926eea8af30db227 (diff) | |
download | gitlab-ce-53b1f4eaa2a451aaba908a5fee7ce97a930021ac.tar.gz |
Add latest changes from gitlab-org/gitlab@master
27 files changed, 87 insertions, 56 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 4a6e90f5263..7474c87dafe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -404,7 +404,6 @@ RSpec/RepeatedExample: - 'spec/lib/gitlab/closing_issue_extractor_spec.rb' - 'spec/lib/gitlab/danger/changelog_spec.rb' - 'spec/lib/gitlab/import_export/project/relation_factory_spec.rb' - - 'spec/models/concerns/issuable_spec.rb' - 'spec/models/project_services/chat_message/pipeline_message_spec.rb' - 'spec/routing/admin_routing_spec.rb' - 'spec/rubocop/cop/migration/update_large_table_spec.rb' diff --git a/app/assets/javascripts/snippets/components/snippet_visibility_edit.vue b/app/assets/javascripts/snippets/components/snippet_visibility_edit.vue index 80710a88bb2..299bb8fcfad 100644 --- a/app/assets/javascripts/snippets/components/snippet_visibility_edit.vue +++ b/app/assets/javascripts/snippets/components/snippet_visibility_edit.vue @@ -1,6 +1,11 @@ <script> import { GlIcon, GlFormGroup, GlFormRadio, GlFormRadioGroup, GlLink } from '@gitlab/ui'; -import { SNIPPET_VISIBILITY, SNIPPET_VISIBILITY_PRIVATE } from '~/snippets/constants'; +import { + SNIPPET_VISIBILITY, + SNIPPET_VISIBILITY_PRIVATE, + SNIPPET_VISIBILITY_INTERNAL, + SNIPPET_VISIBILITY_PUBLIC, +} from '~/snippets/constants'; export default { components: { @@ -29,14 +34,11 @@ export default { }, computed: { visibilityOptions() { - const options = []; - Object.keys(SNIPPET_VISIBILITY).forEach(key => { - options.push({ - value: key, - ...SNIPPET_VISIBILITY[key], - }); - }); - return options; + return [ + SNIPPET_VISIBILITY_PRIVATE, + SNIPPET_VISIBILITY_INTERNAL, + SNIPPET_VISIBILITY_PUBLIC, + ].map(key => ({ value: key, ...SNIPPET_VISIBILITY[key] })); }, }, }; diff --git a/app/controllers/ci/lints_controller.rb b/app/controllers/ci/lints_controller.rb deleted file mode 100644 index 99ce24bd435..00000000000 --- a/app/controllers/ci/lints_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module Ci - class LintsController < ::ApplicationController - before_action :authenticate_user! - - def show - end - end -end diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb index 5a33a8f89df..5ba6100f169 100644 --- a/app/models/award_emoji.rb +++ b/app/models/award_emoji.rb @@ -15,7 +15,7 @@ class AwardEmoji < ApplicationRecord validates :awardable, presence: true, unless: :importing? validates :name, presence: true, inclusion: { in: Gitlab::Emoji.emojis_names } - validates :name, uniqueness: { scope: [:user, :awardable_type, :awardable_id] }, unless: :ghost_user? + validates :name, uniqueness: { scope: [:user, :awardable_type, :awardable_id] }, unless: -> { ghost_user? || importing? } participant :user diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb index 1e5c93cd913..0334d63dd36 100644 --- a/app/models/remote_mirror.rb +++ b/app/models/remote_mirror.rb @@ -117,6 +117,8 @@ class RemoteMirror < ApplicationRecord end end + options[:keep_divergent_refs] = keep_divergent_refs? + Gitlab::Git::RemoteMirror.new( project.repository.raw, remote_name, diff --git a/app/views/ci/lints/show.html.haml b/app/views/ci/lints/show.html.haml deleted file mode 100644 index d4455749803..00000000000 --- a/app/views/ci/lints/show.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -.row.empty-state - .col-12 - .svg-content - = image_tag 'illustrations/feature_moved.svg' - .col-12 - .text-content.text-center - %h4= _("GitLab CI Linter has been moved") - %p - = _("To validate your GitLab CI configurations, go to 'CI/CD → Pipelines' inside your project, and click on the 'CI Lint' button.") diff --git a/changelogs/unreleased/georgekoltsov-fix-award-emojis-import-export.yml b/changelogs/unreleased/georgekoltsov-fix-award-emojis-import-export.yml new file mode 100644 index 00000000000..9022deeed4d --- /dev/null +++ b/changelogs/unreleased/georgekoltsov-fix-award-emojis-import-export.yml @@ -0,0 +1,5 @@ +--- +title: Allow award emoji same name & user duplicates when Importing +merge_request: 28588 +author: +type: fixed diff --git a/changelogs/unreleased/refactor-issuable-spec.yml b/changelogs/unreleased/refactor-issuable-spec.yml new file mode 100644 index 00000000000..4e965b21973 --- /dev/null +++ b/changelogs/unreleased/refactor-issuable-spec.yml @@ -0,0 +1,5 @@ +--- +title: Fix issuable duplicate spec +merge_request: 28632 +author: Rajendra Kadam +type: added diff --git a/changelogs/unreleased/remove-deprecated-lint-page.yml b/changelogs/unreleased/remove-deprecated-lint-page.yml new file mode 100644 index 00000000000..7dd00dfa80d --- /dev/null +++ b/changelogs/unreleased/remove-deprecated-lint-page.yml @@ -0,0 +1,5 @@ +--- +title: Remove deprecated /ci/lint page +merge_request: 28562 +author: +type: removed diff --git a/config/routes.rb b/config/routes.rb index a8b2a9b6656..c4a1f693048 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -19,7 +19,6 @@ Rails.application.routes.draw do draw :sherlock draw :development - draw :ci use_doorkeeper do controllers applications: 'oauth/applications', diff --git a/config/routes/ci.rb b/config/routes/ci.rb deleted file mode 100644 index ebd321ed097..00000000000 --- a/config/routes/ci.rb +++ /dev/null @@ -1,5 +0,0 @@ -namespace :ci do - resource :lint, only: :show - - root to: redirect('') -end diff --git a/doc/user/packages/maven_repository/index.md b/doc/user/packages/maven_repository/index.md index 58f0f46052d..b4aec11d029 100644 --- a/doc/user/packages/maven_repository/index.md +++ b/doc/user/packages/maven_repository/index.md @@ -34,6 +34,11 @@ using Maven and understand how to build your own packages, move onto the ### Installing Maven +The required minimum versions are: + +- Java 11.0.5+ +- Maven 3.6+ + Follow the instructions at [maven.apache.org](https://maven.apache.org/install.html) to download and install Maven for your local development environment. Once installation is complete, verify you can use Maven in your terminal by running: diff --git a/doc/user/permissions.md b/doc/user/permissions.md index 4f7284fb05b..55f2e3bbd6c 100644 --- a/doc/user/permissions.md +++ b/doc/user/permissions.md @@ -219,6 +219,7 @@ group. | Manage group labels | | ✓ | ✓ | ✓ | ✓ | | Create project in group | | | ✓ (3) | ✓ (3) | ✓ (3) | | Create/edit/delete group milestones | | | ✓ | ✓ | ✓ | +| See a container registry | | ✓ | ✓ | ✓ | ✓ | | Enable/disable a dependency proxy **(PREMIUM)** | | | ✓ | ✓ | ✓ | | Use security dashboard **(ULTIMATE)** | | | ✓ | ✓ | ✓ | | Create subgroup | | | | ✓ (1) | ✓ | diff --git a/doc/user/project/integrations/img/copy_link_to_chart_v12_10.png b/doc/user/project/integrations/img/copy_link_to_chart_v12_10.png Binary files differnew file mode 100644 index 00000000000..fc205240ea5 --- /dev/null +++ b/doc/user/project/integrations/img/copy_link_to_chart_v12_10.png diff --git a/doc/user/project/integrations/img/generate_link_to_chart.png b/doc/user/project/integrations/img/generate_link_to_chart.png Binary files differdeleted file mode 100644 index 03e018969b1..00000000000 --- a/doc/user/project/integrations/img/generate_link_to_chart.png +++ /dev/null diff --git a/doc/user/project/integrations/img/panel_context_menu_v12_10.png b/doc/user/project/integrations/img/panel_context_menu_v12_10.png Binary files differindex e6b0f75406d..096262fea91 100644 --- a/doc/user/project/integrations/img/panel_context_menu_v12_10.png +++ b/doc/user/project/integrations/img/panel_context_menu_v12_10.png diff --git a/doc/user/project/integrations/prometheus.md b/doc/user/project/integrations/prometheus.md index 425687d21b8..f8156a484ac 100644 --- a/doc/user/project/integrations/prometheus.md +++ b/doc/user/project/integrations/prometheus.md @@ -624,7 +624,7 @@ The options are: - [View logs](#view-logs-ultimate) - [Download CSV](#downloading-data-as-csv) -- [Generate link to chart](#embedding-gitlab-managed-kubernetes-metrics) +- [Copy link to chart](#embedding-gitlab-managed-kubernetes-metrics) - [Alerts](#setting-up-alerts-for-prometheus-metrics-ultimate) ### View Logs **(ULTIMATE)** @@ -773,9 +773,11 @@ GitLab unfurls the link as an embedded metrics panel: ![Embedded Metrics Rendered](img/embedded_metrics_rendered_v12_8.png) -A single chart may also be embedded. You can generate a link to the chart via the dropdown located on the right side of the chart: +You can also embed a single chart. To get a link to a chart, click the +**{ellipsis_v}** **More info** menu in the upper right corner of the chart, +and select **Copy link to chart**, as shown in this example: -![Generate Link To Chart](img/generate_link_to_chart.png) +![Copy Link To Chart](img/copy_link_to_chart_v12_10.png) The following requirements must be met for the metric to unfurl: diff --git a/doc/user/reserved_names.md b/doc/user/reserved_names.md index 3e53bc0fd81..28dd4c142f7 100644 --- a/doc/user/reserved_names.md +++ b/doc/user/reserved_names.md @@ -55,7 +55,6 @@ Currently the following names are reserved as top level groups: - `apple-touch-icon.png` - `assets` - `autocomplete` -- `ci` - `dashboard` - `deploy.html` - `explore` diff --git a/lib/gitlab/git/remote_mirror.rb b/lib/gitlab/git/remote_mirror.rb index df3cd422527..d9f51a7e844 100644 --- a/lib/gitlab/git/remote_mirror.rb +++ b/lib/gitlab/git/remote_mirror.rb @@ -5,14 +5,15 @@ module Gitlab class RemoteMirror include Gitlab::Git::WrapsGitalyErrors - attr_reader :repository, :ref_name, :only_branches_matching, :ssh_key, :known_hosts + attr_reader :repository, :ref_name, :only_branches_matching, :ssh_key, :known_hosts, :keep_divergent_refs - def initialize(repository, ref_name, only_branches_matching: [], ssh_key: nil, known_hosts: nil) + def initialize(repository, ref_name, only_branches_matching: [], ssh_key: nil, known_hosts: nil, keep_divergent_refs: false) @repository = repository @ref_name = ref_name @only_branches_matching = only_branches_matching @ssh_key = ssh_key @known_hosts = known_hosts + @keep_divergent_refs = keep_divergent_refs end def update @@ -21,7 +22,8 @@ module Gitlab ref_name, only_branches_matching, ssh_key: ssh_key, - known_hosts: known_hosts + known_hosts: known_hosts, + keep_divergent_refs: keep_divergent_refs ) end end diff --git a/lib/gitlab/gitaly_client/remote_service.rb b/lib/gitlab/gitaly_client/remote_service.rb index 2405f3be197..4566c59bbe0 100644 --- a/lib/gitlab/gitaly_client/remote_service.rb +++ b/lib/gitlab/gitaly_client/remote_service.rb @@ -53,7 +53,7 @@ module Gitlab encode_utf8(response.ref) end - def update_remote_mirror(ref_name, only_branches_matching, ssh_key: nil, known_hosts: nil) + def update_remote_mirror(ref_name, only_branches_matching, ssh_key: nil, known_hosts: nil, keep_divergent_refs: false) req_enum = Enumerator.new do |y| first_request = Gitaly::UpdateRemoteMirrorRequest.new( repository: @gitaly_repo, @@ -62,6 +62,7 @@ module Gitlab first_request.ssh_key = ssh_key if ssh_key.present? first_request.known_hosts = known_hosts if known_hosts.present? + first_request.keep_divergent_refs = keep_divergent_refs y.yield(first_request) diff --git a/lib/gitlab/path_regex.rb b/lib/gitlab/path_regex.rb index 5fa0fbf874c..d95da262eea 100644 --- a/lib/gitlab/path_regex.rb +++ b/lib/gitlab/path_regex.rb @@ -28,7 +28,6 @@ module Gitlab apple-touch-icon.png assets autocomplete - ci dashboard deploy.html explore diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 3e581dba398..97e224c0fe9 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -9635,9 +9635,6 @@ msgstr "" msgid "GitLab / Unsubscribe" msgstr "" -msgid "GitLab CI Linter has been moved" -msgstr "" - msgid "GitLab Enterprise Edition %{plan}" msgstr "" @@ -21198,9 +21195,6 @@ msgstr "" msgid "To this GitLab instance" msgstr "" -msgid "To validate your GitLab CI configurations, go to 'CI/CD → Pipelines' inside your project, and click on the 'CI Lint' button." -msgstr "" - msgid "To view the roadmap, add a start or due date to one of your epics in this group or its subgroups. In the months view, only epics in the past month, current month, and next 5 months are shown." msgstr "" diff --git a/spec/lib/gitlab/git/remote_mirror_spec.rb b/spec/lib/gitlab/git/remote_mirror_spec.rb index 9744562b51b..edef91b8bc6 100644 --- a/spec/lib/gitlab/git/remote_mirror_spec.rb +++ b/spec/lib/gitlab/git/remote_mirror_spec.rb @@ -7,14 +7,14 @@ describe Gitlab::Git::RemoteMirror do let(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:ref_name) { 'foo' } - let(:options) { { only_branches_matching: ['master'], ssh_key: 'KEY', known_hosts: 'KNOWN HOSTS' } } + let(:options) { { only_branches_matching: ['master'], ssh_key: 'KEY', known_hosts: 'KNOWN HOSTS', keep_divergent_refs: true } } subject(:remote_mirror) { described_class.new(repository, ref_name, **options) } it 'delegates to the Gitaly client' do expect(repository.gitaly_remote_client) .to receive(:update_remote_mirror) - .with(ref_name, ['master'], ssh_key: 'KEY', known_hosts: 'KNOWN HOSTS') + .with(ref_name, ['master'], ssh_key: 'KEY', known_hosts: 'KNOWN HOSTS', keep_divergent_refs: true) remote_mirror.update end diff --git a/spec/lib/gitlab/gitaly_client/remote_service_spec.rb b/spec/lib/gitlab/gitaly_client/remote_service_spec.rb index 2658414d9b0..2bddec739fc 100644 --- a/spec/lib/gitlab/gitaly_client/remote_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/remote_service_spec.rb @@ -66,7 +66,7 @@ describe Gitlab::GitalyClient::RemoteService do .with(kind_of(Enumerator), kind_of(Hash)) .and_return(double(:update_remote_mirror_response)) - client.update_remote_mirror(ref_name, only_branches_matching, ssh_key: ssh_key, known_hosts: known_hosts) + client.update_remote_mirror(ref_name, only_branches_matching, ssh_key: ssh_key, known_hosts: known_hosts, keep_divergent_refs: true) end end diff --git a/spec/models/award_emoji_spec.rb b/spec/models/award_emoji_spec.rb index b2d58dd95ad..8b370e80c9b 100644 --- a/spec/models/award_emoji_spec.rb +++ b/spec/models/award_emoji_spec.rb @@ -41,6 +41,22 @@ describe AwardEmoji do expect(new_award).to be_valid end + + # Similar to allowing duplicate award emojis for ghost users, + # when Importing a project that has duplicate award emoji placed by + # ghost user we change the author to be importer user and allow + # duplicates, otherwise relation containing such duplicates + # fails to be created + context 'when importing' do + it 'allows duplicate award emoji' do + user = create(:user) + issue = create(:issue) + create(:award_emoji, user: user, awardable: issue) + new_award = build(:award_emoji, user: user, awardable: issue, importing: true) + + expect(new_award).to be_valid + end + end end end diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 4ecbc671c72..cc1bb164c16 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -159,8 +159,7 @@ describe Issuable do end it 'returns issues with a partially matching description' do - expect(issuable_class.full_search(searchable_issue.description)) - .to eq([searchable_issue]) + expect(issuable_class.full_search('cut')).to eq([searchable_issue]) end it 'returns issues with a matching description regardless of the casing' do diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb index f5e718e0e09..15b162ae87a 100644 --- a/spec/models/remote_mirror_spec.rb +++ b/spec/models/remote_mirror_spec.rb @@ -142,6 +142,26 @@ describe RemoteMirror, :mailer do end end + describe '#update_repository' do + let(:git_remote_mirror) { spy } + + before do + stub_const('Gitlab::Git::RemoteMirror', git_remote_mirror) + end + + it 'includes the `keep_divergent_refs` setting' do + mirror = build_stubbed(:remote_mirror, keep_divergent_refs: true) + + mirror.update_repository({}) + + expect(git_remote_mirror).to have_received(:new).with( + anything, + mirror.remote_name, + hash_including(keep_divergent_refs: true) + ) + end + end + describe '#safe_url' do context 'when URL contains credentials' do it 'masks the credentials' do |