diff --git a/.gitpod.yml b/.gitpod.yml index a28a11d6612..950b06b40e7 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -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 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 92f4414d815..0189a3d6372 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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: diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index e808728421d..262de3bbaa1 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -627c53e3e51f73c3d19df2b49b956c02ba200e78 +c38393255d22bf3533ca8b8714f614411f10fc30 diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index f5a3d69843a..57ed49495ba 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -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" > -

+

{{ $options.i18n.autoCollapsed }}

{ ]; }; -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; diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue index 7d44a28b4bb..4601faf26cd 100644 --- a/app/assets/javascripts/incidents/components/incidents_list.vue +++ b/app/assets/javascripts/incidents/components/incidents_list.vue @@ -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, diff --git a/app/controllers/snippets/notes_controller.rb b/app/controllers/snippets/notes_controller.rb index 8532257cb8d..8a4e8edbf3c 100644 --- a/app/controllers/snippets/notes_controller.rb +++ b/app/controllers/snippets/notes_controller.rb @@ -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 diff --git a/app/helpers/markup_helper.rb b/app/helpers/markup_helper.rb index 25d56ffca2c..ad206d0e5b5 100644 --- a/app/helpers/markup_helper.rb +++ b/app/helpers/markup_helper.rb @@ -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 diff --git a/app/models/ci/build_trace_section.rb b/app/models/ci/build_trace_section.rb index 8be42eb48d6..5091e3ff04a 100644 --- a/app/models/ci/build_trace_section.rb +++ b/app/models/ci/build_trace_section.rb @@ -2,6 +2,7 @@ module Ci class BuildTraceSection < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning extend Gitlab::Ci::Model belongs_to :build, class_name: 'Ci::Build' diff --git a/app/models/concerns/can_move_repository_storage.rb b/app/models/concerns/can_move_repository_storage.rb index 52c3a4106e3..1132e4e79ac 100644 --- a/app/models/concerns/can_move_repository_storage.rb +++ b/app/models/concerns/can_move_repository_storage.rb @@ -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 diff --git a/app/models/concerns/suppress_composite_primary_key_warning.rb b/app/models/concerns/suppress_composite_primary_key_warning.rb new file mode 100644 index 00000000000..32634e7bc72 --- /dev/null +++ b/app/models/concerns/suppress_composite_primary_key_warning.rb @@ -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 diff --git a/app/models/deployment_merge_request.rb b/app/models/deployment_merge_request.rb index 64a578e16bf..7949bd81605 100644 --- a/app/models/deployment_merge_request.rb +++ b/app/models/deployment_merge_request.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class DeploymentMergeRequest < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + belongs_to :deployment, optional: false belongs_to :merge_request, optional: false diff --git a/app/models/issue_assignee.rb b/app/models/issue_assignee.rb index 7f3d552b3d9..d62f0eb170c 100644 --- a/app/models/issue_assignee.rb +++ b/app/models/issue_assignee.rb @@ -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 diff --git a/app/models/merge_request_context_commit_diff_file.rb b/app/models/merge_request_context_commit_diff_file.rb index b89d1983ce3..6f15df1b70f 100644 --- a/app/models/merge_request_context_commit_diff_file.rb +++ b/app/models/merge_request_context_commit_diff_file.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class MergeRequestContextCommitDiffFile < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + include Gitlab::EncodingHelper include ShaAttribute include DiffFile diff --git a/app/models/merge_request_diff_commit.rb b/app/models/merge_request_diff_commit.rb index cf2d07b8561..aacc9a92120 100644 --- a/app/models/merge_request_diff_commit.rb +++ b/app/models/merge_request_diff_commit.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class MergeRequestDiffCommit < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + include BulkInsertSafe include ShaAttribute include CachedCommit diff --git a/app/models/merge_request_diff_file.rb b/app/models/merge_request_diff_file.rb index 817e77bf12f..f3f64971426 100644 --- a/app/models/merge_request_diff_file.rb +++ b/app/models/merge_request_diff_file.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class MergeRequestDiffFile < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + include BulkInsertSafe include Gitlab::EncodingHelper include DiffFile diff --git a/app/models/milestone_release.rb b/app/models/milestone_release.rb index 2f2bf91e436..c6b5a967af9 100644 --- a/app/models/milestone_release.rb +++ b/app/models/milestone_release.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class MilestoneRelease < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + belongs_to :milestone belongs_to :release diff --git a/app/models/project_authorization.rb b/app/models/project_authorization.rb index 366852d93bf..2c3f70654f8 100644 --- a/app/models/project_authorization.rb +++ b/app/models/project_authorization.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class ProjectAuthorization < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning include FromUnion belongs_to :user diff --git a/app/models/project_pages_metadatum.rb b/app/models/project_pages_metadatum.rb index 0b12367f4bf..58dbac9057f 100644 --- a/app/models/project_pages_metadatum.rb +++ b/app/models/project_pages_metadatum.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class ProjectPagesMetadatum < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + include EachBatch self.primary_key = :project_id diff --git a/app/models/push_event_payload.rb b/app/models/push_event_payload.rb index 6a32c480b04..2786ecb641a 100644 --- a/app/models/push_event_payload.rb +++ b/app/models/push_event_payload.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class PushEventPayload < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + include ShaAttribute belongs_to :event, inverse_of: :push_event_payload diff --git a/app/models/repository_language.rb b/app/models/repository_language.rb index 6b1793a551f..b7a96211fb1 100644 --- a/app/models/repository_language.rb +++ b/app/models/repository_language.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class RepositoryLanguage < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + belongs_to :project belongs_to :programming_language diff --git a/app/models/user_interacted_project.rb b/app/models/user_interacted_project.rb index 7e7a387d3d4..4c8cc5fc83a 100644 --- a/app/models/user_interacted_project.rb +++ b/app/models/user_interacted_project.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class UserInteractedProject < ApplicationRecord + extend SuppressCompositePrimaryKeyWarning + belongs_to :user belongs_to :project diff --git a/app/services/clusters/kubernetes/configure_istio_ingress_service.rb b/app/services/clusters/kubernetes/configure_istio_ingress_service.rb index 53c3c686f07..3b7e094bc97 100644 --- a/app/services/clusters/kubernetes/configure_istio_ingress_service.rb +++ b/app/services/clusters/kubernetes/configure_istio_ingress_service.rb @@ -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, diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 770a29a629e..ace80ba16dd 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -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' diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 42e301d88ae..058c5e630c8 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -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 diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index fe999851605..3b1cba59b58 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -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' diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index a1a1a767847..270652483b7 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -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' } diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index 3fc99b6a47d..8f397de41b7 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -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' } diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml index f5f76eb92b1..8704bd16a13 100644 --- a/app/views/devise/sessions/two_factor.html.haml +++ b/app/views/devise/sessions/two_factor.html.haml @@ -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' } diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index acbf3b398b0..aa2224b3ea3 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -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? diff --git a/app/views/profiles/passwords/edit.html.haml b/app/views/profiles/passwords/edit.html.haml index 1ee5f52e407..b281dbb4367 100644 --- a/app/views/profiles/passwords/edit.html.haml +++ b/app/views/profiles/passwords/edit.html.haml @@ -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? diff --git a/app/views/profiles/passwords/new.html.haml b/app/views/profiles/passwords/new.html.haml index f6783528243..ffec6baa20e 100644 --- a/app/views/profiles/passwords/new.html.haml +++ b/app/views/profiles/passwords/new.html.haml @@ -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' diff --git a/app/views/projects/_find_file_link.html.haml b/app/views/projects/_find_file_link.html.haml index c3b4a61c28a..a4bf72edf12 100644 --- a/app/views/projects/_find_file_link.html.haml +++ b/app/views/projects/_find_file_link.html.haml @@ -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') diff --git a/app/views/projects/blob/_breadcrumb.html.haml b/app/views/projects/blob/_breadcrumb.html.haml index 710417f90e3..e666bb237bd 100644 --- a/app/views/projects/blob/_breadcrumb.html.haml +++ b/app/views/projects/blob/_breadcrumb.html.haml @@ -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' diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml index 0fcbf2ca1eb..3071e5ea5f8 100644 --- a/app/views/projects/buttons/_download.html.haml +++ b/app/views/projects/buttons/_download.html.haml @@ -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") diff --git a/app/views/projects/merge_requests/_mr_title.html.haml b/app/views/projects/merge_requests/_mr_title.html.haml index 9e33fc97bd1..61747fe2c8d 100644 --- a/app/views/projects/merge_requests/_mr_title.html.haml +++ b/app/views/projects/merge_requests/_mr_title.html.haml @@ -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' diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 552f83906e1..2a91ffbdbaa 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -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 diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 9f6b0bc2373..1cb997138fd 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -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'), diff --git a/changelogs/unreleased/299719-fj-fix-bug-personal-snippet-thread-discussion.yml b/changelogs/unreleased/299719-fj-fix-bug-personal-snippet-thread-discussion.yml new file mode 100644 index 00000000000..d19b98eb120 --- /dev/null +++ b/changelogs/unreleased/299719-fj-fix-bug-personal-snippet-thread-discussion.yml @@ -0,0 +1,5 @@ +--- +title: Fix bug in personal snippet thread discussions +merge_request: 52490 +author: +type: fixed diff --git a/changelogs/unreleased/Lint-DeprecatedOpenSSLConstant.yml b/changelogs/unreleased/Lint-DeprecatedOpenSSLConstant.yml new file mode 100644 index 00000000000..45b0d7ebb99 --- /dev/null +++ b/changelogs/unreleased/Lint-DeprecatedOpenSSLConstant.yml @@ -0,0 +1,5 @@ +--- +title: Replace OpenSSL constants with strings +merge_request: 52432 +author: Takuya Noguchi +type: other diff --git a/changelogs/unreleased/docs-ci-starter.yml b/changelogs/unreleased/docs-ci-starter.yml new file mode 100644 index 00000000000..e1b119932bf --- /dev/null +++ b/changelogs/unreleased/docs-ci-starter.yml @@ -0,0 +1,5 @@ +--- +title: Allow new docs badges in UI links +merge_request: 52651 +author: +type: other diff --git a/changelogs/unreleased/fj-fix-regression-old-uploads.yml b/changelogs/unreleased/fj-fix-regression-old-uploads.yml new file mode 100644 index 00000000000..5e2cc5fcf9d --- /dev/null +++ b/changelogs/unreleased/fj-fix-regression-old-uploads.yml @@ -0,0 +1,5 @@ +--- +title: Fix regression with old wiki image uploads +merge_request: 52656 +author: +type: fixed diff --git a/changelogs/unreleased/jdb-fix-drag-comment-tooltip.yml b/changelogs/unreleased/jdb-fix-drag-comment-tooltip.yml new file mode 100644 index 00000000000..40405d7dfb6 --- /dev/null +++ b/changelogs/unreleased/jdb-fix-drag-comment-tooltip.yml @@ -0,0 +1,5 @@ +--- +title: Fix tooltip when drag comment selection is enabled +merge_request: 52595 +author: +type: fixed diff --git a/changelogs/unreleased/wc-rsync-exclude-path.yml b/changelogs/unreleased/wc-rsync-exclude-path.yml new file mode 100644 index 00000000000..9cc53674429 --- /dev/null +++ b/changelogs/unreleased/wc-rsync-exclude-path.yml @@ -0,0 +1,5 @@ +--- +title: Fix exclude path for backup rsync command +merge_request: 52503 +author: +type: fixed diff --git a/changelogs/unreleased/yo-btn-default-repo.yml b/changelogs/unreleased/yo-btn-default-repo.yml new file mode 100644 index 00000000000..7f1c972b007 --- /dev/null +++ b/changelogs/unreleased/yo-btn-default-repo.yml @@ -0,0 +1,5 @@ +--- +title: Add btn-default class to button in project breadcrumb +merge_request: 51910 +author: Yogi (@yo) +type: fixed diff --git a/changelogs/unreleased/yo-fix-mr-edit-button.yml b/changelogs/unreleased/yo-fix-mr-edit-button.yml new file mode 100644 index 00000000000..c26888e2b96 --- /dev/null +++ b/changelogs/unreleased/yo-fix-mr-edit-button.yml @@ -0,0 +1,5 @@ +--- +title: Add btn-default to MR edit button +merge_request: 51879 +author: Yogi (@yo) +type: fixed diff --git a/changelogs/unreleased/yo-gl-button-issuable-create-button.yml b/changelogs/unreleased/yo-gl-button-issuable-create-button.yml new file mode 100644 index 00000000000..06301056054 --- /dev/null +++ b/changelogs/unreleased/yo-gl-button-issuable-create-button.yml @@ -0,0 +1,5 @@ +--- +title: Add gl-button to new issues and MR page +merge_request: 51295 +author: Yogi (@yo) +type: other diff --git a/changelogs/unreleased/yo-gl-button-ra.yml b/changelogs/unreleased/yo-gl-button-ra.yml new file mode 100644 index 00000000000..a992682a35d --- /dev/null +++ b/changelogs/unreleased/yo-gl-button-ra.yml @@ -0,0 +1,5 @@ +--- +title: Apply new GitLab UI for report abuse button +merge_request: 52049 +author: Yogi (@yo) +type: fixed diff --git a/changelogs/unreleased/yo-new-input-auth.yml b/changelogs/unreleased/yo-new-input-auth.yml new file mode 100644 index 00000000000..976287241ca --- /dev/null +++ b/changelogs/unreleased/yo-new-input-auth.yml @@ -0,0 +1,5 @@ +--- +title: Apply new GitLab UI for input fields in auth screens +merge_request: 52167 +author: Yogi (@yo) +type: other diff --git a/changelogs/unreleased/yo-remove-space.yml b/changelogs/unreleased/yo-remove-space.yml new file mode 100644 index 00000000000..c25daa54e67 --- /dev/null +++ b/changelogs/unreleased/yo-remove-space.yml @@ -0,0 +1,5 @@ +--- +title: Remove huge bottom margin for expand file button +merge_request: 51802 +author: Yogi (@yo) +type: other diff --git a/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb b/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb index 93e7a84fb02..e4757b6bada 100644 --- a/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb +++ b/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb @@ -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 diff --git a/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb b/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb index c264a23cda0..53b2e9f01fe 100644 --- a/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb +++ b/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb @@ -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 diff --git a/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb b/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb index 1611340284c..02e06703acc 100644 --- a/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb +++ b/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb @@ -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 diff --git a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb index 3b75c92e518..6fcadc0c82c 100644 --- a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb +++ b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb @@ -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) diff --git a/db/migrate/20190715215549_add_group_emails_disabled.rb b/db/migrate/20190715215549_add_group_emails_disabled.rb index d3fd4d2d923..63a815cb880 100644 --- a/db/migrate/20190715215549_add_group_emails_disabled.rb +++ b/db/migrate/20190715215549_add_group_emails_disabled.rb @@ -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 diff --git a/db/migrate/20190911115109_add_namespaces_max_pages_size.rb b/db/migrate/20190911115109_add_namespaces_max_pages_size.rb index c14dfa74a5a..d3054714188 100644 --- a/db/migrate/20190911115109_add_namespaces_max_pages_size.rb +++ b/db/migrate/20190911115109_add_namespaces_max_pages_size.rb @@ -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 diff --git a/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb b/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb index 60c594c47a6..bec81d6c7e1 100644 --- a/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb +++ b/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb @@ -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 diff --git a/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb b/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb index dbd69568ef2..a67d032795d 100644 --- a/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb +++ b/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb @@ -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 diff --git a/db/migrate/20200207062728_add_default_branch_protection_to_namespaces.rb b/db/migrate/20200207062728_add_default_branch_protection_to_namespaces.rb index 6eb650e6b6a..56a30b02290 100644 --- a/db/migrate/20200207062728_add_default_branch_protection_to_namespaces.rb +++ b/db/migrate/20200207062728_add_default_branch_protection_to_namespaces.rb @@ -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 diff --git a/db/migrate/20200304124406_add_unlock_membership_to_ldap_of_groups.rb b/db/migrate/20200304124406_add_unlock_membership_to_ldap_of_groups.rb index 2aa58c92c3e..19e6573af9b 100644 --- a/db/migrate/20200304124406_add_unlock_membership_to_ldap_of_groups.rb +++ b/db/migrate/20200304124406_add_unlock_membership_to_ldap_of_groups.rb @@ -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 diff --git a/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb b/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb index 907c832ce46..7388d6bbc13 100644 --- a/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb +++ b/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb @@ -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 diff --git a/db/migrate/20200407120000_add_push_rule_id_to_groups.rb b/db/migrate/20200407120000_add_push_rule_id_to_groups.rb index 4b4e99052aa..738f0a4c605 100644 --- a/db/migrate/20200407120000_add_push_rule_id_to_groups.rb +++ b/db/migrate/20200407120000_add_push_rule_id_to_groups.rb @@ -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 diff --git a/db/migrate/20200424102023_add_shared_runners_enabled_and_override_to_namespaces.rb b/db/migrate/20200424102023_add_shared_runners_enabled_and_override_to_namespaces.rb index 2555a50be44..1adc421b9af 100644 --- a/db/migrate/20200424102023_add_shared_runners_enabled_and_override_to_namespaces.rb +++ b/db/migrate/20200424102023_add_shared_runners_enabled_and_override_to_namespaces.rb @@ -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 diff --git a/db/migrate/20200609012539_add_traversal_ids_to_namespaces.rb b/db/migrate/20200609012539_add_traversal_ids_to_namespaces.rb index d7f282b69f8..3041d7a8e58 100644 --- a/db/migrate/20200609012539_add_traversal_ids_to_namespaces.rb +++ b/db/migrate/20200609012539_add_traversal_ids_to_namespaces.rb @@ -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 diff --git a/db/migrate/20200701190523_add_delayed_project_removal_to_namespaces.rb b/db/migrate/20200701190523_add_delayed_project_removal_to_namespaces.rb index 2d5bbc1cba1..fcc08723520 100644 --- a/db/migrate/20200701190523_add_delayed_project_removal_to_namespaces.rb +++ b/db/migrate/20200701190523_add_delayed_project_removal_to_namespaces.rb @@ -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 diff --git a/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb b/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb index a9607ca8fc6..0b353ba5d88 100644 --- a/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb +++ b/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb @@ -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 diff --git a/db/post_migrate/20200408132152_remove_namespaces_trial_ends_on.rb b/db/post_migrate/20200408132152_remove_namespaces_trial_ends_on.rb index cfe0daaf50f..a303b9d1869 100644 --- a/db/post_migrate/20200408132152_remove_namespaces_trial_ends_on.rb +++ b/db/post_migrate/20200408132152_remove_namespaces_trial_ends_on.rb @@ -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 diff --git a/db/post_migrate/20200424043515_drop_namespaces_plan_id.rb b/db/post_migrate/20200424043515_drop_namespaces_plan_id.rb index 16a56b16e5a..b05f2da648a 100644 --- a/db/post_migrate/20200424043515_drop_namespaces_plan_id.rb +++ b/db/post_migrate/20200424043515_drop_namespaces_plan_id.rb @@ -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 diff --git a/doc/api/visual_review_discussions.md b/doc/api/visual_review_discussions.md index 67d9c523862..c3414a4e9ec 100644 --- a/doc/api/visual_review_discussions.md +++ b/doc/api/visual_review_discussions.md @@ -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). diff --git a/doc/ci/merge_request_pipelines/index.md b/doc/ci/merge_request_pipelines/index.md index 999d15eac24..5c3cf6ec02e 100644 --- a/doc/ci/merge_request_pipelines/index.md +++ b/doc/ci/merge_request_pipelines/index.md @@ -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 diff --git a/doc/ci/review_apps/index.md b/doc/ci/review_apps/index.md index 5fdeaf32069..063e05fddab 100644 --- a/doc/ci/review_apps/index.md +++ b/doc/ci/review_apps/index.md @@ -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) diff --git a/doc/user/admin_area/settings/continuous_integration.md b/doc/user/admin_area/settings/continuous_integration.md index 5f65277813d..f6fe0962726 100644 --- a/doc/user/admin_area/settings/continuous_integration.md +++ b/doc/user/admin_area/settings/continuous_integration.md @@ -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). - - ## 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**. + + diff --git a/lib/backup/files.rb b/lib/backup/files.rb index 0f6ed847dea..42cfff98239 100644 --- a/lib/backup/files.rb +++ b/lib/backup/files.rb @@ -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 diff --git a/lib/gitlab/conan_token.rb b/lib/gitlab/conan_token.rb index 7526c10b608..d03997b4158 100644 --- a/lib/gitlab/conan_token.rb +++ b/lib/gitlab/conan_token.rb @@ -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 ) diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index 31734abe77f..c51349b9113 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -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 diff --git a/lib/gitlab/kubernetes/helm/v2/certificate.rb b/lib/gitlab/kubernetes/helm/v2/certificate.rb index f603ff44ef3..17ea2eb5188 100644 --- a/lib/gitlab/kubernetes/helm/v2/certificate.rb +++ b/lib/gitlab/kubernetes/helm/v2/certificate.rb @@ -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 diff --git a/lib/gitlab/utils/markdown.rb b/lib/gitlab/utils/markdown.rb index e783ac785cc..d5fd765bcfd 100644 --- a/lib/gitlab/utils/markdown.rb +++ b/lib/gitlab/utils/markdown.rb @@ -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 diff --git a/locale/gitlab.pot b/locale/gitlab.pot index b427233886f..ac192421b3c 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" diff --git a/rubocop/migration_helpers.rb b/rubocop/migration_helpers.rb index e9533fb65b2..c06d69a4359 100644 --- a/rubocop/migration_helpers.rb +++ b/rubocop/migration_helpers.rb @@ -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) diff --git a/spec/features/discussion_comments/snippets_spec.rb b/spec/features/discussion_comments/snippets_spec.rb index b2d3fbf4b5d..42053e571e9 100644 --- a/spec/features/discussion_comments/snippets_spec.rb +++ b/spec/features/discussion_comments/snippets_spec.rb @@ -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 diff --git a/spec/frontend/diffs/components/diff_row_utils_spec.js b/spec/frontend/diffs/components/diff_row_utils_spec.js index d70d6b609ac..47ae3cd5867 100644 --- a/spec/frontend/diffs/components/diff_row_utils_spec.js +++ b/spec/frontend/diffs/components/diff_row_utils_spec.js @@ -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, diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb index 45e8a2e7e1a..3d1690f6588 100644 --- a/spec/helpers/markup_helper_spec.rb +++ b/spec/helpers/markup_helper_spec.rb @@ -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 diff --git a/spec/lib/backup/files_spec.rb b/spec/lib/backup/files_spec.rb index 450e396a389..90cd08ae9cc 100644 --- a/spec/lib/backup/files_spec.rb +++ b/spec/lib/backup/files_spec.rb @@ -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 diff --git a/spec/lib/gitlab/conan_token_spec.rb b/spec/lib/gitlab/conan_token_spec.rb index be1d3e757f5..00683cf6e47 100644 --- a/spec/lib/gitlab/conan_token_spec.rb +++ b/spec/lib/gitlab/conan_token_spec.rb @@ -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 ) diff --git a/spec/lib/gitlab/utils/markdown_spec.rb b/spec/lib/gitlab/utils/markdown_spec.rb index 93d91f7ed90..23cd770d168 100644 --- a/spec/lib/gitlab/utils/markdown_spec.rb +++ b/spec/lib/gitlab/utils/markdown_spec.rb @@ -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' diff --git a/spec/services/pages_domains/obtain_lets_encrypt_certificate_service_spec.rb b/spec/services/pages_domains/obtain_lets_encrypt_certificate_service_spec.rb index 4d489d7fe4b..79654c9b190 100644 --- a/spec/services/pages_domains/obtain_lets_encrypt_certificate_service_spec.rb +++ b/spec/services/pages_domains/obtain_lets_encrypt_certificate_service_spec.rb @@ -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 diff --git a/spec/support/helpers/smime_helper.rb b/spec/support/helpers/smime_helper.rb index 261aef9518e..fa16c433c6b 100644 --- a/spec/support/helpers/smime_helper.rb +++ b/spec/support/helpers/smime_helper.rb @@ -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 diff --git a/spec/support/shared_contexts/requests/api/conan_packages_shared_context.rb b/spec/support/shared_contexts/requests/api/conan_packages_shared_context.rb index 580ebf00dcb..7ad73ea18f4 100644 --- a/spec/support/shared_contexts/requests/api/conan_packages_shared_context.rb +++ b/spec/support/shared_contexts/requests/api/conan_packages_shared_context.rb @@ -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 ) diff --git a/spec/support/shared_examples/features/discussion_comments_shared_example.rb b/spec/support/shared_examples/features/discussion_comments_shared_example.rb index 560cfbfb117..6bebd59ed70 100644 --- a/spec/support/shared_examples/features/discussion_comments_shared_example.rb +++ b/spec/support/shared_examples/features/discussion_comments_shared_example.rb @@ -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)/ diff --git a/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb b/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb index 85a2c6f1449..8deeecea30d 100644 --- a/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb +++ b/spec/support/shared_examples/models/concerns/can_move_repository_storage_shared_examples.rb @@ -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