From fe30598cbd0756ba0c6326178f64b68e5ae8a30d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 8 Jun 2021 06:09:51 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../nav/components/top_nav_app.vue | 2 +- app/services/boards/base_item_move_service.rb | 9 +++--- app/views/layouts/nav/_top_nav.html.haml | 2 +- doc/api/graphql/reference/index.md | 7 ++-- .../secret_detection/index.md | 3 ++ lib/gitlab/git/conflict/resolver.rb | 4 +-- .../nav/components/top_nav_app_spec.js | 2 +- spec/lib/gitlab/git/conflict/resolver_spec.rb | 32 +++++++++++++++++++ 8 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 spec/lib/gitlab/git/conflict/resolver_spec.rb diff --git a/app/assets/javascripts/nav/components/top_nav_app.vue b/app/assets/javascripts/nav/components/top_nav_app.vue index d15fe9c65f9..9f825cb8fb8 100644 --- a/app/assets/javascripts/nav/components/top_nav_app.vue +++ b/app/assets/javascripts/nav/components/top_nav_app.vue @@ -22,7 +22,7 @@ export default { `boardId` | [`BoardsEpicBoardID!`](#boardsepicboardid) | Global ID of the board that the epic is in. | | `clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. | | `epicId` | [`EpicID!`](#epicid) | ID of the epic to mutate. | -| `fromListId` | [`BoardsEpicListID!`](#boardsepiclistid) | ID of the board list that the epic will be moved from. | -| `toListId` | [`BoardsEpicListID!`](#boardsepiclistid) | ID of the board list that the epic will be moved to. | +| `fromListId` | [`BoardsEpicListID`](#boardsepiclistid) | ID of the board list that the epic will be moved from. Required if moving between lists. | +| `moveAfterId` | [`EpicID`](#epicid) | ID of epic that should be placed after the current epic. | +| `moveBeforeId` | [`EpicID`](#epicid) | ID of epic that should be placed before the current epic. | +| `toListId` | [`BoardsEpicListID!`](#boardsepiclistid) | ID of the list the epic will be in after mutation. | #### Fields | Name | Type | Description | | ---- | ---- | ----------- | | `clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. | +| `epic` | [`Epic`](#epic) | The epic after mutation. | | `errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. | ### `Mutation.epicSetSubscription` diff --git a/doc/user/application_security/secret_detection/index.md b/doc/user/application_security/secret_detection/index.md index 758b06c46aa..bebb809f4f2 100644 --- a/doc/user/application_security/secret_detection/index.md +++ b/doc/user/application_security/secret_detection/index.md @@ -62,6 +62,9 @@ The [default ruleset provided by Gitleaks](https://gitlab.com/gitlab-org/securit - Password in URL - U.S. Social Security Number +WARNING: +Gitleaks does not support scanning binary files. + ## Requirements To run Secret Detection jobs, by default, you need GitLab Runner with the diff --git a/lib/gitlab/git/conflict/resolver.rb b/lib/gitlab/git/conflict/resolver.rb index 751184b23df..aa5d50d1fb1 100644 --- a/lib/gitlab/git/conflict/resolver.rb +++ b/lib/gitlab/git/conflict/resolver.rb @@ -18,9 +18,9 @@ module Gitlab def conflicts @conflicts ||= wrapped_gitaly_errors do gitaly_conflicts_client(@target_repository).list_conflict_files.to_a + rescue GRPC::FailedPrecondition => e + raise Gitlab::Git::Conflict::Resolver::ConflictSideMissing, e.message end - rescue GRPC::FailedPrecondition => e - raise Gitlab::Git::Conflict::Resolver::ConflictSideMissing, e.message rescue GRPC::BadStatus => e raise Gitlab::Git::CommandError, e end diff --git a/spec/frontend/nav/components/top_nav_app_spec.js b/spec/frontend/nav/components/top_nav_app_spec.js index 33fdb0c0c4f..1d6ea99155b 100644 --- a/spec/frontend/nav/components/top_nav_app_spec.js +++ b/spec/frontend/nav/components/top_nav_app_spec.js @@ -30,7 +30,7 @@ describe('~/nav/components/top_nav_app.vue', () => { it('renders nav item dropdown', () => { expect(findNavItemDropdown().attributes('href')).toBeUndefined(); expect(findNavItemDropdown().attributes()).toMatchObject({ - icon: 'dot-grid', + icon: 'hamburger', text: TEST_NAV_DATA.activeTitle, 'no-flip': '', }); diff --git a/spec/lib/gitlab/git/conflict/resolver_spec.rb b/spec/lib/gitlab/git/conflict/resolver_spec.rb new file mode 100644 index 00000000000..2783e955c33 --- /dev/null +++ b/spec/lib/gitlab/git/conflict/resolver_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Gitlab::Git::Conflict::Resolver do + let(:repository) { instance_double(Gitlab::Git::Repository) } + let(:our_commit_oid) { 'our-commit-oid' } + let(:their_commit_oid) { 'their-commit-oid' } + let(:gitaly_conflicts_client) { instance_double(Gitlab::GitalyClient::ConflictsService) } + + subject(:resolver) { described_class.new(repository, our_commit_oid, their_commit_oid) } + + describe '#conflicts' do + before do + allow(repository).to receive(:gitaly_conflicts_client).and_return(gitaly_conflicts_client) + end + + it 'returns list of conflicts' do + conflicts = [double] + + expect(gitaly_conflicts_client).to receive(:list_conflict_files).and_return(conflicts) + expect(resolver.conflicts).to eq(conflicts) + end + + context 'when GRPC::FailedPrecondition is raised' do + it 'rescues and raises Gitlab::Git::Conflict::Resolver::ConflictSideMissing' do + expect(gitaly_conflicts_client).to receive(:list_conflict_files).and_raise(GRPC::FailedPrecondition) + expect { resolver.conflicts }.to raise_error(Gitlab::Git::Conflict::Resolver::ConflictSideMissing) + end + end + end +end