Skip to content
Snippets Groups Projects
Commit d64e3a8b authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 833eadad
No related branches found
No related tags found
No related merge requests found
Showing
with 124 additions and 25 deletions
Loading
Loading
@@ -56,7 +56,7 @@ Style/FrozenStringLiteralComment:
- 'qa/**/*'
- 'rubocop/**/*'
- 'scripts/**/*'
- 'spec/**/*'
- 'spec/lib/**/*'
 
RSpec/FilePath:
Exclude:
Loading
Loading
Loading
Loading
@@ -387,7 +387,6 @@ group :development, :test do
 
gem 'benchmark-ips', '~> 2.3.0', require: false
 
gem 'license_finder', '~> 5.4', require: false
gem 'knapsack', '~> 1.17'
 
gem 'stackprof', '~> 0.2.10', require: false
Loading
Loading
@@ -397,6 +396,11 @@ group :development, :test do
gem 'timecop', '~> 0.8.0'
end
 
# Gems required in omnibus-gitlab pipeline
group :development, :test, :omnibus do
gem 'license_finder', '~> 5.4', require: false
end
group :test do
gem 'shoulda-matchers', '~> 4.0.1', require: false
gem 'email_spec', '~> 2.2.0'
Loading
Loading
Loading
Loading
@@ -48,7 +48,7 @@ document.addEventListener('DOMContentLoaded', () => {
leaveByUrl('project');
 
if (document.getElementById('js-tree-list')) {
import('~/repository')
import('ee_else_ce/repository')
.then(m => m.default())
.catch(e => {
throw e;
Loading
Loading
Loading
Loading
@@ -42,7 +42,7 @@ document.addEventListener('DOMContentLoaded', () => {
GpgBadges.fetch();
 
if (document.getElementById('js-tree-list')) {
import('~/repository')
import('ee_else_ce/repository')
.then(m => m.default())
.catch(e => {
throw e;
Loading
Loading
Loading
Loading
@@ -9,8 +9,10 @@ import { parseBoolean } from '../lib/utils/common_utils';
 
export default function setupVueRepositoryList() {
const el = document.getElementById('js-tree-list');
const { projectPath, projectShortPath, ref, fullName } = el.dataset;
const { dataset } = el;
const { projectPath, projectShortPath, ref, fullName } = dataset;
const router = createRouter(projectPath, ref);
const hideOnRootEls = document.querySelectorAll('.js-hide-on-root');
 
apolloProvider.clients.defaultClient.cache.writeData({
data: {
Loading
Loading
@@ -35,6 +37,7 @@ export default function setupVueRepositoryList() {
document
.querySelectorAll('.js-hide-on-navigation')
.forEach(elem => elem.classList.toggle('hidden', !isRoot));
hideOnRootEls.forEach(elem => elem.classList.toggle('hidden', isRoot));
});
 
const breadcrumbEl = document.getElementById('js-repo-breadcrumb');
Loading
Loading
@@ -88,7 +91,8 @@ export default function setupVueRepositoryList() {
},
});
 
return new Vue({
// eslint-disable-next-line no-new
new Vue({
el,
router,
apolloProvider,
Loading
Loading
@@ -96,4 +100,6 @@ export default function setupVueRepositoryList() {
return h(App);
},
});
return { router, data: dataset };
}
Loading
Loading
@@ -5,7 +5,7 @@ module PreviewMarkdown
 
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def preview_markdown
result = PreviewMarkdownService.new(@project, current_user, params).execute
result = PreviewMarkdownService.new(@project, current_user, markdown_service_params).execute
 
markdown_params =
case controller_name
Loading
Loading
@@ -26,6 +26,8 @@ module PreviewMarkdown
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
 
private
def projects_filter_params
{
issuable_state_filter_enabled: true,
Loading
Loading
@@ -33,10 +35,12 @@ module PreviewMarkdown
}
end
 
private
# Override this method to customise the markdown for your controller
def preview_markdown_params
{}
end
def markdown_service_params
params
end
end
Loading
Loading
@@ -6,6 +6,7 @@ class GroupsController < Groups::ApplicationController
include ParamsBackwardCompatibility
include PreviewMarkdown
include RecordUserLastActivity
extend ::Gitlab::Utils::Override
 
respond_to :html
 
Loading
Loading
@@ -233,6 +234,11 @@ class GroupsController < Groups::ApplicationController
@group.self_and_descendants.public_or_visible_to_user(current_user)
end
end
override :markdown_service_params
def markdown_service_params
params.merge(group: group)
end
end
 
GroupsController.prepend_if_ee('EE::GroupsController')
Loading
Loading
@@ -66,7 +66,7 @@ module GitlabRoutingHelper
end
 
def preview_markdown_path(parent, *args)
return group_preview_markdown_path(parent) if parent.is_a?(Group)
return group_preview_markdown_path(parent, *args) if parent.is_a?(Group)
 
if @snippet.is_a?(PersonalSnippet)
preview_markdown_snippets_path
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ module ServicesHelper
end
 
def service_save_button(service)
button_tag(class: 'btn btn-success', type: 'submit', disabled: service.deprecated?) do
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') +
content_tag(:span, 'Save changes', class: 'js-btn-label')
end
Loading
Loading
Loading
Loading
@@ -186,6 +186,15 @@ module TreeHelper
 
attrs
end
def vue_file_list_data(project, ref)
{
project_path: project.full_path,
project_short_path: project.path,
ref: ref,
full_name: project.name_with_namespace
}
end
end
 
TreeHelper.prepend_if_ee('::EE::TreeHelper')
Loading
Loading
@@ -6,6 +6,7 @@ module Clusters
include Gitlab::Utils::StrongMemoize
include FromUnion
include ReactiveCaching
include AfterCommitQueue
 
self.table_name = 'clusters'
 
Loading
Loading
@@ -126,7 +127,55 @@ module Clusters
hierarchy_groups.flat_map(&:clusters) + Instance.new.clusters
end
 
state_machine :cleanup_status, initial: :cleanup_not_started do
state :cleanup_not_started, value: 1
state :cleanup_uninstalling_applications, value: 2
state :cleanup_removing_project_namespaces, value: 3
state :cleanup_removing_service_account, value: 4
state :cleanup_errored, value: 5
event :start_cleanup do |cluster|
transition [:cleanup_not_started, :cleanup_errored] => :cleanup_uninstalling_applications
end
event :continue_cleanup do
transition(
cleanup_uninstalling_applications: :cleanup_removing_project_namespaces,
cleanup_removing_project_namespaces: :cleanup_removing_service_account)
end
event :make_cleanup_errored do
transition any => :cleanup_errored
end
before_transition any => [:cleanup_errored] do |cluster, transition|
status_reason = transition.args.first
cluster.cleanup_status_reason = status_reason if status_reason
end
after_transition [:cleanup_not_started, :cleanup_errored] => :cleanup_uninstalling_applications do |cluster|
cluster.run_after_commit do
Clusters::Cleanup::AppWorker.perform_async(cluster.id)
end
end
after_transition cleanup_uninstalling_applications: :cleanup_removing_project_namespaces do |cluster|
cluster.run_after_commit do
Clusters::Cleanup::ProjectNamespaceWorker.perform_async(cluster.id)
end
end
after_transition cleanup_removing_project_namespaces: :cleanup_removing_service_account do |cluster|
cluster.run_after_commit do
Clusters::Cleanup::ServiceAccountWorker.perform_async(cluster.id)
end
end
end
def status_name
return cleanup_status_name if cleanup_errored?
return :cleanup_ongoing unless cleanup_not_started?
provider&.status_name || connection_status.presence || :created
end
 
Loading
Loading
Loading
Loading
@@ -209,14 +209,20 @@ class MergeRequest < ApplicationRecord
scope :by_target_branch, ->(branch_name) { where(target_branch: branch_name) }
scope :preload_source_project, -> { preload(:source_project) }
 
scope :with_open_merge_when_pipeline_succeeds, -> do
with_state(:opened).where(merge_when_pipeline_succeeds: true)
scope :with_auto_merge_enabled, -> do
with_state(:opened).where(auto_merge_enabled: true)
end
 
after_save :keep_around_commit
 
alias_attribute :project, :target_project
alias_attribute :project_id, :target_project_id
# Currently, `merge_when_pipeline_succeeds` column is used as a flag
# to check if _any_ auto merge strategy is activated on the merge request.
# Today, we have multiple strategies and MWPS is one of them.
# we'd eventually rename the column for avoiding confusions, but in the mean time
# please use `auto_merge_enabled` alias instead of `merge_when_pipeline_succeeds`.
alias_attribute :auto_merge_enabled, :merge_when_pipeline_succeeds
alias_method :issuing_parent, :target_project
 
Loading
Loading
# frozen_string_literal: true
 
class TodoPresenter < Gitlab::View::Presenter::Delegated
include GlobalID::Identification
presents :todo
end
Loading
Loading
@@ -89,6 +89,14 @@ class DiffFileBaseEntity < Grape::Entity
 
expose :viewer, using: DiffViewerEntity
 
expose :old_size do |diff_file|
diff_file.old_blob&.raw_size
end
expose :new_size do |diff_file|
diff_file.new_blob&.raw_size
end
private
 
def memoized_submodule_links(diff_file, options)
Loading
Loading
Loading
Loading
@@ -152,7 +152,8 @@ module MergeRequests
def abort_ff_merge_requests_with_when_pipeline_succeeds
return unless @project.ff_merge_must_be_possible?
 
requests_with_auto_merge_enabled_to(@push.branch_name).each do |merge_request|
merge_requests_with_auto_merge_enabled_to(@push.branch_name).each do |merge_request|
next unless merge_request.auto_merge_strategy == AutoMergeService::STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS
next unless merge_request.should_be_rebased?
 
abort_auto_merge_with_todo(merge_request, 'target branch was updated')
Loading
Loading
@@ -167,11 +168,11 @@ module MergeRequests
todo_service.merge_request_became_unmergeable(merge_request)
end
 
def requests_with_auto_merge_enabled_to(target_branch)
def merge_requests_with_auto_merge_enabled_to(target_branch)
@project
.merge_requests
.by_target_branch(target_branch)
.with_open_merge_when_pipeline_succeeds
.with_auto_merge_enabled
end
 
def mark_pending_todos_done
Loading
Loading
Loading
Loading
@@ -16,8 +16,12 @@ class PreviewMarkdownService < BaseService
 
private
 
def quick_action_types
%w(Issue MergeRequest Commit)
end
def explain_quick_actions(text)
return text, [] unless %w(Issue MergeRequest Commit).include?(target_type)
return text, [] unless quick_action_types.include?(target_type)
 
quick_actions_service = QuickActions::InterpretService.new(project, current_user)
quick_actions_service.explain(text, find_commands_target)
Loading
Loading
@@ -51,7 +55,7 @@ class PreviewMarkdownService < BaseService
 
def find_commands_target
QuickActions::TargetService
.new(project, current_user)
.new(project, current_user, group: params[:group])
.execute(target_type, target_id)
end
 
Loading
Loading
@@ -63,3 +67,5 @@ class PreviewMarkdownService < BaseService
params[:target_id]
end
end
PreviewMarkdownService.prepend_if_ee('EE::PreviewMarkdownService')
Loading
Loading
@@ -32,3 +32,5 @@ module QuickActions
end
end
end
QuickActions::TargetService.prepend_if_ee('EE::QuickActions::TargetService')
Loading
Loading
@@ -4,7 +4,7 @@
%fieldset
.form-group
.form-check
= f.check_box :allow_local_requests_from_web_hooks_and_services, class: 'form-check-input'
= f.check_box :allow_local_requests_from_web_hooks_and_services, class: 'form-check-input', data: { qa_selector: 'allow_requests_from_services_checkbox' }
= f.label :allow_local_requests_from_web_hooks_and_services, class: 'form-check-label' do
= _('Allow requests to the local network from web hooks and services')
.form-check
Loading
Loading
@@ -27,4 +27,4 @@
%span.form-text.text-muted
= _('Resolves IP addresses once and uses them to submit requests')
 
= f.submit 'Save changes', class: "btn btn-success"
= f.submit 'Save changes', class: "btn btn-success", data: { qa_selector: 'save_changes_button' }
Loading
Loading
@@ -24,7 +24,7 @@
.settings-content
= render 'ip_limits'
 
%section.settings.as-outbound.no-animate#js-outbound-settings{ class: ('expanded' if expanded_by_default?) }
%section.settings.as-outbound.no-animate#js-outbound-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'outbound_requests_section' } }
.settings-header
%h4
= _('Outbound requests')
Loading
Loading
Loading
Loading
@@ -163,7 +163,7 @@
 
- if project_nav_tab? :pipelines
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :artifacts]) do
= link_to project_pipelines_path(@project), class: 'shortcuts-pipelines qa-link-pipelines rspec-link-pipelines' do
= link_to project_pipelines_path(@project), class: 'shortcuts-pipelines qa-link-pipelines rspec-link-pipelines', data: { qa_selector: 'ci_cd_link' } do
.nav-icon-container
= sprite_icon('rocket')
%span.nav-item-name#js-onboarding-pipelines-link
Loading
Loading
@@ -347,7 +347,7 @@
= _('Members')
- if can_edit
= nav_link(controller: [:integrations, :services, :hooks, :hook_logs]) do
= link_to project_settings_integrations_path(@project), title: _('Integrations') do
= link_to project_settings_integrations_path(@project), title: _('Integrations'), data: { qa_selector: 'integrations_settings_link' } do
%span
= _('Integrations')
= nav_link(controller: :repository) do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment