Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-01-27 12:09:01 +00:00
parent 6e7dc3f9d6
commit 507c0e71cd
91 changed files with 296 additions and 140 deletions

View File

@ -24,7 +24,6 @@ tasks:
# run DB migrations
echo "$(date) Running DB migrations" | tee -a /workspace/startup.log
make gitlab-db-migrate
cd -
# stop GDK
echo "$(date) Stopping GDK" | tee -a /workspace/startup.log
gdk stop

View File

@ -155,20 +155,6 @@ Lint/BinaryOperatorWithIdenticalOperands:
Lint/ConstantDefinitionInBlock:
Enabled: false
# Offense count: 9
# Cop supports --auto-correct.
Lint/DeprecatedOpenSSLConstant:
Exclude:
- 'app/services/clusters/kubernetes/configure_istio_ingress_service.rb'
- 'ee/lib/gitlab/geo/oauth/logout_state.rb'
- 'lib/gitlab/conan_token.rb'
- 'lib/gitlab/gitaly_client.rb'
- 'lib/gitlab/kubernetes/helm/v2/certificate.rb'
- 'spec/lib/gitlab/conan_token_spec.rb'
- 'spec/services/pages_domains/obtain_lets_encrypt_certificate_service_spec.rb'
- 'spec/support/helpers/smime_helper.rb'
- 'spec/support/shared_contexts/requests/api/conan_packages_shared_context.rb'
# Offense count: 1
Lint/DuplicateRequire:
Exclude:

View File

@ -1 +1 @@
627c53e3e51f73c3d19df2b49b956c02ba200e78
c38393255d22bf3533ca8b8714f614411f10fc30

View File

@ -330,7 +330,7 @@ export default {
v-show="showWarning"
class="collapsed-file-warning gl-p-7 gl-bg-orange-50 gl-text-center gl-rounded-bottom-left-base gl-rounded-bottom-right-base"
>
<p class="gl-mb-8">
<p class="gl-mb-5">
{{ $options.i18n.autoCollapsed }}
</p>
<gl-button

View File

@ -99,10 +99,10 @@ export default {
});
},
addCommentTooltipLeft() {
return utils.addCommentTooltip(this.line.left);
return utils.addCommentTooltip(this.line.left, this.glFeatures.dragCommentSelection);
},
addCommentTooltipRight() {
return utils.addCommentTooltip(this.line.right);
return utils.addCommentTooltip(this.line.right, this.glFeatures.dragCommentSelection);
},
emptyCellRightClassMap() {
return { conflict_their: this.line.left?.type === CONFLICT_OUR };

View File

@ -50,11 +50,11 @@ export const classNameMapCell = ({ line, hll, isLoggedIn, isHover }) => {
];
};
export const addCommentTooltip = (line) => {
export const addCommentTooltip = (line, dragCommentSelectionEnabled = false) => {
let tooltip;
if (!line) return tooltip;
tooltip = gon.drag_comment_selection
tooltip = dragCommentSelectionEnabled
? __('Add a comment to this line or drag for multiple lines')
: __('Add a comment to this line');
const brokenSymlinks = line.commentsDisabled;

View File

@ -102,7 +102,7 @@ export default {
GlIcon,
PublishedCell: () => import('ee_component/incidents/components/published_cell.vue'),
ServiceLevelAgreementCell: () =>
import('ee_component/incidents/components/service_level_agreement_cell.vue'),
import('ee_component/vue_shared/components/incidents/service_level_agreement.vue'),
GlEmptyState,
SeverityToken,
PaginatedTableWithSearchAndTabs,

View File

@ -23,7 +23,7 @@ class Snippets::NotesController < ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def snippet
PersonalSnippet.find_by(id: params[:snippet_id])
@snippet ||= PersonalSnippet.find_by(id: params[:snippet_id])
end
# rubocop: enable CodeReuse/ActiveRecord
alias_method :noteable, :snippet

View File

@ -126,7 +126,8 @@ module MarkupHelper
text = wiki_page.content
return '' unless text.present?
html = markup_unsafe(wiki_page.path, text, render_wiki_content_context(@wiki, wiki_page, context))
context = render_wiki_content_context(@wiki, wiki_page, context)
html = markup_unsafe(wiki_page.path, text, context)
prepare_for_rendering(html, context)
end

View File

@ -2,6 +2,7 @@
module Ci
class BuildTraceSection < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
extend Gitlab::Ci::Model
belongs_to :build, class_name: 'Ci::Build'

View File

@ -16,10 +16,10 @@ module CanMoveRepositoryStorage
!skip_git_transfer_check && git_transfer_in_progress?
raise RepositoryReadOnlyError, _('Repository already read-only') if
self.class.where(id: id).pick(:repository_read_only)
_safe_read_repository_read_only_column
raise ActiveRecord::RecordNotSaved, _('Database update failed') unless
update_column(:repository_read_only, true)
_update_repository_read_only_column(true)
nil
end
@ -30,7 +30,7 @@ module CanMoveRepositoryStorage
def set_repository_writable!
with_lock do
raise ActiveRecord::RecordNotSaved, _('Database update failed') unless
update_column(:repository_read_only, false)
_update_repository_read_only_column(false)
nil
end
@ -43,4 +43,19 @@ module CanMoveRepositoryStorage
def reference_counter(type:)
Gitlab::ReferenceCounter.new(type.identifier_for_container(self))
end
private
# Not all resources that can move repositories have the `repository_read_only`
# in their table, for example groups. We need these methods to override the
# behavior in those classes in order to access the column.
def _safe_read_repository_read_only_column
# This was added originally this way because of
# https://gitlab.com/gitlab-org/gitlab/-/commit/43f9b98302d3985312c9f8b66018e2835d8293d2
self.class.where(id: id).pick(:repository_read_only)
end
def _update_repository_read_only_column(value)
update_column(:repository_read_only, value)
end
end

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
# When extended, silences this warning below:
# WARNING: Active Record does not support composite primary key.
#
# project_authorizations has composite primary key. Composite primary key is ignored.
#
# See https://gitlab.com/gitlab-org/gitlab/-/issues/292909
module SuppressCompositePrimaryKeyWarning
extend ActiveSupport::Concern
private
def suppress_composite_primary_key(pk)
silence_warnings do
super
end
end
end

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class DeploymentMergeRequest < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
belongs_to :deployment, optional: false
belongs_to :merge_request, optional: false

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class IssueAssignee < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
belongs_to :issue
belongs_to :assignee, class_name: "User", foreign_key: :user_id, inverse_of: :issue_assignees

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class MergeRequestContextCommitDiffFile < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include Gitlab::EncodingHelper
include ShaAttribute
include DiffFile

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class MergeRequestDiffCommit < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include BulkInsertSafe
include ShaAttribute
include CachedCommit

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class MergeRequestDiffFile < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include BulkInsertSafe
include Gitlab::EncodingHelper
include DiffFile

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class MilestoneRelease < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
belongs_to :milestone
belongs_to :release

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true
class ProjectAuthorization < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include FromUnion
belongs_to :user

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class ProjectPagesMetadatum < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include EachBatch
self.primary_key = :project_id

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class PushEventPayload < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include ShaAttribute
belongs_to :event, inverse_of: :push_event_payload

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class RepositoryLanguage < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
belongs_to :project
belongs_to :programming_language

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
class UserInteractedProject < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
belongs_to :user
belongs_to :project

View File

@ -60,7 +60,7 @@ module Clusters
cert.public_key = key.public_key
cert.subject = name
cert.issuer = name
cert.sign(key, OpenSSL::Digest::SHA256.new)
cert.sign(key, OpenSSL::Digest.new('SHA256'))
serverless_domain_cluster.update!(
key: key.to_pem,

View File

@ -6,7 +6,7 @@
= render "devise/shared/error_messages", resource: resource
.form-group
= f.label :email
= f.email_field :email, class: "form-control", required: true, title: 'Please provide a valid email address.', value: nil
= f.email_field :email, class: "form-control gl-form-input", required: true, title: 'Please provide a valid email address.', value: nil
.clearfix
= f.submit "Resend", class: 'gl-button btn btn-success'

View File

@ -7,12 +7,12 @@
= f.hidden_field :reset_password_token
.form-group
= f.label 'New password', for: "user_password"
= f.password_field :password, class: "form-control top", required: true, title: 'This field is required', data: { qa_selector: 'password_field'}
= f.password_field :password, class: "form-control gl-form-input top", required: true, title: 'This field is required', data: { qa_selector: 'password_field'}
.form-group
= f.label 'Confirm new password', for: "user_password_confirmation"
= f.password_field :password_confirmation, class: "form-control bottom", title: 'This field is required', data: { qa_selector: 'password_confirmation_field' }, required: true
= f.password_field :password_confirmation, class: "form-control gl-form-input bottom", title: 'This field is required', data: { qa_selector: 'password_confirmation_field' }, required: true
.clearfix
= f.submit "Change your password", class: "gl-button btn btn-primary", data: { qa_selector: 'change_password_button' }
= f.submit "Change your password", class: "gl-button btn btn-info", data: { qa_selector: 'change_password_button' }
.clearfix.prepend-top-20
%p

View File

@ -1,4 +1,3 @@
= render 'devise/shared/tab_single', tab_title: 'Reset Password'
.login-box
.login-body
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f|
@ -6,9 +5,9 @@
= render "devise/shared/error_messages", resource: resource
.form-group
= f.label :email
= f.email_field :email, class: "form-control", required: true, value: params[:user_email], autofocus: true, title: 'Please provide a valid email address.'
= f.email_field :email, class: "form-control gl-form-input", required: true, value: params[:user_email], autofocus: true, title: 'Please provide a valid email address.'
.clearfix
= f.submit "Reset password", class: "btn-primary btn"
= f.submit "Reset password", class: "gl-button btn-info btn"
.clearfix.prepend-top-20
= render 'devise/shared/sign_in_link'

View File

@ -1,10 +1,10 @@
= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'new_user gl-show-field-errors', 'aria-live' => 'assertive'}) do |f|
.form-group
= f.label _('Username or email'), for: 'user_login', class: 'label-bold'
= f.text_field :login, value: @invite_email, class: 'form-control top', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', required: true, title: _('This field is required.'), data: { qa_selector: 'login_field' }
= f.text_field :login, value: @invite_email, class: 'form-control gl-form-input top', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', required: true, title: _('This field is required.'), data: { qa_selector: 'login_field' }
.form-group
= f.label :password, class: 'label-bold'
= f.password_field :password, class: 'form-control bottom', required: true, title: _('This field is required.'), data: { qa_selector: 'password_field' }
= f.password_field :password, class: 'form-control gl-form-input bottom', required: true, title: _('This field is required.'), data: { qa_selector: 'password_field' }
- if devise_mapping.rememberable?
.remember-me
%label{ for: 'user_remember_me' }

View File

@ -5,10 +5,10 @@
= form_tag(omniauth_callback_path(:user, server['provider_name']), id: 'new_ldap_user', class: "gl-show-field-errors") do
.form-group
= label_tag :username, "#{server['label']} Username"
= text_field_tag :username, nil, { class: "form-control top", title: "This field is required.", autofocus: "autofocus", data: { qa_selector: 'username_field' }, required: true }
= text_field_tag :username, nil, { class: "form-control gl-form-input top", title: "This field is required.", autofocus: "autofocus", data: { qa_selector: 'username_field' }, required: true }
.form-group
= label_tag :password
= password_field_tag :password, nil, { class: "form-control bottom", title: "This field is required.", data: { qa_selector: 'password_field' }, required: true }
= password_field_tag :password, nil, { class: "form-control gl-form-input bottom", title: "This field is required.", data: { qa_selector: 'password_field' }, required: true }
- if !hide_remember_me && devise_mapping.rememberable?
.remember-me
%label{ for: "remember_me" }
@ -16,4 +16,4 @@
%span Remember me
.submit-container.move-submit-down
= submit_tag submit_message, class: "btn-success btn", data: { qa_selector: 'sign_in_button' }
= submit_tag submit_message, class: "gl-button btn-success btn", data: { qa_selector: 'sign_in_button' }

View File

@ -8,7 +8,7 @@
= f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
%div
= f.label 'Two-Factor Authentication code', name: :otp_attempt
= f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.', data: { qa_selector: 'two_fa_code_field' }
= f.text_field :otp_attempt, class: 'form-control gl-form-input', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.', data: { qa_selector: 'two_fa_code_field' }
%p.form-text.text-muted.hint Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes.
.prepend-top-20
= f.submit "Verify code", class: "gl-button btn btn-success", data: { qa_selector: 'verify_code_button' }

View File

@ -15,22 +15,22 @@
.name.form-row
.col.form-group
= f.label :first_name, _('First name'), for: 'new_user_first_name', class: 'label-bold'
= f.text_field :first_name, class: 'form-control top js-block-emoji js-validate-length', :data => { :max_length => max_first_name_length, :max_length_message => s_('SignUp|First name is too long (maximum is %{max_length} characters).') % { max_length: max_first_name_length }, :qa_selector => 'new_user_first_name_field' }, required: true, title: _('This field is required.')
= f.text_field :first_name, class: 'form-control gl-form-input top js-block-emoji js-validate-length', :data => { :max_length => max_first_name_length, :max_length_message => s_('SignUp|First name is too long (maximum is %{max_length} characters).') % { max_length: max_first_name_length }, :qa_selector => 'new_user_first_name_field' }, required: true, title: _('This field is required.')
.col.form-group
= f.label :last_name, _('Last name'), for: 'new_user_last_name', class: 'label-bold'
= f.text_field :last_name, class: 'form-control top js-block-emoji js-validate-length', :data => { :max_length => max_last_name_length, :max_length_message => s_('SignUp|Last name is too long (maximum is %{max_length} characters).') % { max_length: max_last_name_length }, :qa_selector => 'new_user_last_name_field' }, required: true, title: _('This field is required.')
= f.text_field :last_name, class: 'form-control gl-form-input top js-block-emoji js-validate-length', :data => { :max_length => max_last_name_length, :max_length_message => s_('SignUp|Last name is too long (maximum is %{max_length} characters).') % { max_length: max_last_name_length }, :qa_selector => 'new_user_last_name_field' }, required: true, title: _('This field is required.')
.username.form-group
= f.label :username, class: 'label-bold'
= f.text_field :username, class: 'form-control middle js-block-emoji js-validate-length js-validate-username', :data => { :api_path => suggestion_path, :min_length => min_username_length, :min_length_message => s_('SignUp|Username is too short (minimum is %{min_length} characters).') % { min_length: min_username_length }, :max_length => max_username_length, :max_length_message => s_('SignUp|Username is too long (maximum is %{max_length} characters).') % { max_length: max_username_length }, :qa_selector => 'new_user_username_field' }, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, required: true, title: _('Please create a username with only alphanumeric characters.')
= f.text_field :username, class: 'form-control gl-form-input middle js-block-emoji js-validate-length js-validate-username', :data => { :api_path => suggestion_path, :min_length => min_username_length, :min_length_message => s_('SignUp|Username is too short (minimum is %{min_length} characters).') % { min_length: min_username_length }, :max_length => max_username_length, :max_length_message => s_('SignUp|Username is too long (maximum is %{max_length} characters).') % { max_length: max_username_length }, :qa_selector => 'new_user_username_field' }, pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, required: true, title: _('Please create a username with only alphanumeric characters.')
%p.validation-error.gl-text-red-500.gl-field-error-ignore.gl-mt-2.field-validation.hide= _('Username is already taken.')
%p.validation-success.gl-text-green-600.gl-field-error-ignore.gl-mt-2.field-validation.hide= _('Username is available.')
%p.validation-pending.gl-field-error-ignore.gl-mt-2.field-validation.hide= _('Checking username availability...')
.form-group
= f.label :email, class: 'label-bold'
= f.email_field :email, value: @invite_email, class: 'form-control middle', data: { qa_selector: 'new_user_email_field' }, required: true, title: _('Please provide a valid email address.')
= f.email_field :email, value: @invite_email, class: 'form-control gl-form-input middle', data: { qa_selector: 'new_user_email_field' }, required: true, title: _('Please provide a valid email address.')
.form-group.gl-mb-5#password-strength
= f.label :password, class: 'label-bold'
= f.password_field :password, class: 'form-control bottom', data: { qa_selector: 'new_user_password_field' }, required: true, pattern: ".{#{@minimum_password_length},}", title: s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
= f.password_field :password, class: 'form-control gl-form-input bottom', data: { qa_selector: 'new_user_password_field' }, required: true, pattern: ".{#{@minimum_password_length},}", title: s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
%p.gl-field-hint.text-secondary= s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
%div
- if show_recaptcha_sign_up?

View File

@ -20,15 +20,15 @@
- unless @user.password_automatically_set?
.form-group
= f.label :current_password, _('Current password'), class: 'label-bold'
= f.password_field :current_password, required: true, class: 'form-control', data: { qa_selector: 'current_password_field' }
= f.password_field :current_password, required: true, class: 'form-control gl-form-input', data: { qa_selector: 'current_password_field' }
%p.form-text.text-muted
= _('You must provide your current password in order to change it.')
.form-group
= f.label :password, _('New password'), class: 'label-bold'
= f.password_field :password, required: true, class: 'form-control', data: { qa_selector: 'new_password_field' }
= f.password_field :password, required: true, class: 'form-control gl-form-input', data: { qa_selector: 'new_password_field' }
.form-group
= f.label :password_confirmation, _('Password confirmation'), class: 'label-bold'
= f.password_field :password_confirmation, required: true, class: 'form-control', data: { qa_selector: 'confirm_password_field' }
= f.password_field :password_confirmation, required: true, class: 'form-control gl-form-input', data: { qa_selector: 'confirm_password_field' }
.gl-mt-3.gl-mb-3
= f.submit _('Save password'), class: "gl-button btn btn-success gl-mr-3", data: { qa_selector: 'save_password_button' }
- unless @user.password_automatically_set?

View File

@ -16,16 +16,16 @@
.col-sm-2.col-form-label
= f.label :current_password, _('Current password')
.col-sm-10
= f.password_field :current_password, required: true, class: 'form-control'
= f.password_field :current_password, required: true, class: 'form-control gl-form-input'
.form-group.row
.col-sm-2.col-form-label
= f.label :password, _('New password')
.col-sm-10
= f.password_field :password, required: true, class: 'form-control'
= f.password_field :password, required: true, class: 'form-control gl-form-input'
.form-group.row
.col-sm-2.col-form-label
= f.label :password_confirmation, _('Password confirmation')
.col-sm-10
= f.password_field :password_confirmation, required: true, class: 'form-control'
= f.password_field :password_confirmation, required: true, class: 'form-control gl-form-input'
.form-actions
= f.submit _('Set new password'), class: 'gl-button btn btn-success'

View File

@ -1,2 +1,2 @@
= link_to project_find_file_path(@project, @ref), class: 'gl-button btn shortcuts-find-file', rel: 'nofollow' do
= link_to project_find_file_path(@project, @ref), class: 'gl-button btn btn-default shortcuts-find-file', rel: 'nofollow' do
= _('Find file')

View File

@ -23,13 +23,13 @@
- if blob.readable_text?
- if blame
= link_to 'Normal view', project_blob_path(@project, @id),
class: 'gl-button btn'
class: 'gl-button btn btn-default'
- else
= link_to 'Blame', project_blame_path(@project, @id),
class: 'gl-button btn js-blob-blame-link' unless blob.empty?
class: 'gl-button btn btn-default js-blob-blame-link' unless blob.empty?
= link_to 'History', project_commits_path(@project, @id),
class: 'gl-button btn'
class: 'gl-button btn btn-default'
= link_to 'Permalink', project_blob_path(@project,
tree_join(@commit.sha, @path)), class: 'gl-button btn js-data-file-blob-permalink-url'
tree_join(@commit.sha, @path)), class: 'gl-button btn btn-default js-data-file-blob-permalink-url'

View File

@ -3,7 +3,7 @@
- if !project.empty_repo? && can?(current_user, :download_code, project)
- archive_prefix = "#{project.path}-#{ref.tr('/', '-')}"
.project-action-button.dropdown.inline>
%button.gl-button.btn.has-tooltip{ title: s_('DownloadSource|Download'), 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download'), 'data-display' => 'static', data: { qa_selector: 'download_source_code_button' } }
%button.gl-button.btn.btn-default.has-tooltip{ title: s_('DownloadSource|Download'), 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download'), 'data-display' => 'static', data: { qa_selector: 'download_source_code_button' } }
= sprite_icon('download')
%span.sr-only= _('Select Archive Format')
= sprite_icon("chevron-down")

View File

@ -45,7 +45,7 @@
%li= link_to 'Report abuse', new_abuse_report_path(user_id: @merge_request.author.id, ref_url: merge_request_url(@merge_request))
- if can_update_merge_request
= link_to 'Edit', edit_project_merge_request_path(@project, @merge_request), class: "d-none d-md-block btn gl-button btn-grouped js-issuable-edit qa-edit-button"
= link_to 'Edit', edit_project_merge_request_path(@project, @merge_request), class: "d-none d-md-block btn gl-button btn-default btn-grouped js-issuable-edit qa-edit-button"
- if can_update_merge_request && !are_close_and_open_buttons_hidden
= render 'projects/merge_requests/close_reopen_draft_report_toggle'

View File

@ -64,17 +64,17 @@
.row-content-block{ class: (is_footer ? "footer-block" : "middle-block") }
.float-right
- if issuable.new_record?
= link_to 'Cancel', polymorphic_path([@project, issuable.class]), class: 'btn btn-cancel'
= link_to 'Cancel', polymorphic_path([@project, issuable.class]), class: 'gl-button btn btn-cancel'
- else
- if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project)
= link_to 'Delete', polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { confirm: "#{issuable.human_class_name} will be removed! Are you sure?" }, method: :delete, class: 'btn btn-danger btn-grouped'
= link_to 'Cancel', polymorphic_path([@project, issuable]), class: 'btn btn-grouped btn-cancel'
= link_to 'Cancel', polymorphic_path([@project, issuable]), class: 'gl-button btn btn-grouped btn-cancel'
%span.gl-mr-3
- if issuable.new_record?
= form.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'btn btn-success qa-issuable-create-button'
= form.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-success qa-issuable-create-button'
- else
= form.submit 'Save changes', class: 'btn btn-success'
= form.submit 'Save changes', class: 'gl-button btn btn-success'
- if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = issuable.project.present.contribution_guide_path)
.inline.gl-mt-3

View File

@ -22,11 +22,12 @@
data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } }>
= sprite_icon('error')
- else
= link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: link_classes + 'btn gl-button',
= link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: link_classes + 'btn gl-button btn-default',
title: s_('UserProfile|Report abuse'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
= sprite_icon('error')
- if can?(current_user, :read_user_profile, @user)
= link_to user_path(@user, rss_url_options), class: link_classes + 'btn gl-button btn-svg btn-default has-tooltip', title: s_('UserProfile|Subscribe'), 'aria-label': 'Subscribe' do
= link_to user_path(@user, rss_url_options), class: link_classes + 'btn gl-button btn-default has-tooltip',
title: s_('UserProfile|Subscribe'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
= sprite_icon('rss', css_class: 'qa-rss-icon')
- if current_user && current_user.admin?
= link_to [:admin, @user], class: link_classes + 'btn gl-button btn-default', title: s_('UserProfile|View user in admin area'),

View File

@ -0,0 +1,5 @@
---
title: Fix bug in personal snippet thread discussions
merge_request: 52490
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Replace OpenSSL constants with strings
merge_request: 52432
author: Takuya Noguchi
type: other

View File

@ -0,0 +1,5 @@
---
title: Allow new docs badges in UI links
merge_request: 52651
author:
type: other

View File

@ -0,0 +1,5 @@
---
title: Fix regression with old wiki image uploads
merge_request: 52656
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Fix tooltip when drag comment selection is enabled
merge_request: 52595
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Fix exclude path for backup rsync command
merge_request: 52503
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Add btn-default class to button in project breadcrumb
merge_request: 51910
author: Yogi (@yo)
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Add btn-default to MR edit button
merge_request: 51879
author: Yogi (@yo)
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Add gl-button to new issues and MR page
merge_request: 51295
author: Yogi (@yo)
type: other

View File

@ -0,0 +1,5 @@
---
title: Apply new GitLab UI for report abuse button
merge_request: 52049
author: Yogi (@yo)
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Apply new GitLab UI for input fields in auth screens
merge_request: 52167
author: Yogi (@yo)
type: other

View File

@ -0,0 +1,5 @@
---
title: Remove huge bottom margin for expand file button
merge_request: 51802
author: Yogi (@yo)
type: other

View File

@ -4,6 +4,6 @@ class AddAutoDevOpsEnabledToNamespaces < ActiveRecord::Migration[5.0]
DOWNTIME = false
def change
add_column :namespaces, :auto_devops_enabled, :boolean
add_column :namespaces, :auto_devops_enabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,6 +7,6 @@ class AddLastCiMinutesNotificationAtToNamespaces < ActiveRecord::Migration[5.1]
DOWNTIME = false
def change
add_column :namespaces, :last_ci_minutes_notification_at, :datetime_with_timezone
add_column :namespaces, :last_ci_minutes_notification_at, :datetime_with_timezone # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -4,6 +4,6 @@ class AddLastCiMinutesUsageNotificationLevelToNamespaces < ActiveRecord::Migrati
DOWNTIME = false
def change
add_column :namespaces, :last_ci_minutes_usage_notification_level, :integer
add_column :namespaces, :last_ci_minutes_usage_notification_level, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -6,7 +6,7 @@ class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1]
DOWNTIME = false
def up
add_column(:namespaces, :subgroup_creation_level, :integer)
add_column(:namespaces, :subgroup_creation_level, :integer) # rubocop:disable Migration/AddColumnsToWideTables
change_column_default(:namespaces,
:subgroup_creation_level,
::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS)

View File

@ -4,6 +4,6 @@ class AddGroupEmailsDisabled < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :emails_disabled, :boolean
add_column :namespaces, :emails_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -4,6 +4,6 @@ class AddNamespacesMaxPagesSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :max_pages_size, :integer
add_column :namespaces, :max_pages_size, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -4,6 +4,6 @@ class AddNamespacesMaxArtifactsSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :max_artifacts_size, :integer
add_column :namespaces, :max_artifacts_size, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -4,6 +4,6 @@ class AddMentionsDisabledToNamespaces < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :mentions_disabled, :boolean
add_column :namespaces, :mentions_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,7 +7,7 @@ class AddDefaultBranchProtectionToNamespaces < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :default_branch_protection, :integer, limit: 2
add_column :namespaces, :default_branch_protection, :integer, limit: 2 # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,7 +7,7 @@ class AddUnlockMembershipToLdapOfGroups < ActiveRecord::Migration[5.2]
def up
with_lock_retries do
add_column(:namespaces, :unlock_membership_to_ldap, :boolean)
add_column(:namespaces, :unlock_membership_to_ldap, :boolean) # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,7 +7,7 @@ class AddMaxPersonalAccessTokenLifetimeToNamespaces < ActiveRecord::Migration[6.
def up
with_lock_retries do
add_column :namespaces, :max_personal_access_token_lifetime, :integer
add_column :namespaces, :max_personal_access_token_lifetime, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,7 +7,7 @@ class AddPushRuleIdToGroups < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :push_rule_id, :bigint
add_column :namespaces, :push_rule_id, :bigint # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,8 +7,8 @@ class AddSharedRunnersEnabledAndOverrideToNamespaces < ActiveRecord::Migration[6
def up
with_lock_retries do
add_column :namespaces, :shared_runners_enabled, :boolean, default: true, null: false
add_column :namespaces, :allow_descendants_override_disabled_shared_runners, :boolean, default: false, null: false
add_column :namespaces, :shared_runners_enabled, :boolean, default: true, null: false # rubocop:disable Migration/AddColumnsToWideTables
add_column :namespaces, :allow_descendants_override_disabled_shared_runners, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,7 +7,7 @@ class AddTraversalIdsToNamespaces < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :traversal_ids, :integer, array: true, default: [], null: false
add_column :namespaces, :traversal_ids, :integer, array: true, default: [], null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -7,7 +7,7 @@ class AddDelayedProjectRemovalToNamespaces < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false
add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -16,7 +16,7 @@ class RemoveRepositoryReadOnlyToGroups < ActiveRecord::Migration[6.0]
def down
unless column_exists?(:namespaces, :repository_read_only)
with_lock_retries do
add_column :namespaces, :repository_read_only, :boolean, default: false, null: false
add_column :namespaces, :repository_read_only, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end
end

View File

@ -18,7 +18,7 @@ class RemoveNamespacesTrialEndsOn < ActiveRecord::Migration[6.0]
def down
unless column_exists?(:namespaces, :trial_ends_on)
with_lock_retries do
add_column :namespaces, :trial_ends_on, :datetime_with_timezone
add_column :namespaces, :trial_ends_on, :datetime_with_timezone # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -16,7 +16,7 @@ class DropNamespacesPlanId < ActiveRecord::Migration[6.0]
def down
unless column_exists?(:namespaces, :plan_id)
with_lock_retries do
add_column :namespaces, :plan_id, :integer
add_column :namespaces, :plan_id, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end

View File

@ -5,9 +5,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: reference, api
---
# Visual Review discussions API **(STARTER)**
# Visual Review discussions API **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18710) in [GitLab Starter](https://about.gitlab.com/pricing/) 12.5.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18710) in GitLab 12.5.
> - [Moved](https://about.gitlab.com/blog/2021/01/26/new-gitlab-product-subscription-model/) to GitLab Premium in 13.9.
Visual Review discussions are notes on Merge Requests sent as
feedback from [Visual Reviews](../ci/review_apps/index.md#visual-reviews).

View File

@ -166,9 +166,10 @@ Read the [documentation on Pipelines for Merged Results](pipelines_for_merged_re
Read the [documentation on Merge Trains](pipelines_for_merged_results/merge_trains/index.md).
## Run pipelines in the parent project for merge requests from a forked project **(STARTER)**
## Run pipelines in the parent project for merge requests from a forked project **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217451) in GitLab 13.3.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217451) in GitLab 13.3.
> - [Moved](https://about.gitlab.com/blog/2021/01/26/new-gitlab-product-subscription-model/) to GitLab Premium in 13.9.
By default, external contributors working from forks can't create pipelines in the
parent project. When a pipeline for merge requests is triggered by a merge request

View File

@ -186,12 +186,13 @@ After you have the route mapping set up, it takes effect in the following locati
![View on environment button in file view](img/view_on_env_blob.png)
## Visual Reviews **(STARTER)**
## Visual Reviews **(PREMIUM)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10761) in GitLab Starter 12.0.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10761) in GitLab 12.0.
> - [Moved](https://about.gitlab.com/blog/2021/01/26/new-gitlab-product-subscription-model/) to GitLab Premium in 13.9.
> - It's [deployed behind a feature flag](../../user/feature_flags.md), enabled by default.
> - It's enabled on GitLab.com.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-visual-reviews). **(STARTER ONLY)**
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-visual-reviews). **(PREMIUM SELF)**
With Visual Reviews, members of any team (Product, Design, Quality, and so on) can provide feedback comments through a form in your review apps. The comments are added to the merge request that triggered the review app.
@ -288,7 +289,7 @@ can supply the ID by either:
- Dynamically adding the `data-merge-request-id` value during the build of the app.
- Supplying it manually through the visual review form in the app.
### Enable or disable Visual Reviews **(STARTER ONLY)**
### Enable or disable Visual Reviews **(PREMIUM SELF)**
Visual Reviews is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)

View File

@ -86,9 +86,9 @@ be updated for artifacts created before this setting was changed.
The administrator may need to manually search for and expire previously-created
artifacts, as described in the [troubleshooting documentation](../../../administration/troubleshooting/gitlab_rails_cheat_sheet.md#remove-artifacts-more-than-a-week-old).
## Shared runners pipeline minutes quota **(STARTER ONLY)**
## Shared runners pipeline minutes quota **(PREMIUM SELF)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1078) in GitLab Starter 8.16.
> [Moved](https://about.gitlab.com/blog/2021/01/26/new-gitlab-product-subscription-model/) to GitLab Premium in 13.9.
If you have enabled shared runners for your GitLab instance, you can limit their
usage by setting a maximum number of pipeline minutes that a group can use on
@ -158,18 +158,6 @@ Area of your GitLab instance (`.gitlab-ci.yml` if not set):
It is also possible to specify a [custom CI/CD configuration path for a specific project](../../../ci/pipelines/settings.md#custom-cicd-configuration-path).
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->
## Required pipeline configuration **(PREMIUM ONLY)**
WARNING:
@ -228,3 +216,15 @@ To set the maximum file size:
1. Find the package type you would like to adjust.
1. Enter the maximum file size, in bytes.
1. Click **Save size limits**.
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->

View File

@ -137,7 +137,7 @@ module Backup
if s == DEFAULT_EXCLUDE
'--exclude=' + s
elsif fmt == :rsync
'--exclude=/' + s
'--exclude=/' + File.join(File.basename(app_files_dir), s)
elsif fmt == :tar
'--exclude=./' + s
end

View File

@ -35,7 +35,7 @@ module Gitlab
def secret
OpenSSL::HMAC.hexdigest(
OpenSSL::Digest::SHA256.new,
OpenSSL::Digest.new('SHA256'),
::Settings.attr_encrypted_db_key_base,
HMAC_KEY
)

View File

@ -203,7 +203,7 @@ module Gitlab
def self.authorization_token(storage)
token = token(storage).to_s
issued_at = real_time.to_i.to_s
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, token, issued_at)
hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('SHA256'), token, issued_at)
"v2.#{hmac}.#{issued_at}"
end

View File

@ -59,7 +59,7 @@ module Gitlab
cert.add_extension(extension_factory.create_extension('keyUsage', 'cRLSign,keyCertSign', true))
end
cert.sign(signed_by&.key || key, OpenSSL::Digest::SHA256.new)
cert.sign(signed_by&.key || key, OpenSSL::Digest.new('SHA256'))
new(key, cert)
end

View File

@ -4,7 +4,7 @@ module Gitlab
module Utils
module Markdown
PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u.freeze
PRODUCT_SUFFIX = /\s*\**\((core|starter|premium|ultimate)(\s+only)?\)\**/.freeze
PRODUCT_SUFFIX = /\s*\**\((core|starter|premium|ultimate)(\s+(only|self|sass))?\)\**/.freeze
def string_to_anchor(string)
string

View File

@ -18938,6 +18938,9 @@ msgstr ""
msgid "NetworkPolicies|None selected"
msgstr ""
msgid "NetworkPolicies|Please %{installLinkStart}install%{installLinkEnd} and %{configureLinkStart}configure a Kubernetes Agent for this project%{configureLinkEnd} to enable alerts."
msgstr ""
msgid "NetworkPolicies|Policies are a specification of how groups of pods are allowed to communicate with each other's network endpoints."
msgstr ""

View File

@ -7,11 +7,12 @@ module RuboCop
plan_limits
].freeze
# Tables with large number of columns (> 50 on GitLab.com as of 03/2020)
# Tables with large number of columns (> 50 on GitLab.com as of 01/2021)
WIDE_TABLES = %i[
users
projects
ci_builds
namespaces
projects
users
].freeze
# List of helpers that add new columns, either directly (ADD_COLUMN_METHODS)

View File

@ -4,15 +4,34 @@ require 'spec_helper'
RSpec.describe 'Thread Comments Snippet', :js do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:snippet) { create(:project_snippet, :private, :repository, project: project, author: user) }
before do
project.add_maintainer(user)
sign_in(user)
visit project_snippet_path(project, snippet)
end
it_behaves_like 'thread comments', 'snippet'
context 'with project snippets' do
let_it_be(:project) do
create(:project).tap do |p|
p.add_maintainer(user)
end
end
let_it_be(:snippet) { create(:project_snippet, :private, :repository, project: project, author: user) }
before do
visit project_snippet_path(project, snippet)
end
it_behaves_like 'thread comments', 'snippet'
end
context 'with personal snippets' do
let_it_be(:snippet) { create(:personal_snippet, :private, :repository, author: user) }
before do
visit snippet_path(snippet)
end
it_behaves_like 'thread comments', 'snippet'
end
end

View File

@ -143,10 +143,21 @@ describe('addCommentTooltip', () => {
'Commenting on symbolic links that replace or are replaced by files is currently not supported.';
const brokenRealTooltip =
'Commenting on files that replace or are replaced by symbolic links is currently not supported.';
const commentTooltip = 'Add a comment to this line';
const dragTooltip = 'Add a comment to this line or drag for multiple lines';
it('should return default tooltip', () => {
expect(utils.addCommentTooltip()).toBeUndefined();
});
it('should return comment tooltip', () => {
expect(utils.addCommentTooltip({})).toEqual(commentTooltip);
});
it('should return drag comment tooltip when dragging is enabled', () => {
expect(utils.addCommentTooltip({}, true)).toEqual(dragTooltip);
});
it('should return broken symlink tooltip', () => {
expect(utils.addCommentTooltip({ commentsDisabled: { wasSymbolic: true } })).toEqual(
brokenSymLinkTooltip,

View File

@ -355,6 +355,21 @@ RSpec.describe MarkupHelper do
expect(doc.css('.gl-label-link')).not_to be_empty
end
end
context 'when content has uploads' do
let(:upload_link) { '/uploads/test.png' }
let(:content) { "![ImageTest](#{upload_link})" }
before do
allow(wiki).to receive(:wiki_base_path).and_return(project.wiki.wiki_base_path)
end
it 'renders uploads relative to project' do
result = helper.render_wiki_content(wiki)
expect(result).to include("#{project.full_path}#{upload_link}")
end
end
end
context 'when file is Asciidoc' do

View File

@ -150,7 +150,7 @@ RSpec.describe Backup::Files do
it 'excludes tmp dirs from rsync' do
expect(Gitlab::Popen).to receive(:popen)
.with(%w(rsync -a --delete --exclude=lost+found --exclude=/@pages.tmp /var/gitlab-pages /var/gitlab-backup))
.with(%w(rsync -a --delete --exclude=lost+found --exclude=/gitlab-pages/@pages.tmp /var/gitlab-pages /var/gitlab-backup))
.and_return(['', 0])
subject.dump
@ -158,7 +158,7 @@ RSpec.describe Backup::Files do
it 'retries if rsync fails due to vanishing files' do
expect(Gitlab::Popen).to receive(:popen)
.with(%w(rsync -a --delete --exclude=lost+found --exclude=/@pages.tmp /var/gitlab-pages /var/gitlab-backup))
.with(%w(rsync -a --delete --exclude=lost+found --exclude=/gitlab-pages/@pages.tmp /var/gitlab-pages /var/gitlab-backup))
.and_return(['rsync failed', 24], ['', 0])
expect do
@ -168,7 +168,7 @@ RSpec.describe Backup::Files do
it 'raises an error and outputs an error message if rsync failed' do
allow(Gitlab::Popen).to receive(:popen)
.with(%w(rsync -a --delete --exclude=lost+found --exclude=/@pages.tmp /var/gitlab-pages /var/gitlab-backup))
.with(%w(rsync -a --delete --exclude=lost+found --exclude=/gitlab-pages/@pages.tmp /var/gitlab-pages /var/gitlab-backup))
.and_return(['rsync failed', 1])
expect do
@ -186,8 +186,8 @@ RSpec.describe Backup::Files do
expect(subject.exclude_dirs(:tar)).to eq(['--exclude=lost+found', '--exclude=./@pages.tmp'])
end
it 'prepends a leading slash to rsync excludes' do
expect(subject.exclude_dirs(:rsync)).to eq(['--exclude=lost+found', '--exclude=/@pages.tmp'])
it 'prepends a leading slash and app_files_dir basename to rsync excludes' do
expect(subject.exclude_dirs(:rsync)).to eq(['--exclude=lost+found', '--exclude=/gitlab-pages/@pages.tmp'])
end
end

View File

@ -6,7 +6,7 @@ RSpec.describe Gitlab::ConanToken do
let(:jwt_secret) do
OpenSSL::HMAC.hexdigest(
OpenSSL::Digest::SHA256.new,
OpenSSL::Digest.new('SHA256'),
base_secret,
described_class::HMAC_KEY
)

View File

@ -59,8 +59,8 @@ RSpec.describe Gitlab::Utils::Markdown do
is_expected.to eq 'my-header'
end
context 'with only modifier' do
let(:string) { 'My Header (STARTER ONLY)' }
context 'with self modifier' do
let(:string) { 'My Header (PREMIUM SELF)' }
it 'ignores a product suffix' do
is_expected.to eq 'my-header'
@ -68,15 +68,15 @@ RSpec.describe Gitlab::Utils::Markdown do
end
context 'with "*" around a product suffix' do
let(:string) { 'My Header **(STARTER)**' }
let(:string) { 'My Header **(PREMIUM)**' }
it 'ignores a product suffix' do
is_expected.to eq 'my-header'
end
end
context 'with "*" around a product suffix and only modifier' do
let(:string) { 'My Header **(STARTER ONLY)**' }
context 'with "*" around a product suffix and sass modifier' do
let(:string) { 'My Header **(PREMIUM SASS)**' }
it 'ignores a product suffix' do
is_expected.to eq 'my-header'

View File

@ -135,7 +135,7 @@ RSpec.describe PagesDomains::ObtainLetsEncryptCertificateService do
cert.add_extension ef.create_extension("authorityKeyIdentifier",
"keyid:always,issuer:always")
cert.sign key, OpenSSL::Digest::SHA1.new
cert.sign key, OpenSSL::Digest.new('SHA1')
cert.to_pem
end

View File

@ -52,7 +52,7 @@ module SmimeHelper
cert.add_extension(extension_factory.create_extension('extendedKeyUsage', 'clientAuth,emailProtection', false))
end
cert.sign(signed_by&.fetch(:key, nil) || key, OpenSSL::Digest::SHA256.new)
cert.sign(signed_by&.fetch(:key, nil) || key, OpenSSL::Digest.new('SHA256'))
{ key: key, cert: cert }
end

View File

@ -22,7 +22,7 @@ RSpec.shared_context 'conan api setup' do
let(:jwt_secret) do
OpenSSL::HMAC.hexdigest(
OpenSSL::Digest::SHA256.new,
OpenSSL::Digest.new('SHA256'),
base_secret,
Gitlab::ConanToken::HMAC_KEY
)

View File

@ -150,12 +150,13 @@ RSpec.shared_examples 'thread comments' do |resource_name|
wait_for_requests
end
it 'clicking "Start thread" will post a thread' do
it 'clicking "Start thread" will post a thread and show a reply component' do
expect(page).to have_content(comment)
new_comment = all(comments_selector).last
expect(new_comment).to have_selector('.discussion')
expect(new_comment).to have_css('.discussion-with-resolve-btn')
end
if resource_name =~ /(issue|merge request)/

View File

@ -2,11 +2,12 @@
RSpec.shared_examples 'can move repository storage' do
let(:container) { raise NotImplementedError }
let(:repository) { container.repository }
describe '#set_repository_read_only!' do
it 'makes the repository read-only' do
expect { container.set_repository_read_only! }
.to change(container, :repository_read_only?)
.to change { container.repository_read_only? }
.from(false)
.to(true)
end
@ -28,7 +29,7 @@ RSpec.shared_examples 'can move repository storage' do
allow(container).to receive(:git_transfer_in_progress?) { true }
expect { container.set_repository_read_only!(skip_git_transfer_check: true) }
.to change(container, :repository_read_only?)
.to change { container.repository_read_only? }
.from(false)
.to(true)
end
@ -38,16 +39,16 @@ RSpec.shared_examples 'can move repository storage' do
describe '#set_repository_writable!' do
it 'sets repository_read_only to false' do
expect { container.set_repository_writable! }
.to change(container, :repository_read_only)
.to change { container.repository_read_only? }
.from(true).to(false)
end
end
describe '#reference_counter' do
it 'returns a Gitlab::ReferenceCounter object' do
expect(Gitlab::ReferenceCounter).to receive(:new).with(container.repository.gl_repository).and_call_original
expect(Gitlab::ReferenceCounter).to receive(:new).with(repository.gl_repository).and_call_original
result = container.reference_counter(type: container.repository.repo_type)
result = container.reference_counter(type: repository.repo_type)
expect(result).to be_a Gitlab::ReferenceCounter
end