Commit 99ddca0d authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent e1867c38
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import _ from 'underscore'; import _ from 'underscore';
import successSvg from 'icons/_icon_status_success.svg'; import successSvg from 'icons/_icon_status_success.svg';
import warningSvg from 'icons/_icon_status_warning.svg'; import warningSvg from 'icons/_icon_status_warning.svg';
import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge';
import simplePoll from '~/lib/utils/simple_poll'; import simplePoll from '~/lib/utils/simple_poll';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge';
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import MergeRequest from '../../../merge_request'; import MergeRequest from '../../../merge_request';
import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests'; import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests';
...@@ -26,6 +26,10 @@ export default { ...@@ -26,6 +26,10 @@ export default {
CommitEdit, CommitEdit,
CommitMessageDropdown, CommitMessageDropdown,
GlIcon, GlIcon,
MergeImmediatelyConfirmationDialog: () =>
import(
'ee_component/vue_merge_request_widget/components/merge_immediately_confirmation_dialog.vue'
),
}, },
mixins: [readyToMergeMixin], mixins: [readyToMergeMixin],
props: { props: {
...@@ -165,6 +169,16 @@ export default { ...@@ -165,6 +169,16 @@ export default {
new Flash(__('Something went wrong. Please try again.')); // eslint-disable-line new Flash(__('Something went wrong. Please try again.')); // eslint-disable-line
}); });
}, },
handleMergeImmediatelyButtonClick() {
if (this.isMergeImmediatelyDangerous) {
this.$refs.confirmationDialog.show();
} else {
this.handleMergeButtonClick(false, true);
}
},
onMergeImmediatelyConfirmation() {
this.handleMergeButtonClick(false, true);
},
initiateMergePolling() { initiateMergePolling() {
simplePoll( simplePoll(
(continuePolling, stopPolling) => { (continuePolling, stopPolling) => {
...@@ -286,11 +300,16 @@ export default { ...@@ -286,11 +300,16 @@ export default {
</a> </a>
</li> </li>
<li> <li>
<merge-immediately-confirmation-dialog
ref="confirmationDialog"
:docs-url="mr.mergeImmediatelyDocsPath"
@mergeImmediately="onMergeImmediatelyConfirmation"
/>
<a <a
class="accept-merge-request" class="accept-merge-request js-merge-immediately-button"
data-qa-selector="merge_immediately_option" data-qa-selector="merge_immediately_option"
href="#" href="#"
@click.prevent="handleMergeButtonClick(false, true)" @click.prevent="handleMergeImmediatelyButtonClick"
> >
<span class="media"> <span class="media">
<span class="merge-opt-icon" aria-hidden="true" v-html="warningSvg"></span> <span class="merge-opt-icon" aria-hidden="true" v-html="warningSvg"></span>
......
...@@ -23,5 +23,8 @@ export default { ...@@ -23,5 +23,8 @@ export default {
shouldShowMergeImmediatelyDropdown() { shouldShowMergeImmediatelyDropdown() {
return this.mr.isPipelineActive && !this.mr.onlyAllowMergeIfPipelineSucceeds; return this.mr.isPipelineActive && !this.mr.onlyAllowMergeIfPipelineSucceeds;
}, },
isMergeImmediatelyDangerous() {
return false;
},
}, },
}; };
...@@ -173,6 +173,7 @@ export default class MergeRequestStore { ...@@ -173,6 +173,7 @@ export default class MergeRequestStore {
this.ciEnvironmentsStatusPath = data.ci_environments_status_path; this.ciEnvironmentsStatusPath = data.ci_environments_status_path;
this.securityApprovalsHelpPagePath = data.security_approvals_help_page_path; this.securityApprovalsHelpPagePath = data.security_approvals_help_page_path;
this.eligibleApproversDocsPath = data.eligible_approvers_docs_path; this.eligibleApproversDocsPath = data.eligible_approvers_docs_path;
this.mergeImmediatelyDocsPath = data.merge_immediately_docs_path;
} }
get isNothingToMergeState() { get isNothingToMergeState() {
......
---
title: Add warning dialog when users click the "Merge immediately" merge train option
merge_request: 20054
author:
type: added
...@@ -14,7 +14,7 @@ The Packages feature allows GitLab to act as a repository for the following: ...@@ -14,7 +14,7 @@ The Packages feature allows GitLab to act as a repository for the following:
Don't you see your package management system supported yet? Don't you see your package management system supported yet?
Please consider contributing Please consider contributing
to GitLab. This [development documentation](../../development/packages.md) will guide you through the process. to GitLab. This [development documentation](../../development/packages.md) will guide you through the process, it includes a list of [suggested contributions](../../development/packages.md#suggested-contributions).
## Enabling the Packages feature ## Enabling the Packages feature
......
---
type: reference, howto
---
# Security Configuration **(ULTIMATE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/20711) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.6.
## Overview
The security configuration page displays the configuration state of each of the security
features and can be accessed through a project's sidebar nav.
![Screenshot of security configuration page](../img/security_configuration_page_v12_6.png)
The page uses the project's latest default branch [CI pipeline](../../../ci/pipelines.md) to determine the configuration
state of each feature. If a job with the expected security report artifact exists in the pipeline,
the feature is considered configured.
NOTE: **Note:** if the latest pipeline used [Auto DevOps](../../../topics/autodevops/index.md),
all security features will be configured by default.
## Limitations
It is not possible to enable or disable a feature using the configuration page.
However, instructions on how to enable or disable a feature can be found through
the links next to each feature on that page.
...@@ -115,7 +115,7 @@ module API ...@@ -115,7 +115,7 @@ module API
end end
get ":id/services/:service_slug" do get ":id/services/:service_slug" do
service = user_project.find_or_initialize_service(params[:service_slug].underscore) service = user_project.find_or_initialize_service(params[:service_slug].underscore)
present service, with: Entities::ProjectService, include_passwords: current_user.admin? present service, with: Entities::ProjectService
end end
end end
......
...@@ -14,7 +14,7 @@ module Gitlab ...@@ -14,7 +14,7 @@ module Gitlab
signup_flow: { signup_flow: {
feature_toggle: :experimental_separate_sign_up_flow, feature_toggle: :experimental_separate_sign_up_flow,
environment: ::Gitlab.dev_env_or_com?, environment: ::Gitlab.dev_env_or_com?,
enabled_ratio: 0.5, enabled_ratio: 1,
tracking_category: 'Growth::Acquisition::Experiment::SignUpFlow' tracking_category: 'Growth::Acquisition::Experiment::SignUpFlow'
} }
}.freeze }.freeze
......
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
# @example # @example
# bundle exec rake "gitlab:import_export:import[root, root, imported_project, /path/to/file.tar.gz]" # bundle exec rake "gitlab:import_export:import[root, root, imported_project, /path/to/file.tar.gz]"
# #
require 'sidekiq/testing'
namespace :gitlab do namespace :gitlab do
namespace :import_export do namespace :import_export do
desc 'EXPERIMENTAL | Import large project archives' desc 'EXPERIMENTAL | Import large project archives'
task :import, [:username, :namespace_path, :project_path, :archive_path] => :gitlab_environment do |_t, args| task :import, [:username, :namespace_path, :project_path, :archive_path] => :gitlab_environment do |_t, args|
# Load it here to avoid polluting Rake tasks with Sidekiq test warnings
require 'sidekiq/testing'
warn_user_is_not_gitlab warn_user_is_not_gitlab
if ENV['IMPORT_DEBUG'].present? if ENV['IMPORT_DEBUG'].present?
......
...@@ -2041,6 +2041,9 @@ msgstr "" ...@@ -2041,6 +2041,9 @@ msgstr ""
msgid "Are you sure you want to lose your issue information?" msgid "Are you sure you want to lose your issue information?"
msgstr "" msgstr ""
msgid "Are you sure you want to merge immediately?"
msgstr ""
msgid "Are you sure you want to permanently delete this license?" msgid "Are you sure you want to permanently delete this license?"
msgstr "" msgstr ""
...@@ -11004,6 +11007,9 @@ msgstr "" ...@@ -11004,6 +11007,9 @@ msgstr ""
msgid "Merges this merge request when the pipeline succeeds." msgid "Merges this merge request when the pipeline succeeds."
msgstr "" msgstr ""
msgid "Merging immediately isn't recommended as it may negatively impact the existing merge train. Read the %{docsLinkStart}documentation%{docsLinkEnd} for more information."
msgstr ""
msgid "Messages" msgid "Messages"
msgstr "" msgstr ""
......
import Vue from 'vue'; import Vue from 'vue';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import ReadyToMerge from '~/vue_merge_request_widget/components/states/ready_to_merge.vue'; import ReadyToMerge from '~/vue_merge_request_widget/components/states/ready_to_merge.vue';
import SquashBeforeMerge from '~/vue_merge_request_widget/components/states/squash_before_merge.vue'; import SquashBeforeMerge from '~/vue_merge_request_widget/components/states/squash_before_merge.vue';
import CommitsHeader from '~/vue_merge_request_widget/components/states/commits_header.vue'; import CommitsHeader from '~/vue_merge_request_widget/components/states/commits_header.vue';
import CommitEdit from '~/vue_merge_request_widget/components/states/commit_edit.vue'; import CommitEdit from '~/vue_merge_request_widget/components/states/commit_edit.vue';
import CommitMessageDropdown from '~/vue_merge_request_widget/components/states/commit_message_dropdown.vue'; import CommitMessageDropdown from '~/vue_merge_request_widget/components/states/commit_message_dropdown.vue';
import eventHub from '~/vue_merge_request_widget/event_hub'; import eventHub from '~/vue_merge_request_widget/event_hub';
import { createLocalVue, shallowMount } from '@vue/test-utils';
import { MWPS_MERGE_STRATEGY, MTWPS_MERGE_STRATEGY } from '~/vue_merge_request_widget/constants'; import { MWPS_MERGE_STRATEGY, MTWPS_MERGE_STRATEGY } from '~/vue_merge_request_widget/constants';
const commitMessage = 'This is the commit message'; const commitMessage = 'This is the commit message';
...@@ -288,6 +288,12 @@ describe('ReadyToMerge', () => { ...@@ -288,6 +288,12 @@ describe('ReadyToMerge', () => {
expect(vm.isMergeButtonDisabled).toBe(true); expect(vm.isMergeButtonDisabled).toBe(true);
}); });
}); });
describe('isMergeImmediatelyDangerous', () => {
it('should always return false in CE', () => {
expect(vm.isMergeImmediatelyDangerous).toBe(false);
});
});
}); });
describe('methods', () => { describe('methods', () => {
......
...@@ -4,7 +4,6 @@ require "spec_helper" ...@@ -4,7 +4,6 @@ require "spec_helper"
describe API::Services do describe API::Services do
set(:user) { create(:user) } set(:user) { create(:user) }
set(:admin) { create(:admin) }
set(:user2) { create(:user) } set(:user2) { create(:user) }
set(:project) do set(:project) do
...@@ -88,14 +87,7 @@ describe API::Services do ...@@ -88,14 +87,7 @@ describe API::Services do
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it "returns all properties of service #{service} when authenticated as admin" do it "returns all properties of service #{service}" do
get api("/projects/#{project.id}/services/#{dashed_service}", admin)
expect(response).to have_gitlab_http_status(200)
expect(json_response['properties'].keys).to match_array(service_instance.api_field_names)
end
it "returns properties of service #{service} other than passwords when authenticated as project owner" do
get api("/projects/#{project.id}/services/#{dashed_service}", user) get api("/projects/#{project.id}/services/#{dashed_service}", user)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment