summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-26 12:06:18 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-26 12:06:18 +0000
commit6a4ffad42050949fcf08e78147575734ae99627e (patch)
tree723bb2480948ba4ec29ca9ac10f8728dc2a831b6
parent23d237110e6a646dec08e1f5b4696d2d9c51cfef (diff)
downloadgitlab-ce-6a4ffad42050949fcf08e78147575734ae99627e.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab/ci/reports.gitlab-ci.yml4
-rw-r--r--app/assets/javascripts/performance_bar/components/performance_bar_app.vue12
-rw-r--r--app/assets/javascripts/performance_bar/components/request_selector.vue12
-rw-r--r--app/assets/javascripts/performance_bar/stores/performance_bar_store.js19
-rw-r--r--app/controllers/concerns/service_params.rb1
-rw-r--r--app/helpers/services_helper.rb20
-rw-r--r--app/models/project_services/jira_service.rb26
-rw-r--r--app/models/service.rb8
-rw-r--r--app/services/merge_requests/push_options_handler_service.rb43
-rw-r--r--app/views/import/gitlab_projects/new.html.haml1
-rw-r--r--app/views/shared/_service_settings.html.haml18
-rw-r--r--changelogs/unreleased/20321-optional-only-jira-issue-link-on-gitlab-commit-no-jira-comment.yml5
-rw-r--r--changelogs/unreleased/24804-import-page-namespace-fix.yml5
-rw-r--r--changelogs/unreleased/36924-cablett-epic-tree-permissions.yml5
-rw-r--r--changelogs/unreleased/bvl-fix-merging-through-push-options.yml5
-rw-r--r--changelogs/unreleased/wc-perf-bar-download.yml5
-rw-r--r--db/migrate/20191023093207_add_comment_actions_to_services.rb17
-rw-r--r--db/schema.rb1
-rw-r--r--doc/administration/monitoring/performance/img/performance_bar.pngbin71317 -> 58439 bytes
-rw-r--r--doc/administration/monitoring/performance/performance_bar.md1
-rw-r--r--doc/administration/pages/index.md17
-rw-r--r--doc/policy/maintenance.md4
-rw-r--r--doc/user/gitlab_com/index.md1
-rw-r--r--doc/user/project/clusters/add_remove_clusters.md42
-rw-r--r--doc/user/project/integrations/jira.md11
-rw-r--r--doc/user/project/repository/repository_mirroring.md15
-rw-r--r--lib/api/helpers/services_helpers.rb6
-rw-r--r--locale/gitlab.pot36
-rw-r--r--spec/frontend/performance_bar/components/request_selector_spec.js41
-rw-r--r--spec/frontend/performance_bar/stores/performance_bar_store_spec.js45
-rw-r--r--spec/helpers/services_helper_spec.rb15
-rw-r--r--spec/javascripts/test_bundle.js5
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
-rw-r--r--spec/models/project_services/jira_service_spec.rb10
-rw-r--r--spec/services/merge_requests/push_options_handler_service_spec.rb8
-rw-r--r--spec/views/import/gitlab_projects/new.html.haml_spec.rb31
36 files changed, 387 insertions, 109 deletions
diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml
index fbb7826b6f2..003a94bf4ad 100644
--- a/.gitlab/ci/reports.gitlab-ci.yml
+++ b/.gitlab/ci/reports.gitlab-ci.yml
@@ -20,6 +20,7 @@ code_quality:
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
+ CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:12-5-stable"
script:
- |
if ! docker info &>/dev/null; then
@@ -27,11 +28,12 @@ code_quality:
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
+ - docker pull --quiet "$CODE_QUALITY_IMAGE"
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
- "registry.gitlab.com/gitlab-org/security-products/codequality:12-0-stable" /code
+ "$CODE_QUALITY_IMAGE" /code
artifacts:
reports:
codequality: gl-code-quality-report.json
diff --git a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue
index 8ce653bf1fb..a0272b148e3 100644
--- a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue
+++ b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue
@@ -80,6 +80,15 @@ export default {
}
return '';
},
+ downloadPath() {
+ const data = JSON.stringify(this.requests);
+ const blob = new Blob([data], { type: 'text/plain' });
+ return window.URL.createObjectURL(blob);
+ },
+ downloadName() {
+ const fileName = this.requests[0].truncatedUrl;
+ return `${fileName}_perf_bar_${Date.now()}.json`;
+ },
},
mounted() {
this.currentRequest = this.requestId;
@@ -121,6 +130,9 @@ export default {
<a :href="currentRequest.details.tracing.tracing_url">{{ s__('PerformanceBar|trace') }}</a>
</div>
<add-request v-on="$listeners" />
+ <div v-if="currentRequest.details" id="peek-download" class="view">
+ <a :download="downloadName" :href="downloadPath">{{ s__('PerformanceBar|Download') }}</a>
+ </div>
<request-selector
v-if="currentRequest"
:current-request="currentRequest"
diff --git a/app/assets/javascripts/performance_bar/components/request_selector.vue b/app/assets/javascripts/performance_bar/components/request_selector.vue
index 793aba3189b..75ec924ef64 100644
--- a/app/assets/javascripts/performance_bar/components/request_selector.vue
+++ b/app/assets/javascripts/performance_bar/components/request_selector.vue
@@ -40,16 +40,6 @@ export default {
},
},
methods: {
- truncatedUrl(requestUrl) {
- const components = requestUrl.replace(/\/$/, '').split('/');
- let truncated = components[components.length - 1];
-
- if (truncated.match(/^\d+$/)) {
- truncated = `${components[components.length - 2]}/${truncated}`;
- }
-
- return truncated;
- },
glEmojiTag,
},
};
@@ -63,7 +53,7 @@ export default {
:value="request.id"
class="qa-performance-bar-request"
>
- {{ truncatedUrl(request.url) }}
+ {{ request.truncatedUrl }}
<span v-if="request.hasWarnings">(!)</span>
</option>
</select>
diff --git a/app/assets/javascripts/performance_bar/stores/performance_bar_store.js b/app/assets/javascripts/performance_bar/stores/performance_bar_store.js
index 64f4f5e0c76..12d0ee86218 100644
--- a/app/assets/javascripts/performance_bar/stores/performance_bar_store.js
+++ b/app/assets/javascripts/performance_bar/stores/performance_bar_store.js
@@ -5,9 +5,12 @@ export default class PerformanceBarStore {
addRequest(requestId, requestUrl) {
if (!this.findRequest(requestId)) {
+ const shortUrl = PerformanceBarStore.truncateUrl(requestUrl);
+
this.requests.push({
id: requestId,
url: requestUrl,
+ truncatedUrl: shortUrl,
details: {},
hasWarnings: false,
});
@@ -36,4 +39,20 @@ export default class PerformanceBarStore {
canTrackRequest(requestUrl) {
return this.requests.filter(request => request.url === requestUrl).length < 2;
}
+
+ static truncateUrl(requestUrl) {
+ const [rootAndQuery] = requestUrl.split('#');
+ const [root, query] = rootAndQuery.split('?');
+ const components = root.replace(/\/$/, '').split('/');
+
+ let truncated = components[components.length - 1];
+ if (truncated.match(/^\d+$/)) {
+ truncated = `${components[components.length - 2]}/${truncated}`;
+ }
+ if (query) {
+ truncated += `?${query}`;
+ }
+
+ return truncated;
+ }
}
diff --git a/app/controllers/concerns/service_params.rb b/app/controllers/concerns/service_params.rb
index fd9d5fad38e..3ccf227c431 100644
--- a/app/controllers/concerns/service_params.rb
+++ b/app/controllers/concerns/service_params.rb
@@ -18,6 +18,7 @@ module ServiceParams
:channels,
:color,
:colorize_messages,
+ :comment_on_event_enabled,
:confidential_issues_events,
:default_irc_uri,
:description,
diff --git a/app/helpers/services_helper.rb b/app/helpers/services_helper.rb
index 19a27ba3499..caef6dba212 100644
--- a/app/helpers/services_helper.rb
+++ b/app/helpers/services_helper.rb
@@ -31,6 +31,26 @@ module ServicesHelper
"#{event}_events"
end
+ def service_event_action_field_name(action)
+ "#{action}_on_event_enabled"
+ end
+
+ def event_action_title(action)
+ case action
+ when "comment"
+ s_("ProjectService|Comment")
+ else
+ action.humanize
+ end
+ end
+
+ def event_action_description(action)
+ case action
+ when "comment"
+ s_("ProjectService|Comment will be posted on each event")
+ end
+ end
+
def service_save_button(service)
button_tag(class: 'btn btn-success', type: 'submit', disabled: service.deprecated?, data: { qa_selector: 'save_changes_button' }) do
icon('spinner spin', class: 'hidden js-btn-spinner') +
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index ba61810e26f..128cbc6fa82 100644
--- a/app/models/project_services/jira_service.rb
+++ b/app/models/project_services/jira_service.rb
@@ -32,6 +32,10 @@ class JiraService < IssueTrackerService
%w(commit merge_request)
end
+ def self.supported_event_actions
+ %w(comment)
+ end
+
# {PROJECT-KEY}-{NUMBER} Examples: JIRA-1, PROJECT-1
def self.reference_pattern(only_long: true)
@reference_pattern ||= /(?<issue>\b#{Gitlab::Regex.jira_issue_key_regex})/
@@ -268,19 +272,27 @@ class JiraService < IssueTrackerService
return unless client_url.present?
jira_request do
- remote_link = find_remote_link(issue, remote_link_props[:object][:url])
- if remote_link
- remote_link.save!(remote_link_props)
- elsif issue.comments.build.save!(body: message)
- new_remote_link = issue.remotelink.build
- new_remote_link.save!(remote_link_props)
- end
+ create_issue_link(issue, remote_link_props)
+ create_issue_comment(issue, message)
log_info("Successfully posted", client_url: client_url)
"SUCCESS: Successfully posted to #{client_url}."
end
end
+ def create_issue_link(issue, remote_link_props)
+ remote_link = find_remote_link(issue, remote_link_props[:object][:url])
+ remote_link ||= issue.remotelink.build
+
+ remote_link.save!(remote_link_props)
+ end
+
+ def create_issue_comment(issue, message)
+ return unless comment_on_event_enabled
+
+ issue.comments.build.save!(body: message)
+ end
+
def find_remote_link(issue, url)
links = jira_request { issue.remotelink.all }
return unless links
diff --git a/app/models/service.rb b/app/models/service.rb
index 6d5b974dd31..08936f7fcbd 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -155,6 +155,14 @@ class Service < ApplicationRecord
end
end
+ def configurable_event_actions
+ self.class.supported_event_actions
+ end
+
+ def self.supported_event_actions
+ %w()
+ end
+
def supported_events
self.class.supported_events
end
diff --git a/app/services/merge_requests/push_options_handler_service.rb b/app/services/merge_requests/push_options_handler_service.rb
index 0168b31005e..821558b8d6f 100644
--- a/app/services/merge_requests/push_options_handler_service.rb
+++ b/app/services/merge_requests/push_options_handler_service.rb
@@ -4,14 +4,14 @@ module MergeRequests
class PushOptionsHandlerService
LIMIT = 10
- attr_reader :branches, :changes_by_branch, :current_user, :errors,
+ attr_reader :current_user, :errors, :changes,
:project, :push_options, :target_project
def initialize(project, current_user, changes, push_options)
@project = project
@target_project = @project.default_merge_request_target
@current_user = current_user
- @branches = get_branches(changes)
+ @changes = Gitlab::ChangesList.new(changes)
@push_options = push_options
@errors = []
end
@@ -34,8 +34,12 @@ module MergeRequests
private
- def get_branches(raw_changes)
- Gitlab::ChangesList.new(raw_changes).map do |changes|
+ def branches
+ changes_by_branch.keys
+ end
+
+ def changes_by_branch
+ @changes_by_branch ||= changes.each_with_object({}) do |changes, result|
next unless Gitlab::Git.branch_ref?(changes[:ref])
# Deleted branch
@@ -45,8 +49,8 @@ module MergeRequests
branch_name = Gitlab::Git.branch_name(changes[:ref])
next if branch_name == target_project.default_branch
- branch_name
- end.compact.uniq
+ result[branch_name] = changes
+ end
end
def validate_service
@@ -101,7 +105,7 @@ module MergeRequests
project,
current_user,
merge_request.attributes.merge(assignees: merge_request.assignees,
- label_ids: merge_request.label_ids)
+ label_ids: merge_request.label_ids)
).execute
end
@@ -112,7 +116,7 @@ module MergeRequests
merge_request = ::MergeRequests::UpdateService.new(
target_project,
current_user,
- update_params
+ update_params(merge_request)
).execute(merge_request)
collect_errors_from_merge_request(merge_request) unless merge_request.valid?
@@ -130,19 +134,22 @@ module MergeRequests
params.compact!
- if push_options.key?(:merge_when_pipeline_succeeds)
- params.merge!(
- merge_when_pipeline_succeeds: push_options[:merge_when_pipeline_succeeds],
- merge_user: current_user
- )
- end
-
params[:add_labels] = params.delete(:label).keys if params.has_key?(:label)
params[:remove_labels] = params.delete(:unlabel).keys if params.has_key?(:unlabel)
params
end
+ def merge_params(branch)
+ return {} unless push_options.key?(:merge_when_pipeline_succeeds)
+
+ {
+ merge_when_pipeline_succeeds: push_options[:merge_when_pipeline_succeeds],
+ merge_user: current_user,
+ sha: changes_by_branch.dig(branch, :newrev)
+ }
+ end
+
def create_params(branch)
params = base_params
@@ -153,13 +160,15 @@ module MergeRequests
target_project: target_project
)
+ params.merge!(merge_params(branch))
+
params[:target_branch] ||= target_project.default_branch
params
end
- def update_params
- base_params
+ def update_params(merge_request)
+ base_params.merge(merge_params(merge_request.source_branch))
end
def collect_errors_from_merge_request(merge_request)
diff --git a/app/views/import/gitlab_projects/new.html.haml b/app/views/import/gitlab_projects/new.html.haml
index a19c8911559..feebbccf46a 100644
--- a/app/views/import/gitlab_projects/new.html.haml
+++ b/app/views/import/gitlab_projects/new.html.haml
@@ -14,7 +14,6 @@
= _("To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here.")
.row
.form-group.col-sm-12
- = hidden_field_tag :namespace_id, @namespace.id
= label_tag :file, _('GitLab project export'), class: 'label-bold'
.form-group
= file_field_tag :file, class: ''
diff --git a/app/views/shared/_service_settings.html.haml b/app/views/shared/_service_settings.html.haml
index 627a1eb6eae..1bf52feab11 100644
--- a/app/views/shared/_service_settings.html.haml
+++ b/app/views/shared/_service_settings.html.haml
@@ -16,7 +16,7 @@
- if @service.configurable_events.present?
.form-group.row
- .col-sm-2.text-right Trigger
+ %label.col-form-label.col-sm-2= _('Trigger')
.col-sm-10
- @service.configurable_events.each do |event|
@@ -35,6 +35,22 @@
%p.text-muted
= @service.class.event_description(event)
+ - if @service.configurable_event_actions.present?
+ .form-group.row
+ %label.col-form-label.col-sm-2= _('Event Actions')
+
+ .col-sm-10
+ - @service.configurable_event_actions.each do |action|
+ .form-group
+ .form-check
+ = form.check_box service_event_action_field_name(action), class: 'form-check-input'
+ = form.label service_event_action_field_name(action), class: 'form-check-label' do
+ %strong
+ = event_action_description(action)
+
+ %p.text-muted
+ = event_action_description(action)
+
- @service.global_fields.each do |field|
- type = field[:type]
diff --git a/changelogs/unreleased/20321-optional-only-jira-issue-link-on-gitlab-commit-no-jira-comment.yml b/changelogs/unreleased/20321-optional-only-jira-issue-link-on-gitlab-commit-no-jira-comment.yml
new file mode 100644
index 00000000000..df4ce8200a6
--- /dev/null
+++ b/changelogs/unreleased/20321-optional-only-jira-issue-link-on-gitlab-commit-no-jira-comment.yml
@@ -0,0 +1,5 @@
+---
+title: Add ability to make Jira comments optional
+merge_request: 19004
+author:
+type: added
diff --git a/changelogs/unreleased/24804-import-page-namespace-fix.yml b/changelogs/unreleased/24804-import-page-namespace-fix.yml
new file mode 100644
index 00000000000..bf1449d1626
--- /dev/null
+++ b/changelogs/unreleased/24804-import-page-namespace-fix.yml
@@ -0,0 +1,5 @@
+---
+title: Fixed project import from export ignoring namespace selection
+merge_request: 20405
+author:
+type: fixed
diff --git a/changelogs/unreleased/36924-cablett-epic-tree-permissions.yml b/changelogs/unreleased/36924-cablett-epic-tree-permissions.yml
new file mode 100644
index 00000000000..ae144c77823
--- /dev/null
+++ b/changelogs/unreleased/36924-cablett-epic-tree-permissions.yml
@@ -0,0 +1,5 @@
+---
+title: Fix removing of child epics that belong to subgroups
+merge_request: 20610
+author:
+type: fixed
diff --git a/changelogs/unreleased/bvl-fix-merging-through-push-options.yml b/changelogs/unreleased/bvl-fix-merging-through-push-options.yml
new file mode 100644
index 00000000000..cacf34a52ed
--- /dev/null
+++ b/changelogs/unreleased/bvl-fix-merging-through-push-options.yml
@@ -0,0 +1,5 @@
+---
+title: Fix merging merge requests from push options
+merge_request: 20639
+author:
+type: fixed
diff --git a/changelogs/unreleased/wc-perf-bar-download.yml b/changelogs/unreleased/wc-perf-bar-download.yml
new file mode 100644
index 00000000000..056e0ec63f6
--- /dev/null
+++ b/changelogs/unreleased/wc-perf-bar-download.yml
@@ -0,0 +1,5 @@
+---
+title: Add 'download' button to Performance Bar
+merge_request: 20205
+author: Will Chandler
+type: changed
diff --git a/db/migrate/20191023093207_add_comment_actions_to_services.rb b/db/migrate/20191023093207_add_comment_actions_to_services.rb
new file mode 100644
index 00000000000..f3fc12ac7c7
--- /dev/null
+++ b/db/migrate/20191023093207_add_comment_actions_to_services.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddCommentActionsToServices < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:services, :comment_on_event_enabled, :boolean, default: true)
+ end
+
+ def down
+ remove_column(:services, :comment_on_event_enabled)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 9dccceb79f0..2de76973ca7 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -3577,6 +3577,7 @@ ActiveRecord::Schema.define(version: 2019_11_24_150431) do
t.boolean "confidential_note_events", default: true
t.boolean "deployment_events", default: false, null: false
t.string "description", limit: 500
+ t.boolean "comment_on_event_enabled", default: true, null: false
t.index ["project_id"], name: "index_services_on_project_id"
t.index ["template"], name: "index_services_on_template"
t.index ["type"], name: "index_services_on_type"
diff --git a/doc/administration/monitoring/performance/img/performance_bar.png b/doc/administration/monitoring/performance/img/performance_bar.png
index acad60f863e..73f2ccbe4bb 100644
--- a/doc/administration/monitoring/performance/img/performance_bar.png
+++ b/doc/administration/monitoring/performance/img/performance_bar.png
Binary files differ
diff --git a/doc/administration/monitoring/performance/performance_bar.md b/doc/administration/monitoring/performance/performance_bar.md
index a52b6227e14..caddc87d8c1 100644
--- a/doc/administration/monitoring/performance/performance_bar.md
+++ b/doc/administration/monitoring/performance/performance_bar.md
@@ -19,6 +19,7 @@ It allows you to see (from left to right):
- a link to add a request's details to the performance bar; the request can be
added by its full URL (authenticated as the current user), or by the value of
its `X-Request-Id` header
+- a link to download the raw JSON used to generate the Performance Bar reports
On the far right is a request selector that allows you to view the same metrics
(excluding the page timing and line profiler) for any requests made while the
diff --git a/doc/administration/pages/index.md b/doc/administration/pages/index.md
index f51c375860b..eb3fc07d7c9 100644
--- a/doc/administration/pages/index.md
+++ b/doc/administration/pages/index.md
@@ -321,6 +321,23 @@ pages:
1. [Reconfigure GitLab][reconfigure] for the changes to take effect.
+### Using a custom Certificate Authority (CA) with Access Control
+
+When using certificates issued by a custom CA, Access Control on GitLab Pages may fail to work if the custom CA is not recognized.
+
+This usually results in this error:
+`Post /oauth/token: x509: certificate signed by unknown authority`.
+
+For GitLab Pages Access Control with TLS/SSL certs issued by an internal or custom CA:
+
+1. Copy the certificate bundle to `/opt/gitlab/embedded/ssl/certs/` in `.pem` format.
+
+1. [Restart](../restart_gitlab.md) the GitLab Pages Daemon. For GitLab Omnibus instances:
+
+ ```bash
+ sudo gitlab-ctl restart gitlab-pages
+ ```
+
## Activate verbose logging for daemon
Verbose logging was [introduced](https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/2533) in
diff --git a/doc/policy/maintenance.md b/doc/policy/maintenance.md
index ef94236d711..49f2b61a497 100644
--- a/doc/policy/maintenance.md
+++ b/doc/policy/maintenance.md
@@ -48,8 +48,8 @@ incremental upgrades (and installations) are as simple as possible.
review process a new change goes through.
1. Ensuring that tests pass on older release is a considerable challenge in some cases, and as such is very time consuming.
-Including new features in patch releases is not possible as that would break [Semantic Versioning].
-Breaking [Semantic Versioning] has the following consequences for users that
+Including new features in patch releases is not possible as that would break [Semantic Versioning](https://semver.org/).
+Breaking [Semantic Versioning](https://semver.org/) has the following consequences for users that
have to adhere to various internal requirements (e.g. org. compliance, verifying new features and similar):
1. Inability to quickly upgrade to leverage bug fixes included in patch versions.
diff --git a/doc/user/gitlab_com/index.md b/doc/user/gitlab_com/index.md
index 5912fc8e9f9..38ffd07a737 100644
--- a/doc/user/gitlab_com/index.md
+++ b/doc/user/gitlab_com/index.md
@@ -63,6 +63,7 @@ Below are the current settings regarding [GitLab CI/CD](../../ci/README.md).
| ----------- | ----------------- | ------------- |
| Artifacts maximum size (uncompressed) | 1G | 100M |
| Artifacts [expiry time](../../ci/yaml/README.md#artifactsexpire_in) | kept forever | deleted after 30 days unless otherwise specified |
+| Scheduled Pipeline Cron | `*/5 * * * *` | `*/19 * * * *` |
## Repository size limit
diff --git a/doc/user/project/clusters/add_remove_clusters.md b/doc/user/project/clusters/add_remove_clusters.md
index c73368fbbd2..ad5a0c2273b 100644
--- a/doc/user/project/clusters/add_remove_clusters.md
+++ b/doc/user/project/clusters/add_remove_clusters.md
@@ -34,7 +34,7 @@ namespace.
This service account will be:
-- Added to the installed Helm Tiller
+- Added to the installed Helm Tiller.
- Used by Helm to install and run [GitLab managed applications](index.md#installing-applications).
Helm will also create additional service accounts and other resources for each
@@ -111,6 +111,11 @@ If you don't want to use GitLab Runner in privileged mode, either:
## Add new cluster
+New clusters can be added using GitLab for:
+
+- Google Kubernetes Engine.
+- Amazon Elastic Kubernetes Service.
+
### GKE cluster
GitLab supports:
@@ -206,43 +211,30 @@ GitLab supports:
Before creating your first cluster on Amazon EKS with GitLab's integration,
make sure the following requirements are met:
-- Enable the `create_eks_clusters` feature flag for your GitLab instance.
+- Self-managed GitLab instances have the `create_eks_clusters` feature flag enabled.
- An [Amazon Web Services](https://aws.amazon.com/) account is set up and you are able to log in.
- You have permissions to manage IAM resources.
-#### Enable the `create_eks_clusters` feature flag **(CORE ONLY)**
-
-NOTE: **Note:**
-If you are running a self-managed instance, EKS cluster creation will not be available
-unless the feature flag `create_eks_clusters` is enabled. This can be done from the Rails console
-by instance administrators.
-
-Use these commands to start the Rails console:
+##### Enable the `create_eks_clusters` feature flag **(CORE ONLY)**
-```sh
-# Omnibus GitLab
-gitlab-rails console
+Self-managed instances must have the feature flag `create_eks_clusters` enabled to create
+EKS clusters. To enable EKS cluster creation, ask a GitLab administrator with Rails console access
+to run the following command:
-# Installation from source
-cd /home/git/gitlab
-sudo -u git -H bin/rails console RAILS_ENV=production
-```
-
-Then run the following command to enable the feature flag:
-
-```
+```ruby
Feature.enable(:create_eks_clusters)
```
-You can also enable the feature flag only for specific projects with:
+To have it enabled for a specific project only, ask a GitLab administrator to run the following
+command using a Rails console:
-```
+```ruby
Feature.enable(:create_eks_clusters, Project.find_by_full_path('my_group/my_project'))
```
-Run the following command to disable the feature flag:
+To have this feature disabled, ask a GitLab administrator to run the following command:
-```
+```ruby
Feature.disable(:create_eks_clusters)
```
diff --git a/doc/user/project/integrations/jira.md b/doc/user/project/integrations/jira.md
index 874a1092b73..d08c8699eba 100644
--- a/doc/user/project/integrations/jira.md
+++ b/doc/user/project/integrations/jira.md
@@ -20,7 +20,7 @@ Here's how the integration responds when you take the following actions in GitLa
- **Mention a Jira issue ID** in a commit message or MR (merge request).
- GitLab hyperlinks to the Jira issue.
- The Jira issue adds an issue link to the commit/MR in GitLab.
- - The Jira issue adds a comment reflecting the comment made in GitLab, the comment author, and a link to the commit/MR in GitLab.
+ - The Jira issue adds a comment reflecting the comment made in GitLab, the comment author, and a link to the commit/MR in GitLab, unless this commenting to Jira is [disabled](#disabling-comments-on-jira-issues).
- **Mention that a commit or MR 'closes', 'resolves', or 'fixes' a Jira issue ID**. When the commit is made on the project's default branch (usually master) or the change is merged to the default branch:
- GitLab's merge request page displays a note that it "Closed" the Jira issue, with a link to the issue. (Note: Before the merge, an MR will display that it "Closes" the Jira issue.)
- The Jira issue shows the activity and the Jira issue is closed, or otherwise transitioned.
@@ -95,6 +95,15 @@ with all Jira projects in your Jira instance and you'll see the Jira link on the
![Jira service page](img/jira_service_page_v12_2.png)
+### Disabling comments on Jira issues
+
+When you reference a Jira issue, it will always link back to the source commit/MR in GitLab, however, you can control whether GitLab will also cross-post a comment to the Jira issue. That functionality is enabled by default.
+
+To disable the automated commenting on Jira issues:
+
+1. Open the [Integrations page](project_services.md#accessing-the-project-services) and select **Jira**.
+1. In the **Event Action** section, uncheck **Comment**.
+
## Jira issues
By now you should have [configured Jira](#configuring-jira) and enabled the
diff --git a/doc/user/project/repository/repository_mirroring.md b/doc/user/project/repository/repository_mirroring.md
index a682983ab83..7d49aecb603 100644
--- a/doc/user/project/repository/repository_mirroring.md
+++ b/doc/user/project/repository/repository_mirroring.md
@@ -143,6 +143,7 @@ Changes pushed to the upstream repository will be pulled into the GitLab reposit
CAUTION: **Caution:**
If you do manually update a branch in the GitLab repository, the branch will become diverged from
upstream and GitLab will no longer automatically update this branch to prevent any changes from being lost.
+Also note that deleted branches and tags in the upstream repository will not be reflected in the GitLab repository.
### How it works
@@ -247,6 +248,10 @@ If you need to change the key at any time, you can remove and re-add the mirror
to generate a new key. You'll have to update the other repository with the new
key to keep the mirror running.
+NOTE: **Note:**
+The generated keys are stored in the GitLab database, not in the filesystem. Therefore,
+SSH public key authentication for mirrors cannot be used in a pre-receive hook.
+
### Overwrite diverged branches **(STARTER)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/merge_requests/4559) in [GitLab Starter](https://about.gitlab.com/pricing/) 10.6.
@@ -362,6 +367,7 @@ proxy_push()
branch=$(expr "$refname" : "refs/heads/\(.*\)")
if [ "$whitelisted" = "$branch" ]; then
+ unset GIT_QUARANTINE_PATH # handle https://git-scm.com/docs/git-receive-pack#_quarantine_environment
error="$(git push --quiet $TARGET_REPO $NEWREV:$REFNAME 2>&1)"
fail=$?
@@ -396,6 +402,15 @@ else
fi
```
+Note that this sample has a few limitations:
+
+- This example may not work verbatim for your use case and might need modification.
+ - It does not regard different types of authentication mechanisms for the mirror.
+ - It does not work with forced updates (rewriting history).
+ - Only branches that match the `whitelisted` patterns will be proxy pushed.
+- The script circumvents the git hook quarantine environment because the update of `$TARGET_REPO`
+ is seen as a ref update and git will complain about it.
+
### Mirroring with Perforce Helix via Git Fusion **(STARTER)**
CAUTION: **Warning:**
diff --git a/lib/api/helpers/services_helpers.rb b/lib/api/helpers/services_helpers.rb
index eba4ebb4b6e..74051f2d69f 100644
--- a/lib/api/helpers/services_helpers.rb
+++ b/lib/api/helpers/services_helpers.rb
@@ -486,6 +486,12 @@ module API
name: :jira_issue_transition_id,
type: String,
desc: 'The ID of a transition that moves issues to a closed state. You can find this number under the Jira workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the **Transitions (id)** column ([see screenshot][trans]). By default, this ID is set to `2`'
+ },
+ {
+ required: false,
+ name: :comment_on_event_enabled,
+ type: Boolean,
+ desc: 'Enable comments inside Jira issues on each GitLab event (commit / merge request)'
}
],
'mattermost-slash-commands' => [
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 799612af9cd..16b71dfa697 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -5783,9 +5783,15 @@ msgstr ""
msgid "Deselect all"
msgstr ""
+msgid "Design Management"
+msgstr ""
+
msgid "Design Management files and data"
msgstr ""
+msgid "Design Sync Not Enabled"
+msgstr ""
+
msgid "DesignManagement|%{current_design} of %{designs_count}"
msgstr ""
@@ -5855,6 +5861,9 @@ msgstr ""
msgid "Designs"
msgstr ""
+msgid "Designs coming soon."
+msgstr ""
+
msgid "Destroy"
msgstr ""
@@ -6929,6 +6938,9 @@ msgstr ""
msgid "Estimated"
msgstr ""
+msgid "Event Actions"
+msgstr ""
+
msgid "EventFilterBy|Filter by all"
msgstr ""
@@ -7807,12 +7819,18 @@ msgstr ""
msgid "Geo"
msgstr ""
+msgid "Geo Designs"
+msgstr ""
+
msgid "Geo Nodes"
msgstr ""
msgid "Geo Settings"
msgstr ""
+msgid "Geo Troubleshooting"
+msgstr ""
+
msgid "Geo allows you to replicate your GitLab instance to other geographical locations."
msgstr ""
@@ -9225,6 +9243,9 @@ msgstr ""
msgid "If using GitHub, you’ll see pipeline statuses on GitHub for your commits and pull requests. %{more_info_link}"
msgstr ""
+msgid "If you believe this page to be an error, check out the links below for more information."
+msgstr ""
+
msgid "If you lose your recovery codes you can generate new ones, invalidating all previous codes."
msgstr ""
@@ -12224,6 +12245,9 @@ msgstr ""
msgid "Performance optimization"
msgstr ""
+msgid "PerformanceBar|Download"
+msgstr ""
+
msgid "PerformanceBar|Gitaly calls"
msgstr ""
@@ -13367,6 +13391,12 @@ msgstr ""
msgid "ProjectService|%{service_title}: status on"
msgstr ""
+msgid "ProjectService|Comment"
+msgstr ""
+
+msgid "ProjectService|Comment will be posted on each event"
+msgstr ""
+
msgid "ProjectService|Integrations"
msgstr ""
@@ -17549,6 +17579,9 @@ msgstr ""
msgid "There was an error fetching label data for the selected group"
msgstr ""
+msgid "There was an error fetching the Designs"
+msgstr ""
+
msgid "There was an error gathering the chart data"
msgstr ""
@@ -18429,6 +18462,9 @@ msgstr ""
msgid "Trending"
msgstr ""
+msgid "Trigger"
+msgstr ""
+
msgid "Trigger pipelines for mirror updates"
msgstr ""
diff --git a/spec/frontend/performance_bar/components/request_selector_spec.js b/spec/frontend/performance_bar/components/request_selector_spec.js
index a4ed55fbf15..42ccb1f1b5c 100644
--- a/spec/frontend/performance_bar/components/request_selector_spec.js
+++ b/spec/frontend/performance_bar/components/request_selector_spec.js
@@ -4,23 +4,9 @@ import { shallowMount } from '@vue/test-utils';
describe('request selector', () => {
const requests = [
{
- id: '123',
- url: 'https://gitlab.com/',
- hasWarnings: false,
- },
- {
- id: '456',
- url: 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1',
- hasWarnings: false,
- },
- {
- id: '789',
- url: 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1.json?serializer=widget',
- hasWarnings: false,
- },
- {
- id: 'abc',
+ id: 'warningReq',
url: 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1/discussions.json',
+ truncatedUrl: 'discussions.json',
hasWarnings: true,
},
];
@@ -28,35 +14,16 @@ describe('request selector', () => {
const wrapper = shallowMount(RequestSelector, {
propsData: {
requests,
- currentRequest: requests[1],
+ currentRequest: requests[0],
},
});
- function optionText(requestId) {
- return wrapper
- .find(`[value='${requestId}']`)
- .text()
- .trim();
- }
-
- it('displays the last component of the path', () => {
- expect(optionText(requests[2].id)).toEqual('1.json?serializer=widget');
- });
-
- it('keeps the last two components of the path when the last component is numeric', () => {
- expect(optionText(requests[1].id)).toEqual('merge_requests/1');
- });
-
- it('ignores trailing slashes', () => {
- expect(optionText(requests[0].id)).toEqual('gitlab.com');
- });
-
it('has a warning icon if any requests have warnings', () => {
expect(wrapper.find('span > gl-emoji').element.dataset.name).toEqual('warning');
});
it('adds a warning glyph to requests with warnings', () => {
- const requestValue = wrapper.find('[value="abc"]').text();
+ const requestValue = wrapper.find('[value="warningReq"]').text();
expect(requestValue).toContain('discussions.json');
expect(requestValue).toContain('(!)');
diff --git a/spec/frontend/performance_bar/stores/performance_bar_store_spec.js b/spec/frontend/performance_bar/stores/performance_bar_store_spec.js
new file mode 100644
index 00000000000..686029a28a9
--- /dev/null
+++ b/spec/frontend/performance_bar/stores/performance_bar_store_spec.js
@@ -0,0 +1,45 @@
+import PerformanceBarStore from '~/performance_bar/stores/performance_bar_store';
+
+describe('PerformanceBarStore', () => {
+ describe('truncateUrl', () => {
+ let store;
+ const findUrl = id => store.findRequest(id).truncatedUrl;
+
+ beforeEach(() => {
+ store = new PerformanceBarStore();
+ });
+
+ it('ignores trailing slashes', () => {
+ store.addRequest('id', 'https://gitlab.com/');
+ expect(findUrl('id')).toEqual('gitlab.com');
+ });
+
+ it('keeps the last two components of the path when the last component is numeric', () => {
+ store.addRequest('id', 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1');
+ expect(findUrl('id')).toEqual('merge_requests/1');
+ });
+
+ it('uses the last component of the path', () => {
+ store.addRequest(
+ 'id',
+ 'https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/1.json?serializer=widget',
+ );
+ expect(findUrl('id')).toEqual('1.json?serializer=widget');
+ });
+
+ it('keeps query components', () => {
+ store.addRequest('id', 'http://localhost:3001/h5bp/html5-boilerplate/?param');
+ expect(findUrl('id')).toEqual('html5-boilerplate?param');
+ });
+
+ it('keeps components when query contains a slash', () => {
+ store.addRequest('id', 'http://localhost:3001/h5bp/html5-boilerplate?trunc/ated');
+ expect(findUrl('id')).toEqual('html5-boilerplate?trunc/ated');
+ });
+
+ it('ignores fragments', () => {
+ store.addRequest('id', 'http://localhost:3001/h5bp/html5-boilerplate/#frag/ment');
+ expect(findUrl('id')).toEqual('html5-boilerplate');
+ });
+ });
+});
diff --git a/spec/helpers/services_helper_spec.rb b/spec/helpers/services_helper_spec.rb
new file mode 100644
index 00000000000..edc14f86a50
--- /dev/null
+++ b/spec/helpers/services_helper_spec.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe ServicesHelper do
+ describe 'event_action_title' do
+ it { expect(event_action_title('comment')).to eq 'Comment' }
+ it { expect(event_action_title('something')).to eq 'Something' }
+ end
+
+ describe 'event_action_description' do
+ it { expect(event_action_description('comment')).to eq 'Comment will be posted on each event' }
+ it { expect(event_action_description('something')).to eq nil }
+ end
+end
diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js
index 859745ee9fc..14ace66c2f1 100644
--- a/spec/javascripts/test_bundle.js
+++ b/spec/javascripts/test_bundle.js
@@ -171,7 +171,10 @@ describe('test errors', () => {
// see: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/15
if (process.env.BABEL_ENV === 'coverage') {
// exempt these files from the coverage report
- const troubleMakers = ['./pages/admin/application_settings/general/index.js'];
+ const troubleMakers = [
+ './pages/admin/application_settings/general/index.js',
+ './geo_designs/index.js',
+ ];
describe('Uncovered files', function() {
const sourceFilesContexts = [require.context('~', true, /\.(js|vue)$/)];
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 704d0184cf1..05cae858450 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -443,6 +443,7 @@ Service:
- note_events
- pipeline_events
- job_events
+- comment_on_event_enabled
- category
- default
- wiki_page_events
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
index 5feb8ca7839..a6dd95437e3 100644
--- a/spec/models/project_services/jira_service_spec.rb
+++ b/spec/models/project_services/jira_service_spec.rb
@@ -431,6 +431,16 @@ describe JiraService do
).once
end
+ context 'when "comment_on_event_enabled" is set to false' do
+ it 'creates Remote Link reference but does not create comment' do
+ allow(@jira_service).to receive_messages(comment_on_event_enabled: false)
+ @jira_service.close_issue(resource, ExternalIssue.new('JIRA-123', project))
+
+ expect(WebMock).not_to have_requested(:post, @comment_url)
+ expect(WebMock).to have_requested(:post, @remote_link_url)
+ end
+ end
+
it 'does not send comment or remote links to issues already closed' do
allow_any_instance_of(JIRA::Resource::Issue).to receive(:resolution).and_return(true)
diff --git a/spec/services/merge_requests/push_options_handler_service_spec.rb b/spec/services/merge_requests/push_options_handler_service_spec.rb
index 75b9c2304a6..7f9c47d8670 100644
--- a/spec/services/merge_requests/push_options_handler_service_spec.rb
+++ b/spec/services/merge_requests/push_options_handler_service_spec.rb
@@ -101,17 +101,15 @@ describe MergeRequests::PushOptionsHandlerService do
shared_examples_for 'a service that can set the merge request to merge when pipeline succeeds' do
subject(:last_mr) { MergeRequest.last }
+ let(:change) { Gitlab::ChangesList.new(changes).changes.first }
+
it 'sets auto_merge_enabled' do
service.execute
expect(last_mr.auto_merge_enabled).to eq(true)
expect(last_mr.auto_merge_strategy).to eq(AutoMergeService::STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS)
- end
-
- it 'sets merge_user to the user' do
- service.execute
-
expect(last_mr.merge_user).to eq(user)
+ expect(last_mr.merge_params['sha']).to eq(change[:newrev])
end
end
diff --git a/spec/views/import/gitlab_projects/new.html.haml_spec.rb b/spec/views/import/gitlab_projects/new.html.haml_spec.rb
new file mode 100644
index 00000000000..953fcc6dc51
--- /dev/null
+++ b/spec/views/import/gitlab_projects/new.html.haml_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'import/gitlab_projects/new.html.haml' do
+ include Devise::Test::ControllerHelpers
+
+ let(:user) { build_stubbed(:user, namespace: build_stubbed(:namespace)) }
+
+ before do
+ allow(view).to receive(:current_user).and_return(user)
+ end
+
+ context 'when the user has no other namespaces' do
+ it 'shows a namespace_id hidden field tag' do
+ render
+
+ expect(rendered).to have_css('input[name="namespace_id"]', count: 1, visible: false)
+ end
+ end
+
+ context 'when the user can select other namespaces' do
+ it 'shows a namespace_id select' do
+ allow(user).to receive(:can_select_namespace?).and_return(true)
+
+ render
+
+ expect(rendered).to have_select('namespace_id', count: 1)
+ end
+ end
+end