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

Add latest changes from gitlab-org/gitlab@master

parent d203316c
No related branches found
No related tags found
No related merge requests found
Showing
with 83 additions and 28 deletions
Loading
Loading
@@ -386,6 +386,7 @@ class ProjectsController < Projects::ApplicationController
:template_project_id,
:merge_method,
:initialize_with_readme,
:autoclose_referenced_issues,
 
project_feature_attributes: %i[
builds_access_level
Loading
Loading
Loading
Loading
@@ -5,10 +5,9 @@ module Mutations
class Toggle < Base
graphql_name 'ToggleAwardEmoji'
 
field :toggledOn,
GraphQL::BOOLEAN_TYPE,
null: false,
description: 'True when the emoji was awarded, false when it was removed'
field :toggledOn, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Indicates the status of the emoji. ' \
'True if the toggle awarded the emoji, and false if the toggle removed the emoji.'
 
def resolve(args)
awardable = authorized_find!(id: args[:awardable_id])
Loading
Loading
Loading
Loading
@@ -69,7 +69,7 @@ module Types
field :participants, Types::UserType.connection_type, null: true, complexity: 5,
description: 'List of participants in the issue'
field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5,
description: 'Boolean flag for whether the currently logged in user is subscribed to this issue'
description: 'Indicates the currently logged in user is subscribed to the issue'
field :time_estimate, GraphQL::INT_TYPE, null: false,
description: 'Time estimate of the issue'
field :total_time_spent, GraphQL::INT_TYPE, null: false,
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ module Types
kword_args = kword_args.reverse_merge(
name: name,
type: GraphQL::BOOLEAN_TYPE,
description: "Whether or not a user can perform `#{name}` on this resource",
description: "Indicates the user can perform `#{name}` on this resource",
null: false)
 
field(**kword_args) # rubocop:disable Graphql/Descriptions
Loading
Loading
Loading
Loading
@@ -46,7 +46,7 @@ module Types
description: 'Timestamp of the project last activity'
 
field :archived, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Archived status of the project'
description: 'Indicates the archived status of the project'
 
field :visibility, GraphQL::STRING_TYPE, null: true,
description: 'Visibility of the project'
Loading
Loading
@@ -102,6 +102,8 @@ module Types
description: 'Indicates if a link to create or view a merge request should display after a push to Git repositories of the project from the command line'
field :remove_source_branch_after_merge, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project'
field :autoclose_referenced_issues, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if issues referenced by merge requests and commits within the default branch are closed automatically'
 
field :namespace, Types::NamespaceType, null: true,
description: 'Namespace of the project'
Loading
Loading
Loading
Loading
@@ -89,7 +89,7 @@ module DiffViewer
{
viewer: switcher_title,
reason: render_error_reason,
options: render_error_options.to_sentence(two_words_connector: _(' or '), last_word_connector: _(', or '))
options: Gitlab::Utils.to_exclusive_sentence(render_error_options)
}
end
 
Loading
Loading
Loading
Loading
@@ -142,13 +142,9 @@ class Key < ApplicationRecord
end
 
def forbidden_key_type_message
allowed_types =
Gitlab::CurrentSettings
.allowed_key_types
.map(&:upcase)
.to_sentence(last_word_connector: ', or ', two_words_connector: ' or ')
allowed_types = Gitlab::CurrentSettings.allowed_key_types.map(&:upcase)
 
"type is forbidden. Must be #{allowed_types}"
"type is forbidden. Must be #{Gitlab::Utils.to_exclusive_sentence(allowed_types)}"
end
end
 
Loading
Loading
Loading
Loading
@@ -75,6 +75,7 @@ class Project < ApplicationRecord
default_value_for :snippets_enabled, gitlab_config_features.snippets
default_value_for :only_allow_merge_if_all_discussions_are_resolved, false
default_value_for :remove_source_branch_after_merge, true
default_value_for :autoclose_referenced_issues, true
default_value_for(:ci_config_path) { Gitlab::CurrentSettings.default_ci_config_path }
 
add_authentication_token_field :runners_token, encrypted: -> { Feature.enabled?(:projects_tokens_optional_encryption, default_enabled: true) ? :optional : :required }
Loading
Loading
@@ -679,6 +680,12 @@ class Project < ApplicationRecord
end
end
 
def autoclose_referenced_issues
return true if super.nil?
super
end
def preload_protected_branches
preloader = ActiveRecord::Associations::Preloader.new
preloader.preload(self, protected_branches: [:push_access_levels, :merge_access_levels])
Loading
Loading
Loading
Loading
@@ -21,7 +21,8 @@ class KeyRestrictionValidator < ActiveModel::EachValidator
 
def supported_sizes_message
sizes = self.class.supported_sizes(options[:type])
sizes.to_sentence(last_word_connector: ', or ', two_words_connector: ' or ')
Gitlab::Utils.to_exclusive_sentence(sizes)
end
 
def valid_restriction?(value)
Loading
Loading
Loading
Loading
@@ -3,5 +3,5 @@
The #{viewer.switcher_title} could not be displayed because #{blob_render_error_reason(viewer)}.
 
You can
= blob_render_error_options(viewer).to_sentence(two_words_connector: ' or ', last_word_connector: ', or ').html_safe
= Gitlab::Utils.to_exclusive_sentence(blob_render_error_options(viewer)).html_safe
instead.
Loading
Loading
@@ -4,6 +4,6 @@ After you've reviewed these contribution guidelines, you'll be all set to
- options = contribution_options(viewer.project)
- if options.any?
= succeed '.' do
= options.to_sentence(two_words_connector: ' or ', last_word_connector: ', or ').html_safe
= Gitlab::Utils.to_exclusive_sentence(options).html_safe
- else
contribute to this project.
Loading
Loading
@@ -9,13 +9,23 @@
= _('Select the branch you want to set as the default for this project. All merge requests and commits will automatically be made against this branch unless you specify a different one.')
 
.settings-content
- if @project.empty_repo?
.text-secondary
= _('A default branch cannot be chosen for an empty project.')
- else
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, anchor: 'default-branch-settings' }, authenticity_token: true do |f|
%fieldset
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, anchor: 'default-branch-settings' }, authenticity_token: true do |f|
%fieldset
- if @project.empty_repo?
.text-secondary
= _('A default branch cannot be chosen for an empty project.')
- else
.form-group
= f.label :default_branch, "Default Branch", class: 'label-bold'
= f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
= f.submit 'Save changes', class: "btn btn-success"
.form-group
.form-check
= f.check_box :autoclose_referenced_issues, class: 'form-check-input'
= f.label :autoclose_referenced_issues, class: 'form-check-label' do
%strong= _("Auto-close referenced issues on default branch")
.form-text.text-muted
= _("Issues referenced by merge requests and commits within the default branch will be closed automatically")
= link_to icon('question-circle'), help_page_path('user/project/issues/managing_issues.html', anchor: 'disabling-automatic-issue-closing'), target: '_blank'
= f.submit 'Save changes', class: "btn btn-success"
- project = local_assigns.fetch(:project)
- model = local_assigns.fetch(:model)
 
- form = local_assigns.fetch(:form)
- placeholder = model.is_a?(MergeRequest) ? _('Describe the goal of the changes and what reviewers should be aware of.') : _('Write a comment or drag your files here…')
- supports_quick_actions = model.new_record?
Loading
Loading
@@ -14,6 +16,8 @@
= form.label :description, 'Description', class: 'col-form-label col-sm-2'
.col-sm-10
 
- if model.is_a?(Issuable)
= render 'shared/issuable/form/template_selector', issuable: model
= render layout: 'projects/md_preview', locals: { url: preview_url, referenced_users: true } do
= render 'projects/zen', f: form, attr: :description,
classes: 'note-textarea qa-issuable-form-description rspec-issuable-form-description',
Loading
Loading
Loading
Loading
@@ -17,7 +17,6 @@
.form-group.row
= form.label :title, class: 'col-form-label col-sm-2'
 
= render 'shared/issuable/form/template_selector', issuable: issuable
= render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?)
#js-suggestions{ data: { project_path: @project.full_path } }
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
 
- return unless issuable && issuable_templates(issuable).any?
 
.col-sm-3.col-lg-2
.issuable-form-select-holder.selectbox.form-group
.js-issuable-selector-wrap{ data: { issuable_type: issuable.to_ability_name } }
= template_dropdown_tag(issuable) do
%ul.dropdown-footer-list
Loading
Loading
Loading
Loading
@@ -3,6 +3,9 @@
class ChatNotificationWorker
include ApplicationWorker
 
TimeoutExceeded = Class.new(StandardError)
sidekiq_options retry: false
feature_category :chatops
latency_sensitive_worker!
# TODO: break this into multiple jobs
Loading
Loading
@@ -11,18 +14,21 @@ class ChatNotificationWorker
# worker_has_external_dependencies!
 
RESCHEDULE_INTERVAL = 2.seconds
RESCHEDULE_TIMEOUT = 5.minutes
 
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
def perform(build_id, reschedule_count = 0)
Ci::Build.find_by(id: build_id).try do |build|
send_response(build)
end
rescue Gitlab::Chat::Output::MissingBuildSectionError
raise TimeoutExceeded if timeout_exceeded?(reschedule_count)
# The creation of traces and sections appears to be eventually consistent.
# As a result it's possible for us to run the above code before the trace
# sections are present. To better handle such cases we'll just reschedule
# the job instead of producing an error.
self.class.perform_in(RESCHEDULE_INTERVAL, build_id)
self.class.perform_in(RESCHEDULE_INTERVAL, build_id, reschedule_count + 1)
end
# rubocop: enable CodeReuse/ActiveRecord
 
Loading
Loading
@@ -37,4 +43,10 @@ class ChatNotificationWorker
end
end
end
private
def timeout_exceeded?(reschedule_count)
(reschedule_count * RESCHEDULE_INTERVAL) >= RESCHEDULE_TIMEOUT
end
end
---
title: Limit the amount of time ChatNotificationWorker waits for the build trace
merge_request: 22132
author:
type: fixed
---
title: Changes to template dropdown location
merge_request: 22049
author:
type: changed
---
title: Add capability to disable issue auto-close feature per project
merge_request: 21704
author: Fabio Huser
type: added
# frozen_string_literal: true
class AddAutocloseReferencedIssuesToProjects < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :projects, :autoclose_referenced_issues, :boolean
end
end
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