diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 13:28:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 13:28:37 +0300 |
commit | 662bb2b6f1f5b5730a0d1eaa66238e718468645d (patch) | |
tree | c1ca759e7d2c96e9c2023bbcf946f79e423473a5 /app | |
parent | ed8af41027110fdad8f7bb4d53329eb73417fb8d (diff) |
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'app')
8 files changed, 47 insertions, 31 deletions
diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index a951a6bfeea..a0ab20a97aa 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -170,7 +170,7 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity ), ), { - gitlabIntegrationLink: `<a href="https://docs.gitlab.com/ce/user/project/integrations/crossplane.html" + gitlabIntegrationLink: `<a href="https://docs.gitlab.com/ee/user/clusters/applications.html#crossplane" target="_blank" rel="noopener noreferrer"> ${_.escape(s__('ClusterIntegration|Gitlab Integration'))}</a>`, kubectl: `<code>kubectl</code>`, diff --git a/app/assets/javascripts/jobs/components/log/log.vue b/app/assets/javascripts/jobs/components/log/log.vue index 03a697d11ed..eb0de53f36a 100644 --- a/app/assets/javascripts/jobs/components/log/log.vue +++ b/app/assets/javascripts/jobs/components/log/log.vue @@ -9,7 +9,12 @@ export default { LogLine, }, computed: { - ...mapState(['traceEndpoint', 'trace', 'isTraceComplete']), + ...mapState([ + 'traceEndpoint', + 'trace', + 'isTraceComplete', + 'isScrolledToBottomBeforeReceivingTrace', + ]), }, updated() { this.$nextTick(() => { diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index d96cc163738..17a446fca53 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -274,12 +274,6 @@ height: 24px; } - .git-clone-holder { - .btn { - height: auto; - } - } - .dropdown-toggle, .clone-dropdown-btn { .fa { diff --git a/app/controllers/projects/error_tracking_controller.rb b/app/controllers/projects/error_tracking_controller.rb index 9dea6b663ea..7143424473e 100644 --- a/app/controllers/projects/error_tracking_controller.rb +++ b/app/controllers/projects/error_tracking_controller.rb @@ -2,6 +2,7 @@ class Projects::ErrorTrackingController < Projects::ApplicationController before_action :authorize_read_sentry_issue! + before_action :set_issue_id, only: [:details, :stack_trace] POLLING_INTERVAL = 10_000 @@ -113,6 +114,10 @@ class Projects::ErrorTrackingController < Projects::ApplicationController params.permit(:issue_id) end + def set_issue_id + @issue_id = issue_details_params[:issue_id] + end + def set_polling_interval Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL) end diff --git a/app/helpers/projects/error_tracking_helper.rb b/app/helpers/projects/error_tracking_helper.rb index 2f5f612ed4c..c31e16e7150 100644 --- a/app/helpers/projects/error_tracking_helper.rb +++ b/app/helpers/projects/error_tracking_helper.rb @@ -14,12 +14,12 @@ module Projects::ErrorTrackingHelper } end - def error_details_data(project, issue) - opts = [project, issue, { format: :json }] + def error_details_data(project, issue_id) + opts = [project, issue_id, { format: :json }] { - 'issue-details-path' => details_namespace_project_error_tracking_index_path(*opts), - 'issue-stack-trace-path' => stack_trace_namespace_project_error_tracking_index_path(*opts) + 'issue-details-path' => details_project_error_tracking_index_path(*opts), + 'issue-stack-trace-path' => stack_trace_project_error_tracking_index_path(*opts) } end 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/clusters/clusters/aws/_new.html.haml b/app/views/clusters/clusters/aws/_new.html.haml index 48467f88f52..795b80bfb6f 100644 --- a/app/views/clusters/clusters/aws/_new.html.haml +++ b/app/views/clusters/clusters/aws/_new.html.haml @@ -1,5 +1,6 @@ - if !Gitlab::CurrentSettings.eks_integration_enabled? - - documentation_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path("integration/amazon") } + - documentation_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/clusters/add_remove_clusters.md', + anchor: 'additional-requirements-for-self-managed-instances') } = s_('Amazon authentication is not %{link_start}correctly configured%{link_end}. Ask your GitLab administrator if you want to use this service.').html_safe % { link_start: documentation_link_start, link_end: '<a/>'.html_safe } - else .js-create-eks-cluster-form-container{ data: { 'gitlab-managed-cluster-help-path' => help_page_path('user/project/clusters/index.md', anchor: 'gitlab-managed-clusters'), @@ -16,5 +17,7 @@ 'account-id' => Gitlab::CurrentSettings.eks_account_id, 'external-id' => @aws_role.role_external_id, 'kubernetes-integration-help-path' => help_page_path('user/project/clusters/index'), + 'account-and-external-ids-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'eks-cluster'), + 'create-role-arn-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'eks-cluster'), 'external-link-icon' => icon('external-link'), 'has-credentials' => @aws_role.role_arn.present?.to_s } } diff --git a/app/views/projects/error_tracking/details.html.haml b/app/views/projects/error_tracking/details.html.haml index 640746ad8f6..7015dcdcb05 100644 --- a/app/views/projects/error_tracking/details.html.haml +++ b/app/views/projects/error_tracking/details.html.haml @@ -1,4 +1,4 @@ - page_title _('Error Details') - add_to_breadcrumbs 'Errors', project_error_tracking_index_path(@project) -#js-error_details{ data: error_details_data(@current_user, @project) } +#js-error_details{ data: error_details_data(@project, @issue_id) } |