Merge branch '56392-enable-the-layout-extraspacing-cop' into 'master'

Enable the Layout/ExtraSpacing cop

Closes #56392

See merge request gitlab-org/gitlab-ce!24423
This commit is contained in:
Lin Jen-Shin 2019-01-24 15:09:52 +00:00
commit 61c51d3b6e
236 changed files with 355 additions and 366 deletions

View file

@ -15,12 +15,6 @@ Capybara/CurrentPathExpectation:
Layout/EmptyLinesAroundArguments: Layout/EmptyLinesAroundArguments:
Enabled: false Enabled: false
# Offense count: 253
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Enabled: false
# Offense count: 83 # Offense count: 83
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.

View file

@ -5,7 +5,7 @@ class PasswordsController < Devise::PasswordsController
before_action :resource_from_email, only: [:create] before_action :resource_from_email, only: [:create]
before_action :check_password_authentication_available, only: [:create] before_action :check_password_authentication_available, only: [:create]
before_action :throttle_reset, only: [:create] before_action :throttle_reset, only: [:create]
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def edit def edit

View file

@ -24,10 +24,10 @@ class Projects::CommitController < Projects::ApplicationController
apply_diff_view_cookie! apply_diff_view_cookie!
respond_to do |format| respond_to do |format|
format.html do format.html do
render render
end end
format.diff do format.diff do
send_git_diff(@project.repository, @commit.diff_refs) send_git_diff(@project.repository, @commit.diff_refs)
end end
format.patch do format.patch do

View file

@ -40,7 +40,7 @@ class Projects::DiscussionsController < Projects::ApplicationController
def render_json_with_discussions_serializer def render_json_with_discussions_serializer
render json: render json:
DiscussionSerializer.new(project: project, noteable: discussion.noteable, current_user: current_user, note_entity: ProjectNoteEntity) DiscussionSerializer.new(project: project, noteable: discussion.noteable, current_user: current_user, note_entity: ProjectNoteEntity)
.represent(discussion, context: self, render_truncated_diff_lines: true) .represent(discussion, context: self, render_truncated_diff_lines: true)
end end

View file

@ -55,7 +55,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
render json: serializer.represent(@merge_request, serializer: params[:serializer]) render json: serializer.represent(@merge_request, serializer: params[:serializer])
end end
format.patch do format.patch do
break render_404 unless @merge_request.diff_refs break render_404 unless @merge_request.diff_refs
send_git_patch @project.repository, @merge_request.diff_refs send_git_patch @project.repository, @merge_request.diff_refs

View file

@ -18,7 +18,7 @@ class Projects::PagesController < Projects::ApplicationController
project.pages_domains.destroy_all # rubocop: disable DestroyAll project.pages_domains.destroy_all # rubocop: disable DestroyAll
respond_to do |format| respond_to do |format|
format.html do format.html do
redirect_to project_pages_path(@project), redirect_to project_pages_path(@project),
status: 302, status: 302,
notice: 'Pages were removed' notice: 'Pages were removed'

View file

@ -8,7 +8,7 @@ module Types
abilities :change_namespace, :change_visibility_level, :rename_project, abilities :change_namespace, :change_visibility_level, :rename_project,
:remove_project, :archive_project, :remove_fork_project, :remove_project, :archive_project, :remove_fork_project,
:remove_pages, :read_project, :create_merge_request_in, :remove_pages, :read_project, :create_merge_request_in,
:read_wiki, :read_project_member, :create_issue, :upload_file, :read_wiki, :read_project_member, :create_issue, :upload_file,
:read_cycle_analytics, :download_code, :download_wiki_code, :read_cycle_analytics, :download_code, :download_wiki_code,
:fork_project, :create_project_snippet, :read_commit_status, :fork_project, :create_project_snippet, :read_commit_status,
:request_access, :create_pipeline, :create_pipeline_schedule, :request_access, :create_pipeline, :create_pipeline_schedule,

View file

@ -31,7 +31,7 @@ module AuthHelper
def form_based_provider_with_highest_priority def form_based_provider_with_highest_priority
@form_based_provider_with_highest_priority ||= begin @form_based_provider_with_highest_priority ||= begin
form_based_provider_priority.each do |provider_regexp| form_based_provider_priority.each do |provider_regexp|
highest_priority = form_based_providers.find { |provider| provider.match?(provider_regexp) } highest_priority = form_based_providers.find { |provider| provider.match?(provider_regexp) }
break highest_priority unless highest_priority.nil? break highest_priority unless highest_priority.nil?
end end
end end

View file

@ -209,7 +209,7 @@ module IssuablesHelper
end end
def issuable_labels_tooltip(labels, limit: 5) def issuable_labels_tooltip(labels, limit: 5)
first, last = labels.partition.with_index { |_, i| i < limit } first, last = labels.partition.with_index { |_, i| i < limit }
if labels && labels.any? if labels && labels.any?
label_names = first.collect { |label| label.fetch(:title) } label_names = first.collect { |label| label.fetch(:title) }

View file

@ -154,7 +154,7 @@ module Clusters
def build_kube_client! def build_kube_client!
raise "Incomplete settings" unless api_url raise "Incomplete settings" unless api_url
raise "No namespace" if cluster.project_type? && actual_namespace.empty? # can probably remove this line once we remove #actual_namespace raise "No namespace" if cluster.project_type? && actual_namespace.empty? # can probably remove this line once we remove #actual_namespace
unless (username && password) || token unless (username && password) || token
raise "Either username/password or token is required to access API" raise "Either username/password or token is required to access API"

View file

@ -85,11 +85,11 @@ module HasStatus
scope :running, -> { where(status: 'running') } scope :running, -> { where(status: 'running') }
scope :pending, -> { where(status: 'pending') } scope :pending, -> { where(status: 'pending') }
scope :success, -> { where(status: 'success') } scope :success, -> { where(status: 'success') }
scope :failed, -> { where(status: 'failed') } scope :failed, -> { where(status: 'failed') }
scope :canceled, -> { where(status: 'canceled') } scope :canceled, -> { where(status: 'canceled') }
scope :skipped, -> { where(status: 'skipped') } scope :skipped, -> { where(status: 'skipped') }
scope :manual, -> { where(status: 'manual') } scope :manual, -> { where(status: 'manual') }
scope :scheduled, -> { where(status: 'scheduled') } scope :scheduled, -> { where(status: 'scheduled') }
scope :alive, -> { where(status: [:created, :pending, :running]) } scope :alive, -> { where(status: [:created, :pending, :running]) }
scope :created_or_pending, -> { where(status: [:created, :pending]) } scope :created_or_pending, -> { where(status: [:created, :pending]) }
scope :running_or_pending, -> { where(status: [:running, :pending]) } scope :running_or_pending, -> { where(status: [:running, :pending]) }

View file

@ -15,7 +15,7 @@ class Email < ActiveRecord::Base
after_commit :update_invalid_gpg_signatures, if: -> { previous_changes.key?('confirmed_at') } after_commit :update_invalid_gpg_signatures, if: -> { previous_changes.key?('confirmed_at') }
devise :confirmable devise :confirmable
self.reconfirmable = false # currently email can't be changed, no need to reconfirm self.reconfirmable = false # currently email can't be changed, no need to reconfirm
delegate :username, to: :user delegate :username, to: :user

View file

@ -98,7 +98,7 @@ class Group < Namespace
def select_for_project_authorization def select_for_project_authorization
if current_scope.joins_values.include?(:shared_projects) if current_scope.joins_values.include?(:shared_projects)
joins('INNER JOIN namespaces project_namespace ON project_namespace.id = projects.namespace_id') joins('INNER JOIN namespaces project_namespace ON project_namespace.id = projects.namespace_id')
.where('project_namespace.share_with_group_lock = ?', false) .where('project_namespace.share_with_group_lock = ?', false)
.select("projects.id AS project_id, LEAST(project_group_links.group_access, members.access_level) AS access_level") .select("projects.id AS project_id, LEAST(project_group_links.group_access, members.access_level) AS access_level")
else else
super super

View file

@ -76,7 +76,7 @@ class Member < ActiveRecord::Base
scope :maintainers, -> { active.where(access_level: MAINTAINER) } scope :maintainers, -> { active.where(access_level: MAINTAINER) }
scope :masters, -> { maintainers } # @deprecated scope :masters, -> { maintainers } # @deprecated
scope :owners, -> { active.where(access_level: OWNER) } scope :owners, -> { active.where(access_level: OWNER) }
scope :owners_and_maintainers, -> { active.where(access_level: [OWNER, MAINTAINER]) } scope :owners_and_maintainers, -> { active.where(access_level: [OWNER, MAINTAINER]) }
scope :owners_and_masters, -> { owners_and_maintainers } # @deprecated scope :owners_and_masters, -> { owners_and_maintainers } # @deprecated
scope :order_name_asc, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.name', 'ASC')) } scope :order_name_asc, -> { left_join_users.reorder(Gitlab::Database.nulls_last_order('users.name', 'ASC')) }

View file

@ -28,7 +28,7 @@ class Milestone < ActiveRecord::Base
has_internal_id :iid, scope: :group, init: ->(s) { s&.group&.milestones&.maximum(:iid) } has_internal_id :iid, scope: :group, init: ->(s) { s&.group&.milestones&.maximum(:iid) }
has_many :issues has_many :issues
has_many :labels, -> { distinct.reorder('labels.title') }, through: :issues has_many :labels, -> { distinct.reorder('labels.title') }, through: :issues
has_many :merge_requests has_many :merge_requests
has_many :events, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :events, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent

View file

@ -59,7 +59,7 @@ class IrkerService < Service
' append "?key=secretpassword" to the URI (Note that due to a bug, if you ' \ ' append "?key=secretpassword" to the URI (Note that due to a bug, if you ' \
' want to use a password, you have to omit the "#" on the channel). If you ' \ ' want to use a password, you have to omit the "#" on the channel). If you ' \
' specify a default IRC URI to prepend before each recipient, you can just ' \ ' specify a default IRC URI to prepend before each recipient, you can just ' \
' give a channel name.' }, ' give a channel name.' },
{ type: 'checkbox', name: 'colorize_messages' } { type: 'checkbox', name: 'colorize_messages' }
] ]
end end

View file

@ -50,11 +50,11 @@ class Snippet < ActiveRecord::Base
validates :visibility_level, inclusion: { in: Gitlab::VisibilityLevel.values } validates :visibility_level, inclusion: { in: Gitlab::VisibilityLevel.values }
# Scopes # Scopes
scope :are_internal, -> { where(visibility_level: Snippet::INTERNAL) } scope :are_internal, -> { where(visibility_level: Snippet::INTERNAL) }
scope :are_private, -> { where(visibility_level: Snippet::PRIVATE) } scope :are_private, -> { where(visibility_level: Snippet::PRIVATE) }
scope :are_public, -> { where(visibility_level: Snippet::PUBLIC) } scope :are_public, -> { where(visibility_level: Snippet::PUBLIC) }
scope :public_and_internal, -> { where(visibility_level: [Snippet::PUBLIC, Snippet::INTERNAL]) } scope :public_and_internal, -> { where(visibility_level: [Snippet::PUBLIC, Snippet::INTERNAL]) }
scope :fresh, -> { order("created_at DESC") } scope :fresh, -> { order("created_at DESC") }
scope :inc_relations_for_view, -> { includes(author: :status) } scope :inc_relations_for_view, -> { includes(author: :status) }
participant :author participant :author

View file

@ -145,7 +145,7 @@ class User < ActiveRecord::Base
has_many :issue_assignees has_many :issue_assignees
has_many :assigned_issues, class_name: "Issue", through: :issue_assignees, source: :issue has_many :assigned_issues, class_name: "Issue", through: :issue_assignees, source: :issue
has_many :assigned_merge_requests, dependent: :nullify, foreign_key: :assignee_id, class_name: "MergeRequest" # rubocop:disable Cop/ActiveRecordDependent has_many :assigned_merge_requests, dependent: :nullify, foreign_key: :assignee_id, class_name: "MergeRequest" # rubocop:disable Cop/ActiveRecordDependent
has_many :custom_attributes, class_name: 'UserCustomAttribute' has_many :custom_attributes, class_name: 'UserCustomAttribute'
has_many :callouts, class_name: 'UserCallout' has_many :callouts, class_name: 'UserCallout'

View file

@ -59,7 +59,7 @@ class PipelineEntity < Grape::Entity
pipeline.present.failure_reason pipeline.present.failure_reason
end end
expose :retry_path, if: -> (*) { can_retry? } do |pipeline| expose :retry_path, if: -> (*) { can_retry? } do |pipeline|
retry_project_pipeline_path(pipeline.project, pipeline) retry_project_pipeline_path(pipeline.project, pipeline)
end end

View file

@ -50,7 +50,7 @@ module Boards
if move_between_ids if move_between_ids
attrs[:move_between_ids] = move_between_ids attrs[:move_between_ids] = move_between_ids
attrs[:board_group_id] = board.group&.id attrs[:board_group_id] = board.group&.id
end end
attrs attrs

View file

@ -20,7 +20,7 @@ module Boards
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def decrement_higher_lists(list) def decrement_higher_lists(list)
board.lists.movable.where('position > ?', list.position) board.lists.movable.where('position > ?', list.position)
.update_all('position = position - 1') .update_all('position = position - 1')
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord

View file

@ -49,7 +49,7 @@ module Labels
.new(current_user, title: new_label.title, group_id: project.group.id) .new(current_user, title: new_label.title, group_id: project.group.id)
.execute(skip_authorization: true) .execute(skip_authorization: true)
.where.not(id: new_label) .where.not(id: new_label)
.select(:id) # Can't use pluck() to avoid object-creation because of the batching .select(:id) # Can't use pluck() to avoid object-creation because of the batching
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord

View file

@ -104,7 +104,7 @@
- link_to_help = link_to(_("here"), help_page_path("user/permissions")) - link_to_help = link_to(_("here"), help_page_path("user/permissions"))
= _('Read more about project permissions <strong>%{link_to_help}</strong>').html_safe % { link_to_help: link_to_help } = _('Read more about project permissions <strong>%{link_to_help}</strong>').html_safe % { link_to_help: link_to_help }
= form_tag admin_group_members_update_path(@group), id: "new_project_member", class: "bulk_import", method: :put do = form_tag admin_group_members_update_path(@group), id: "new_project_member", class: "bulk_import", method: :put do
%div %div
= users_select_tag(:user_ids, multiple: true, email_user: true, skip_ldap: @group.ldap_synced?, scope: :all) = users_select_tag(:user_ids, multiple: true, email_user: true, skip_ldap: @group.ldap_synced?, scope: :all)
.prepend-top-10 .prepend-top-10

View file

@ -6,7 +6,7 @@
- tooltip = "#{subject.name} - #{status.status_tooltip}" - tooltip = "#{subject.name} - #{status.status_tooltip}"
- if status.has_details? - if status.has_details?
= link_to status.details_path, class: 'mini-pipeline-graph-dropdown-item', data: { toggle: 'tooltip', title: tooltip, container: 'body' } do = link_to status.details_path, class: 'mini-pipeline-graph-dropdown-item', data: { toggle: 'tooltip', title: tooltip, container: 'body' } do
%span{ class: klass }= sprite_icon(status.icon) %span{ class: klass }= sprite_icon(status.icon)
%span.ci-build-text= subject.name %span.ci-build-text= subject.name
@ -16,5 +16,5 @@
%span.ci-build-text= subject.name %span.ci-build-text= subject.name
- if status.has_action? - if status.has_action?
= link_to status.action_path, class: "ci-action-icon-container ci-action-icon-wrapper js-ci-action-icon", method: status.action_method, data: { toggle: 'tooltip', title: status.action_title, container: 'body' } do = link_to status.action_path, class: "ci-action-icon-container ci-action-icon-wrapper js-ci-action-icon", method: status.action_method, data: { toggle: 'tooltip', title: status.action_title, container: 'body' } do
= sprite_icon(status.action_icon, css_class: "icon-action-#{status.action_icon}") = sprite_icon(status.action_icon, css_class: "icon-action-#{status.action_icon}")

View file

@ -1,6 +1,6 @@
- @hide_top_links = true - @hide_top_links = true
- page_title "Groups" - page_title "Groups"
- header_title "Groups", dashboard_groups_path - header_title "Groups", dashboard_groups_path
= render_if_exists "shared/gold_trial_callout" = render_if_exists "shared/gold_trial_callout"
= render 'dashboard/groups_head' = render 'dashboard/groups_head'

View file

@ -7,7 +7,7 @@
= f.hidden_field :reset_password_token = f.hidden_field :reset_password_token
.form-group .form-group
= f.label 'New password', for: "user_password" = f.label 'New password', for: "user_password"
= f.password_field :password, class: "form-control top qa-password-field", required: true, title: 'This field is required' = f.password_field :password, class: "form-control top qa-password-field", required: true, title: 'This field is required'
.form-group .form-group
= f.label 'Confirm new password', for: "user_password_confirmation" = f.label 'Confirm new password', for: "user_password_confirmation"
= f.password_field :password_confirmation, class: "form-control bottom qa-password-confirmation", title: 'This field is required', required: true = f.password_field :password_confirmation, class: "form-control bottom qa-password-confirmation", title: 'This field is required', required: true

View file

@ -7,7 +7,7 @@
- resource_params = params[resource_name].presence || params - resource_params = params[resource_name].presence || params
= f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0) = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0)
%div %div
= f.label 'Two-Factor Authentication code', name: :otp_attempt = 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.' = f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.'
%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. %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 .prepend-top-20

View file

@ -31,7 +31,7 @@
%strong= t scope, scope: [:doorkeeper, :scopes] %strong= t scope, scope: [:doorkeeper, :scopes]
.text-secondary= t scope, scope: [:doorkeeper, :scope_desc] .text-secondary= t scope, scope: [:doorkeeper, :scope_desc]
.form-actions.text-right .form-actions.text-right
= form_tag oauth_authorization_path, method: :delete, class: 'inline' do = form_tag oauth_authorization_path, method: :delete, class: 'inline' do
= hidden_field_tag :client_id, @pre_auth.client.uid = hidden_field_tag :client_id, @pre_auth.client.uid
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
= hidden_field_tag :state, @pre_auth.state = hidden_field_tag :state, @pre_auth.state

View file

@ -21,6 +21,6 @@
= link_to note.attachment.url, target: '_blank' do = link_to note.attachment.url, target: '_blank' do
= image_tag note.attachment.url, class: 'note-image-attach' = image_tag note.attachment.url, class: 'note-image-attach'
- else - else
= link_to note.attachment.url, target: '_blank', class: 'note-file-attach' do = link_to note.attachment.url, target: '_blank', class: 'note-file-attach' do
%i.fa.fa-paperclip %i.fa.fa-paperclip
= note.attachment_identifier = note.attachment_identifier

View file

@ -23,7 +23,7 @@
Members with access to Members with access to
%strong= @group.name %strong= @group.name
%span.badge= @members.total_count %span.badge= @members.total_count
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do = form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form flex-project-members-form' do
.form-group .form-group
.position-relative.append-right-8 .position-relative.append-right-8
= search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false }

View file

@ -7,7 +7,7 @@
= render 'shared/issuable/nav', type: :merge_requests = render 'shared/issuable/nav', type: :merge_requests
- if current_user - if current_user
.nav-controls .nav-controls
= render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", type: :merge_requests, with_feature_enabled: 'merge_requests', with_shared: false, include_projects_in_subgroups: true = render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", type: :merge_requests, with_feature_enabled: 'merge_requests', with_shared: false, include_projects_in_subgroups: true
= render 'shared/issuable/search_bar', type: :merge_requests = render 'shared/issuable/search_bar', type: :merge_requests

View file

@ -1,4 +1,4 @@
= form_for [@group, @milestone], html: { class: 'milestone-form common-note-form js-quick-submit js-requires-input' } do |f| = form_for [@group, @milestone], html: { class: 'milestone-form common-note-form js-quick-submit js-requires-input' } do |f|
.row .row
= form_errors(@milestone) = form_errors(@milestone)
@ -24,4 +24,3 @@
- else - else
= f.submit 'Update milestone', class: "btn-success btn" = f.submit 'Update milestone', class: "btn-success btn"
= link_to "Cancel", group_milestone_path(@group, @milestone), class: "btn btn-cancel" = link_to "Cancel", group_milestone_path(@group, @milestone), class: "btn btn-cancel"

View file

@ -11,20 +11,20 @@
%meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' } %meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' }
-# Open Graph - http://ogp.me/ -# Open Graph - http://ogp.me/
%meta{ property: 'og:type', content: "object" } %meta{ property: 'og:type', content: "object" }
%meta{ property: 'og:site_name', content: site_name } %meta{ property: 'og:site_name', content: site_name }
%meta{ property: 'og:title', content: page_title } %meta{ property: 'og:title', content: page_title }
%meta{ property: 'og:description', content: page_description } %meta{ property: 'og:description', content: page_description }
%meta{ property: 'og:image', content: page_image } %meta{ property: 'og:image', content: page_image }
%meta{ property: 'og:image:width', content: '64' } %meta{ property: 'og:image:width', content: '64' }
%meta{ property: 'og:image:height', content: '64' } %meta{ property: 'og:image:height', content: '64' }
%meta{ property: 'og:url', content: request.base_url + request.fullpath } %meta{ property: 'og:url', content: request.base_url + request.fullpath }
-# Twitter Card - https://dev.twitter.com/cards/types/summary -# Twitter Card - https://dev.twitter.com/cards/types/summary
%meta{ property: 'twitter:card', content: "summary" } %meta{ property: 'twitter:card', content: "summary" }
%meta{ property: 'twitter:title', content: page_title } %meta{ property: 'twitter:title', content: page_title }
%meta{ property: 'twitter:description', content: page_description } %meta{ property: 'twitter:description', content: page_description }
%meta{ property: 'twitter:image', content: page_image } %meta{ property: 'twitter:image', content: page_image }
= page_card_meta_tags = page_card_meta_tags
%title= page_title(site_name) %title= page_title(site_name)
@ -33,8 +33,8 @@
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png' = favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
= stylesheet_link_tag "application", media: "all" = stylesheet_link_tag "application", media: "all"
= stylesheet_link_tag "print", media: "print" = stylesheet_link_tag "print", media: "print"
= stylesheet_link_tag "test", media: "all" if Rails.env.test? = stylesheet_link_tag "test", media: "all" if Rails.env.test?
= stylesheet_link_tag 'performance_bar' if performance_bar_enabled? = stylesheet_link_tag 'performance_bar' if performance_bar_enabled?
= stylesheet_link_tag 'csslab' if Feature.enabled?(:csslab) = stylesheet_link_tag 'csslab' if Feature.enabled?(:csslab)
@ -61,10 +61,10 @@
%meta{ name: 'theme-color', content: '#474D57' } %meta{ name: 'theme-color', content: '#474D57' }
-# Apple Safari/iOS home screen icons -# Apple Safari/iOS home screen icons
= favicon_link_tag 'touch-icon-iphone.png', rel: 'apple-touch-icon' = favicon_link_tag 'touch-icon-iphone.png', rel: 'apple-touch-icon'
= favicon_link_tag 'touch-icon-ipad.png', rel: 'apple-touch-icon', sizes: '76x76' = favicon_link_tag 'touch-icon-ipad.png', rel: 'apple-touch-icon', sizes: '76x76'
= favicon_link_tag 'touch-icon-iphone-retina.png', rel: 'apple-touch-icon', sizes: '120x120' = favicon_link_tag 'touch-icon-iphone-retina.png', rel: 'apple-touch-icon', sizes: '120x120'
= favicon_link_tag 'touch-icon-ipad-retina.png', rel: 'apple-touch-icon', sizes: '152x152' = favicon_link_tag 'touch-icon-ipad-retina.png', rel: 'apple-touch-icon', sizes: '152x152'
%link{ rel: 'mask-icon', href: image_path('logo.svg'), color: 'rgb(226, 67, 41)' } %link{ rel: 'mask-icon', href: image_path('logo.svg'), color: 'rgb(226, 67, 41)' }
-# Windows 8 pinned site tile -# Windows 8 pinned site tile

View file

@ -1,7 +1,7 @@
- page_title @group.name - page_title @group.name
- page_description @group.description unless page_description - page_description @group.description unless page_description
- header_title group_title(@group) unless header_title - header_title group_title(@group) unless header_title
- nav "group" - nav "group"
- @left_sidebar = true - @left_sidebar = true
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do

View file

@ -1,4 +1,4 @@
%li.header-new.dropdown{ data: { track_label: "new_dropdown", track_event: "click_dropdown" } } %li.header-new.dropdown{ data: { track_label: "new_dropdown", track_event: "click_dropdown" } }
= link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip qa-new-menu-toggle", title: _("New..."), ref: 'tooltip', aria: { label: _("New...") }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static' } do = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip qa-new-menu-toggle", title: _("New..."), ref: 'tooltip', aria: { label: _("New...") }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static' } do
= sprite_icon('plus-square', size: 16) = sprite_icon('plus-square', size: 16)
= sprite_icon('angle-down', css_class: 'caret-down') = sprite_icon('angle-down', css_class: 'caret-down')

View file

@ -10,7 +10,7 @@
= render "layouts/nav/projects_dropdown/show" = render "layouts/nav/projects_dropdown/show"
- if dashboard_nav_link?(:groups) - if dashboard_nav_link?(:groups)
= nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "home dropdown header-groups qa-groups-dropdown", data: { track_label: "groups_dropdown", track_event: "click_dropdown" } }) do = nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "home dropdown header-groups qa-groups-dropdown", data: { track_label: "groups_dropdown", track_event: "click_dropdown" } }) do
%button{ type: 'button', data: { toggle: "dropdown" } } %button{ type: 'button', data: { toggle: "dropdown" } }
= _('Groups') = _('Groups')
= sprite_icon('angle-down', css_class: 'caret-down') = sprite_icon('angle-down', css_class: 'caret-down')

View file

@ -170,7 +170,7 @@
= _('CI / CD') = _('CI / CD')
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :artifacts], html_options: { class: "fly-out-top-item" } ) do = nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :artifacts], html_options: { class: "fly-out-top-item" }) do
= link_to project_pipelines_path(@project) do = link_to project_pipelines_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('CI / CD') = _('CI / CD')

View file

@ -1,4 +1,4 @@
- header_title _("Snippets"), snippets_path - header_title _("Snippets"), snippets_path
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
- if @snippet && current_user - if @snippet && current_user

View file

@ -33,9 +33,9 @@
%p %p
Once the exported file is ready, you will receive a notification email with a download link, or you can download it from this page. Once the exported file is ready, you will receive a notification email with a download link, or you can download it from this page.
- if project.export_status == :finished - if project.export_status == :finished
= link_to 'Download export', download_export_project_path(project), = link_to 'Download export', download_export_project_path(project),
rel: 'nofollow', download: '', method: :get, class: "btn btn-default" rel: 'nofollow', download: '', method: :get, class: "btn btn-default"
= link_to 'Generate new export', generate_new_export_project_path(project), = link_to 'Generate new export', generate_new_export_project_path(project),
method: :post, class: "btn btn-default" method: :post, class: "btn btn-default"
- else - else
= link_to 'Export project', export_project_path(project), = link_to 'Export project', export_project_path(project),

View file

@ -23,7 +23,7 @@
= sprite_icon('tag', size: 16, css_class: 'icon append-right-4') = sprite_icon('tag', size: 16, css_class: 'icon append-right-4')
= @project.topics_to_show = @project.topics_to_show
- if @project.has_extra_topics? - if @project.has_extra_topics?
= _("+ %{count} more") % { count: @project.count_of_extra_topics_not_shown } = _("+ %{count} more") % { count: @project.count_of_extra_topics_not_shown }
.project-repo-buttons.col-md-12.col-lg-6.d-inline-flex.flex-wrap.justify-content-lg-end .project-repo-buttons.col-md-12.col-lg-6.d-inline-flex.flex-wrap.justify-content-lg-end

View file

@ -21,7 +21,7 @@
= clipboard_button(target: '#issuable_email', class: 'btn btn-clipboard input-group-text btn-transparent d-none d-sm-block') = clipboard_button(target: '#issuable_email', class: 'btn btn-clipboard input-group-text btn-transparent d-none d-sm-block')
- if issuable_type == 'issue' - if issuable_type == 'issue'
- enter_title_text = _('Enter the issue title') - enter_title_text = _('Enter the issue title')
- enter_description_text = _('Enter the issue description') - enter_description_text = _('Enter the issue description')
- else - else
- enter_title_text = _('Enter the merge request title') - enter_title_text = _('Enter the merge request title')

View file

@ -43,7 +43,7 @@
= f.label :description, class: 'label-bold' do = f.label :description, class: 'label-bold' do
Project description Project description
%span (optional) %span (optional)
= f.text_area :description, placeholder: 'Description format', class: "form-control", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_description", track_value: "" } = f.text_area :description, placeholder: 'Description format', class: "form-control", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_description", track_value: "" }
= f.label :visibility_level, class: 'label-bold' do = f.label :visibility_level, class: 'label-bold' do
Visibility Level Visibility Level

View file

@ -35,8 +35,8 @@
- elsif can_collaborate_with_project?(@project) - elsif can_collaborate_with_project?(@project)
%li= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master') %li= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master')
- elsif create_mr_from_new_fork - elsif create_mr_from_new_fork
- continue_params = { to: project_new_blob_path(@project, @project.default_branch || 'master'), - continue_params = { to: project_new_blob_path(@project, @project.default_branch || 'master'),
notice: edit_in_new_fork_notice, notice: edit_in_new_fork_notice,
notice_now: edit_in_new_fork_notice_now } notice_now: edit_in_new_fork_notice_now }
- fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params) - fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params)
%li= link_to _('New file'), fork_path, method: :post %li= link_to _('New file'), fork_path, method: :post

View file

@ -49,7 +49,7 @@
#{ _('Download') } #{ _('Download') }
- unless @commit.parents.length > 1 - unless @commit.parents.length > 1
%li= link_to s_("DownloadCommit|Email Patches"), project_commit_path(@project, @commit, format: :patch), class: "qa-email-patches" %li= link_to s_("DownloadCommit|Email Patches"), project_commit_path(@project, @commit, format: :patch), class: "qa-email-patches"
%li= link_to s_("DownloadCommit|Plain Diff"), project_commit_path(@project, @commit, format: :diff), class: "qa-plain-diff" %li= link_to s_("DownloadCommit|Plain Diff"), project_commit_path(@project, @commit, format: :diff), class: "qa-plain-diff"
.commit-box{ data: { project_path: project_path(@project) } } .commit-box{ data: { project_path: project_path(@project) } }
%h3.commit-title %h3.commit-title

View file

@ -19,7 +19,7 @@
= render partial: 'projects/issues/merge_requests_status', locals: { merge_request: merge_request, css_class: 'd-none d-xl-block append-right-8' } = render partial: 'projects/issues/merge_requests_status', locals: { merge_request: merge_request, css_class: 'd-none d-xl-block append-right-8' }
= link_to merge_request.title, merge_request_path(merge_request), { class: 'mr-title-link'} = link_to merge_request.title, merge_request_path(merge_request), { class: 'mr-title-link'}
.item-meta .item-meta
= render partial: 'projects/issues/merge_requests_status', locals: { merge_request: merge_request, css_class: 'd-xl-none d-lg-block append-right-5' } = render partial: 'projects/issues/merge_requests_status', locals: { merge_request: merge_request, css_class: 'd-xl-none d-lg-block append-right-5' }
%span.d-flex.align-items-center.append-right-8.mr-item-path.item-path-id.mt-0 %span.d-flex.align-items-center.append-right-8.mr-item-path.item-path-id.mt-0
%span.path-id-text.bold.text-truncate{ data: { toggle: 'tooltip'}, title: merge_request.target_project.full_path } %span.path-id-text.bold.text-truncate{ data: { toggle: 'tooltip'}, title: merge_request.target_project.full_path }
= merge_request.target_project.full_path = merge_request.target_project.full_path

View file

@ -18,5 +18,5 @@
- mr_status_tooltip = "<div><span class=\"bold\">#{mr_status_title}</span> #{time_ago_in_words(mr_status_date)} ago</div><span class=\"text-tertiary\">#{l(mr_status_date.to_time, format: time_format)}</span>" - mr_status_tooltip = "<div><span class=\"bold\">#{mr_status_title}</span> #{time_ago_in_words(mr_status_date)} ago</div><span class=\"text-tertiary\">#{l(mr_status_date.to_time, format: time_format)}</span>"
%span.mr-status-wrapper.suggestion-help-hover{ class: css_class, data: { toggle: 'tooltip', placement: 'bottom', html: 'true', title: mr_status_tooltip } } %span.mr-status-wrapper.suggestion-help-hover{ class: css_class, data: { toggle: 'tooltip', placement: 'bottom', html: 'true', title: mr_status_tooltip } }
= sprite_icon(mr_status_icon, size: 16, css_class: "merge-request-status #{mr_status_class}") = sprite_icon(mr_status_icon, size: 16, css_class: "merge-request-status #{mr_status_class}")

View file

@ -30,7 +30,7 @@
= icon('check', class: 'icon') = icon('check', class: 'icon')
= _('Create merge request and branch') = _('Create merge request and branch')
%li{ class: [!can_create_merge_request && 'droplab-item-selected'], role: 'button', data: { value: 'create-branch', text: _('Create branch') } } %li{ class: [!can_create_merge_request && 'droplab-item-selected'], role: 'button', data: { value: 'create-branch', text: _('Create branch') } }
.menu-item .menu-item
= icon('check', class: 'icon') = icon('check', class: 'icon')
= _('Create branch') = _('Create branch')

View file

@ -1,6 +1,6 @@
= form_for [@project.namespace.becomes(Namespace), @project, @milestone], = form_for [@project.namespace.becomes(Namespace), @project, @milestone],
html: {class: 'milestone-form common-note-form js-quick-submit js-requires-input'}, html: { class: 'milestone-form common-note-form js-quick-submit js-requires-input' },
data: { markdown_version: @milestone.cached_markdown_version } do |f| data: { markdown_version: @milestone.cached_markdown_version } do |f|
= form_errors(@milestone) = form_errors(@milestone)
.row .row
.col-md-6 .col-md-6

View file

@ -34,7 +34,7 @@
= n_('Reveal value', 'Reveal values', @schedule.variables.size) = n_('Reveal value', 'Reveal values', @schedule.variables.size)
.form-group.row .form-group.row
.col-md-9 .col-md-9
= f.label :active, s_('PipelineSchedules|Activated'), class: 'label-bold' = f.label :active, s_('PipelineSchedules|Activated'), class: 'label-bold'
%div %div
= f.check_box :active, required: false, value: @schedule.active? = f.check_box :active, required: false, value: @schedule.active?
= _('Active') = _('Active')

View file

@ -6,7 +6,7 @@
%span.flex-project-title %span.flex-project-title
= _("Members of <strong>%{project_name}</strong>").html_safe % { project_name: sanitize_project_name(project.name) } = _("Members of <strong>%{project_name}</strong>").html_safe % { project_name: sanitize_project_name(project.name) }
%span.badge.badge-pill= members.total_count %span.badge.badge-pill= members.total_count
= form_tag project_project_members_path(project), method: :get, class: 'form-inline member-search-form flex-project-members-form' do = form_tag project_project_members_path(project), method: :get, class: 'form-inline member-search-form flex-project-members-form' do
.form-group .form-group
.position-relative .position-relative
= search_field_tag :search, params[:search], { placeholder: _('Find existing members by name'), class: 'form-control', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: _('Find existing members by name'), class: 'form-control', spellcheck: false }

View file

@ -12,6 +12,6 @@
%a.btn.btn-default.append-right-10{ href: template.preview, rel: 'noopener noreferrer', target: '_blank', data: { track_label: "create_from_template", track_property: "template_preview", track_event: "click_button", track_value: template.name } } %a.btn.btn-default.append-right-10{ href: template.preview, rel: 'noopener noreferrer', target: '_blank', data: { track_label: "create_from_template", track_property: "template_preview", track_event: "click_button", track_value: template.name } }
= _("Preview") = _("Preview")
%label.btn.btn-success.template-button.choose-template.append-bottom-0{ for: template.name } %label.btn.btn-success.template-button.choose-template.append-bottom-0{ for: template.name }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "create_from_template", track_property: "template_use", track_event: "click_button" } } %input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "create_from_template", track_property: "template_use", track_event: "click_button" } }
%span %span
= _("Use template") = _("Use template")

View file

@ -5,7 +5,7 @@
- status_path = project_serverless_functions_path(@project, format: :json) - status_path = project_serverless_functions_path(@project, format: :json)
- clusters_path = project_clusters_path(@project) - clusters_path = project_clusters_path(@project)
.serverless-functions-page.js-serverless-functions-page{ data: { status_path: status_path, installed: @installed, clusters_path: clusters_path, help_path: help_page_path('user/project/clusters/serverless/index') } } .serverless-functions-page.js-serverless-functions-page{ data: { status_path: status_path, installed: @installed, clusters_path: clusters_path, help_path: help_page_path('user/project/clusters/serverless/index') } }
%div{ class: [container_class, ('limit-container-width' unless fluid_layout)] } %div{ class: [container_class, ('limit-container-width' unless fluid_layout)] }
.js-serverless-functions-notice .js-serverless-functions-notice

View file

@ -40,27 +40,24 @@
#{ _('New directory') } #{ _('New directory') }
- elsif can?(current_user, :fork_project, @project) && can?(current_user, :create_merge_request_in, @project) - elsif can?(current_user, :fork_project, @project) && can?(current_user, :create_merge_request_in, @project)
%li %li
- continue_params = { to: project_new_blob_path(@project, @id), - continue_params = { to: project_new_blob_path(@project, @id),
notice: edit_in_new_fork_notice, notice: edit_in_new_fork_notice,
notice_now: edit_in_new_fork_notice_now } notice_now: edit_in_new_fork_notice_now }
- fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, - fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params)
continue: continue_params)
= link_to fork_path, method: :post do = link_to fork_path, method: :post do
#{ _('New file') } #{ _('New file') }
%li %li
- continue_params = { to: request.fullpath, - continue_params = { to: request.fullpath,
notice: edit_in_new_fork_notice + " Try to upload a file again.", notice: edit_in_new_fork_notice + " Try to upload a file again.",
notice_now: edit_in_new_fork_notice_now } notice_now: edit_in_new_fork_notice_now }
- fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, - fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params)
continue: continue_params)
= link_to fork_path, method: :post do = link_to fork_path, method: :post do
#{ _('Upload file') } #{ _('Upload file') }
%li %li
- continue_params = { to: request.fullpath, - continue_params = { to: request.fullpath,
notice: edit_in_new_fork_notice + " Try to create a new directory again.", notice: edit_in_new_fork_notice + " Try to create a new directory again.",
notice_now: edit_in_new_fork_notice_now } notice_now: edit_in_new_fork_notice_now }
- fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, - fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params)
continue: continue_params)
= link_to fork_path, method: :post do = link_to fork_path, method: :post do
#{ _('New directory') } #{ _('New directory') }

View file

@ -1,4 +1,4 @@
%board-sidebar{ "inline-template" => true, ":current-user" => (UserSerializer.new.represent(current_user) || {}).to_json } %board-sidebar{ "inline-template" => true, ":current-user" => (UserSerializer.new.represent(current_user) || {}).to_json }
%transition{ name: "boards-sidebar-slide" } %transition{ name: "boards-sidebar-slide" }
%aside.right-sidebar.right-sidebar-expanded.issue-boards-sidebar{ "v-show" => "showSidebar" } %aside.right-sidebar.right-sidebar-expanded.issue-boards-sidebar{ "v-show" => "showSidebar" }
.issuable-sidebar .issuable-sidebar

View file

@ -2,7 +2,7 @@
%aside.issues-bulk-update.js-right-sidebar.right-sidebar{ "aria-live" => "polite", data: { 'signed-in': current_user.present? } } %aside.issues-bulk-update.js-right-sidebar.right-sidebar{ "aria-live" => "polite", data: { 'signed-in': current_user.present? } }
.issuable-sidebar.hidden .issuable-sidebar.hidden
= form_tag [:bulk_update, @project.namespace.becomes(Namespace), @project, type], method: :post, class: "bulk-update" do = form_tag [:bulk_update, @project.namespace.becomes(Namespace), @project, type], method: :post, class: "bulk-update" do
.block.issuable-sidebar-header .block.issuable-sidebar-header
.filter-item.inline.update-issues-btn.float-left .filter-item.inline.update-issues-btn.float-left
= button_tag "Update all", class: "btn update-selected-issues btn-info", disabled: true = button_tag "Update all", class: "btn update-selected-issues btn-info", disabled: true
@ -50,4 +50,3 @@
= hidden_field_tag "update[issuable_ids]", [] = hidden_field_tag "update[issuable_ids]", []
= hidden_field_tag :state_event, params[:state_event] = hidden_field_tag :state_event, params[:state_event]

View file

@ -17,7 +17,7 @@ class NamespacelessProjectDestroyWorker
return return
end end
return if project.namespace # Reject doing anything for projects that *do* have a namespace return if project.namespace # Reject doing anything for projects that *do* have a namespace
project.team.truncate project.team.truncate

View file

@ -19,7 +19,7 @@ if defined?(Unicorn)
Unicorn::StreamInput.send(:public, :eof?) # rubocop:disable GitlabSecurity/PublicSend Unicorn::StreamInput.send(:public, :eof?) # rubocop:disable GitlabSecurity/PublicSend
end end
require ::File.expand_path('../config/environment', __FILE__) require ::File.expand_path('../config/environment', __FILE__)
warmup do |app| warmup do |app|
client = Rack::MockRequest.new(app) client = Rack::MockRequest.new(app)

View file

@ -178,7 +178,7 @@ Devise.setup do |config|
# Configure the default scope given to Warden. By default it's the first # Configure the default scope given to Warden. By default it's the first
# devise role declared in your routes (usually :user). # devise role declared in your routes (usually :user).
config.default_scope = :user # now have an :email scope as well, so set the default config.default_scope = :user # now have an :email scope as well, so set the default
# Configure sign_out behavior. # Configure sign_out behavior.
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope). # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).

View file

@ -31,7 +31,7 @@ Doorkeeper::OpenidConnect.configure do
o.claim(:name) { |user| user.name } o.claim(:name) { |user| user.name }
o.claim(:nickname) { |user| user.username } o.claim(:nickname) { |user| user.username }
o.claim(:email) { |user| user.public_email } o.claim(:email) { |user| user.public_email }
o.claim(:email_verified) { |user| true if user.public_email? } o.claim(:email_verified) { |user| true if user.public_email? }
o.claim(:website) { |user| user.full_website_url if user.website_url? } o.claim(:website) { |user| user.full_website_url if user.website_url? }
o.claim(:profile) { |user| Gitlab::Routing.url_helpers.user_url user } o.claim(:profile) { |user| Gitlab::Routing.url_helpers.user_url user }

View file

@ -108,7 +108,7 @@ module ActiveRecord
when String when String
with_value with_value
when Hash when Hash
with_value.map do |name, expression| with_value.map do |name, expression|
case expression case expression
when String when String
select = Arel::Nodes::SqlLiteral.new "(#{expression})" select = Arel::Nodes::SqlLiteral.new "(#{expression})"

View file

@ -62,7 +62,7 @@ scope format: false do
resources :protected_tags, only: [:index, :show, :create, :update, :destroy] resources :protected_tags, only: [:index, :show, :create, :update, :destroy]
end end
scope constraints: { id: /.+/ } do scope constraints: { id: /.+/ } do
scope controller: :blob do scope controller: :blob do
get '/new/*id', action: :new, as: :new_blob get '/new/*id', action: :new, as: :new_blob
post '/create/*id', action: :create, as: :create_blob post '/create/*id', action: :create, as: :create_blob

View file

@ -28,7 +28,7 @@ class AddCiBuildsIndexForJobscontroller < ActiveRecord::Migration[4.2]
disable_ddl_transaction! disable_ddl_transaction!
def up def up
add_concurrent_index :ci_builds, [:project_id, :id] unless index_exists? :ci_builds, [:project_id, :id] add_concurrent_index :ci_builds, [:project_id, :id] unless index_exists? :ci_builds, [:project_id, :id]
remove_concurrent_index :ci_builds, :project_id if index_exists? :ci_builds, :project_id remove_concurrent_index :ci_builds, :project_id if index_exists? :ci_builds, :project_id
end end

View file

@ -48,7 +48,7 @@ class UpdateUploadPathsToSystem < ActiveRecord::Migration[4.2]
end end
def new_upload_dir def new_upload_dir
File.join(base_directory, "-", "system") File.join(base_directory, "-", "system")
end end
def arel_table def arel_table

View file

@ -33,7 +33,7 @@ module API
success Entities::Deployment success Entities::Deployment
end end
params do params do
requires :deployment_id, type: Integer, desc: 'The deployment ID' requires :deployment_id, type: Integer, desc: 'The deployment ID'
end end
get ':id/deployments/:deployment_id' do get ':id/deployments/:deployment_id' do
authorize! :read_deployment, user_project authorize! :read_deployment, user_project

View file

@ -190,7 +190,7 @@ module API
expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes expose :custom_attributes, using: 'API::Entities::CustomAttribute', if: :with_custom_attributes
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def self.preload_relation(projects_relation, options = {}) def self.preload_relation(projects_relation, options = {})
# Preloading tags, should be done with using only `:tags`, # Preloading tags, should be done with using only `:tags`,
# as `:tags` are defined as: `has_many :tags, through: :taggings` # as `:tags` are defined as: `has_many :tags, through: :taggings`
# N+1 is solved then by using `subject.tags.map(&:name)` # N+1 is solved then by using `subject.tags.map(&:name)`
@ -274,7 +274,7 @@ module API
expose :statistics, using: 'API::Entities::ProjectStatistics', if: :statistics expose :statistics, using: 'API::Entities::ProjectStatistics', if: :statistics
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def self.preload_relation(projects_relation, options = {}) def self.preload_relation(projects_relation, options = {})
# Preloading tags, should be done with using only `:tags`, # Preloading tags, should be done with using only `:tags`,
# as `:tags` are defined as: `has_many :tags, through: :taggings` # as `:tags` are defined as: `has_many :tags, through: :taggings`
# N+1 is solved then by using `subject.tags.map(&:name)` # N+1 is solved then by using `subject.tags.map(&:name)`

View file

@ -74,7 +74,7 @@ module API
success Entities::Environment success Entities::Environment
end end
params do params do
requires :environment_id, type: Integer, desc: 'The environment ID' requires :environment_id, type: Integer, desc: 'The environment ID'
end end
delete ':id/environments/:environment_id' do delete ':id/environments/:environment_id' do
authorize! :update_environment, user_project authorize! :update_environment, user_project
@ -88,7 +88,7 @@ module API
success Entities::Environment success Entities::Environment
end end
params do params do
requires :environment_id, type: Integer, desc: 'The environment ID' requires :environment_id, type: Integer, desc: 'The environment ID'
end end
post ':id/environments/:environment_id/stop' do post ':id/environments/:environment_id/stop' do
authorize! :read_environment, user_project authorize! :read_environment, user_project

View file

@ -146,7 +146,7 @@ module API
end end
def add_default_pagination_headers def add_default_pagination_headers
header 'X-Per-Page', per_page.to_s header 'X-Per-Page', per_page.to_s
end end
def add_navigation_links(next_page_params) def add_navigation_links(next_page_params)

View file

@ -294,7 +294,7 @@ module API
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
desc 'List merge requests that are related to the issue' do desc 'List merge requests that are related to the issue' do
success Entities::MergeRequestBasic success Entities::MergeRequestBasic
end end
params do params do
@ -318,7 +318,7 @@ module API
present paginate(merge_requests), with: Entities::MergeRequestBasic, current_user: current_user, project: user_project present paginate(merge_requests), with: Entities::MergeRequestBasic, current_user: current_user, project: user_project
end end
desc 'List merge requests closing issue' do desc 'List merge requests closing issue' do
success Entities::MergeRequestBasic success Entities::MergeRequestBasic
end end
params do params do
@ -335,7 +335,7 @@ module API
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
desc 'List participants for an issue' do desc 'List participants for an issue' do
success Entities::UserBasic success Entities::UserBasic
end end
params do params do

View file

@ -52,7 +52,7 @@ module API
success Entities::Job success Entities::Job
end end
params do params do
requires :pipeline_id, type: Integer, desc: 'The pipeline ID' requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
use :optional_scope use :optional_scope
use :pagination use :pagination
end end

View file

@ -69,7 +69,7 @@ module API
success Entities::Label success Entities::Label
end end
params do params do
requires :name, type: String, desc: 'The name of the label to be updated' requires :name, type: String, desc: 'The name of the label to be updated'
optional :new_name, type: String, desc: 'The new name of the label' optional :new_name, type: String, desc: 'The new name of the label'
optional :color, type: String, desc: "The new color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names" optional :color, type: String, desc: "The new color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names"
optional :description, type: String, desc: 'The new description of label' optional :description, type: String, desc: 'The new description of label'

View file

@ -32,7 +32,7 @@ module API
success Entities::PipelineScheduleDetails success Entities::PipelineScheduleDetails
end end
params do params do
requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id'
end end
get ':id/pipeline_schedules/:pipeline_schedule_id' do get ':id/pipeline_schedules/:pipeline_schedule_id' do
present pipeline_schedule, with: Entities::PipelineScheduleDetails present pipeline_schedule, with: Entities::PipelineScheduleDetails
@ -87,7 +87,7 @@ module API
success Entities::PipelineScheduleDetails success Entities::PipelineScheduleDetails
end end
params do params do
requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id'
end end
post ':id/pipeline_schedules/:pipeline_schedule_id/take_ownership' do post ':id/pipeline_schedules/:pipeline_schedule_id/take_ownership' do
authorize! :update_pipeline_schedule, pipeline_schedule authorize! :update_pipeline_schedule, pipeline_schedule
@ -103,7 +103,7 @@ module API
success Entities::PipelineScheduleDetails success Entities::PipelineScheduleDetails
end end
params do params do
requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id'
end end
delete ':id/pipeline_schedules/:pipeline_schedule_id' do delete ':id/pipeline_schedules/:pipeline_schedule_id' do
authorize! :admin_pipeline_schedule, pipeline_schedule authorize! :admin_pipeline_schedule, pipeline_schedule

View file

@ -42,7 +42,7 @@ module API
success Entities::Pipeline success Entities::Pipeline
end end
params do params do
requires :ref, type: String, desc: 'Reference' requires :ref, type: String, desc: 'Reference'
optional :variables, Array, desc: 'Array of variables available in the pipeline' optional :variables, Array, desc: 'Array of variables available in the pipeline'
end end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
@ -101,7 +101,7 @@ module API
success Entities::Pipeline success Entities::Pipeline
end end
params do params do
requires :pipeline_id, type: Integer, desc: 'The pipeline ID' requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
end end
post ':id/pipelines/:pipeline_id/retry' do post ':id/pipelines/:pipeline_id/retry' do
authorize! :update_pipeline, user_project authorize! :update_pipeline, user_project
@ -116,7 +116,7 @@ module API
success Entities::Pipeline success Entities::Pipeline
end end
params do params do
requires :pipeline_id, type: Integer, desc: 'The pipeline ID' requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
end end
post ':id/pipelines/:pipeline_id/cancel' do post ':id/pipelines/:pipeline_id/cancel' do
authorize! :update_pipeline, user_project authorize! :update_pipeline, user_project

View file

@ -11,7 +11,7 @@ module API
projects_relation projects_relation
end end
def preload_relation(projects_relation, options = {}) def preload_relation(projects_relation, options = {})
projects_relation projects_relation
end end

View file

@ -97,7 +97,7 @@ module API
success Entities::Release success Entities::Release
end end
params do params do
requires :tag_name, type: String, desc: 'The name of the tag', as: :tag requires :tag_name, type: String, desc: 'The name of the tag', as: :tag
end end
delete ':id/releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do delete ':id/releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do
authorize_destroy_release! authorize_destroy_release!

View file

@ -763,7 +763,7 @@ module API
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
before { authenticate! } before { authenticate! }
before { authorize_admin_project } before { authorize_admin_project }
@ -842,7 +842,7 @@ module API
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc "Trigger a slash command for #{service_slug}" do desc "Trigger a slash command for #{service_slug}" do
detail 'Added in GitLab 8.13' detail 'Added in GitLab 8.13'
end end

View file

@ -14,7 +14,7 @@ module API
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
ISSUABLE_TYPES.each do |type, finder| ISSUABLE_TYPES.each do |type, finder|
type_id_str = "#{type.singularize}_iid".to_sym type_id_str = "#{type.singularize}_iid".to_sym

View file

@ -7,7 +7,7 @@ module API
params do params do
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc 'Trigger a GitLab project pipeline' do desc 'Trigger a GitLab project pipeline' do
success Entities::Pipeline success Entities::Pipeline
end end
@ -59,7 +59,7 @@ module API
success Entities::Trigger success Entities::Trigger
end end
params do params do
requires :trigger_id, type: Integer, desc: 'The trigger ID' requires :trigger_id, type: Integer, desc: 'The trigger ID'
end end
get ':id/triggers/:trigger_id' do get ':id/triggers/:trigger_id' do
authenticate! authenticate!
@ -75,7 +75,7 @@ module API
success Entities::Trigger success Entities::Trigger
end end
params do params do
requires :description, type: String, desc: 'The trigger description' requires :description, type: String, desc: 'The trigger description'
end end
post ':id/triggers' do post ':id/triggers' do
authenticate! authenticate!
@ -116,7 +116,7 @@ module API
success Entities::Trigger success Entities::Trigger
end end
params do params do
requires :trigger_id, type: Integer, desc: 'The trigger ID' requires :trigger_id, type: Integer, desc: 'The trigger ID'
end end
post ':id/triggers/:trigger_id/take_ownership' do post ':id/triggers/:trigger_id/take_ownership' do
authenticate! authenticate!
@ -137,7 +137,7 @@ module API
success Entities::Trigger success Entities::Trigger
end end
params do params do
requires :trigger_id, type: Integer, desc: 'The trigger ID' requires :trigger_id, type: Integer, desc: 'The trigger ID'
end end
delete ':id/triggers/:trigger_id' do delete ':id/triggers/:trigger_id' do
authenticate! authenticate!

View file

@ -11,7 +11,7 @@ module API
requires :id, type: String, desc: 'The ID of a project' requires :id, type: String, desc: 'The ID of a project'
end end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc 'Get project variables' do desc 'Get project variables' do
success Entities::Variable success Entities::Variable
end end

View file

@ -16,10 +16,10 @@ module Gitlab
scope :running, -> { where(status: 'running') } scope :running, -> { where(status: 'running') }
scope :pending, -> { where(status: 'pending') } scope :pending, -> { where(status: 'pending') }
scope :success, -> { where(status: 'success') } scope :success, -> { where(status: 'success') }
scope :failed, -> { where(status: 'failed') } scope :failed, -> { where(status: 'failed') }
scope :canceled, -> { where(status: 'canceled') } scope :canceled, -> { where(status: 'canceled') }
scope :skipped, -> { where(status: 'skipped') } scope :skipped, -> { where(status: 'skipped') }
scope :manual, -> { where(status: 'manual') } scope :manual, -> { where(status: 'manual') }
scope :failed_but_allowed, -> do scope :failed_but_allowed, -> do
where(allow_failure: true, status: [:failed, :canceled]) where(allow_failure: true, status: [:failed, :canceled])

View file

@ -47,7 +47,7 @@ module Gitlab
user? ? :lfs_token : :lfs_deploy_token user? ? :lfs_token : :lfs_deploy_token
end end
private # rubocop:disable Lint/UselessAccessModifier private # rubocop:disable Lint/UselessAccessModifier
class HMACToken class HMACToken
include LfsTokenHelper include LfsTokenHelper
@ -100,7 +100,7 @@ module Gitlab
# #
class LegacyRedisDeviseToken class LegacyRedisDeviseToken
TOKEN_LENGTH = 50 TOKEN_LENGTH = 50
DEFAULT_EXPIRY_TIME = 1800 * 1000 # 30 mins DEFAULT_EXPIRY_TIME = 1800 * 1000 # 30 mins
def initialize(actor) def initialize(actor)
@actor = actor @actor = actor

View file

@ -111,7 +111,7 @@ module Gitlab
def project_for_paths(paths, request) def project_for_paths(paths, request)
project = Project.where_full_path_in(paths).first project = Project.where_full_path_in(paths).first
return unless Ability.allowed?(current_user(request, project), :read_project, project) return unless Ability.allowed?(current_user(request, project), :read_project, project)
project project
end end

View file

@ -103,7 +103,7 @@ module Gitlab
end end
def write_token(new_token) def write_token(new_token)
Tempfile.open(File.basename(token_path), File.dirname(token_path), encoding: 'ascii-8bit') do |f| Tempfile.open(File.basename(token_path), File.dirname(token_path), encoding: 'ascii-8bit') do |f|
f.write(new_token) f.write(new_token)
f.close f.close
File.link(f.path, token_path) File.link(f.path, token_path)

View file

@ -14,7 +14,7 @@ namespace :gitlab do
end end
desc "GitLab | Add a specific user to all projects (as a developer)" desc "GitLab | Add a specific user to all projects (as a developer)"
task :user_to_projects, [:email] => :environment do |t, args| task :user_to_projects, [:email] => :environment do |t, args|
user = User.find_by(email: args.email) user = User.find_by(email: args.email)
project_ids = Project.pluck(:id) project_ids = Project.pluck(:id)
puts "Importing #{user.email} users into #{project_ids.size} projects" puts "Importing #{user.email} users into #{project_ids.size} projects"
@ -22,7 +22,7 @@ namespace :gitlab do
end end
desc "GitLab | Add all users to all groups (admin users are added as owners)" desc "GitLab | Add all users to all groups (admin users are added as owners)"
task all_users_to_all_groups: :environment do |t, args| task all_users_to_all_groups: :environment do |t, args|
user_ids = User.where(admin: false).pluck(:id) user_ids = User.where(admin: false).pluck(:id)
admin_ids = User.where(admin: true).pluck(:id) admin_ids = User.where(admin: true).pluck(:id)
groups = Group.all groups = Group.all
@ -36,7 +36,7 @@ namespace :gitlab do
end end
desc "GitLab | Add a specific user to all groups (as a developer)" desc "GitLab | Add a specific user to all groups (as a developer)"
task :user_to_groups, [:email] => :environment do |t, args| task :user_to_groups, [:email] => :environment do |t, args|
user = User.find_by_email args.email user = User.find_by_email args.email
groups = Group.all groups = Group.all
puts "Importing #{user.email} users into #{groups.size} groups" puts "Importing #{user.email} users into #{groups.size} groups"

View file

@ -3,7 +3,7 @@
module QA module QA
context 'Create' do context 'Create' do
describe 'Merge request creation' do describe 'Merge request creation' do
it 'user creates a new merge request' do it 'user creates a new merge request' do
gitlab_account_username = "@#{Runtime::User.username}" gitlab_account_username = "@#{Runtime::User.username}"
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
@ -49,7 +49,7 @@ module QA
end end
describe 'creates a merge request', :smoke do describe 'creates a merge request', :smoke do
it 'user creates a new merge request' do it 'user creates a new merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }

View file

@ -3,7 +3,7 @@
module QA module QA
context 'Create' do context 'Create' do
describe 'Merge request rebasing' do describe 'Merge request rebasing' do
it 'user rebases source branch of merge request' do it 'user rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }

View file

@ -3,7 +3,7 @@
module QA module QA
context 'Create' do context 'Create' do
describe 'Merge request squashing' do describe 'Merge request squashing' do
it 'user squashes commits while merging' do it 'user squashes commits while merging' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)

View file

@ -3,7 +3,7 @@
module QA module QA
context 'Create' do context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do describe 'Git push over HTTP', :ldap_no_tls do
it 'user using a personal access token pushes code to the repository' do it 'user using a personal access token pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)

View file

@ -3,7 +3,7 @@
module QA module QA
context 'Create' do context 'Create' do
describe 'Push mirror a repository over HTTP' do describe 'Push mirror a repository over HTTP' do
it 'configures and syncs a (push) mirrored repository' do it 'configures and syncs a (push) mirrored repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)

View file

@ -3,7 +3,7 @@
module QA module QA
context 'Create' do context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do describe 'Git push over HTTP', :ldap_no_tls do
it 'user pushes code to the repository' do it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }

View file

@ -80,7 +80,7 @@ describe 'bin/changelog' do
end end
end end
describe '.read_type' do describe '.read_type' do
let(:type) { '1' } let(:type) { '1' }
it 'reads type from $stdin' do it 'reads type from $stdin' do

View file

@ -423,7 +423,7 @@ describe ApplicationController do
enforce_terms enforce_terms
end end
it 'redirects if the user did not accept the terms' do it 'redirects if the user did not accept the terms' do
get :index get :index
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(302)

View file

@ -229,7 +229,7 @@ describe Boards::IssuesController do
post :create, params: { post :create, params: {
board_id: board.to_param, board_id: board.to_param,
list_id: list.to_param, list_id: list.to_param,
issue: { title: title, project_id: project.id } issue: { title: title, project_id: project.id }
}, },
format: :json format: :json
end end

View file

@ -22,7 +22,7 @@ describe ChecksCollaboration do
end end
end end
it 'is true if the user can push to the project' do it 'is true if the user can push to the project' do
project.add_developer(user) project.add_developer(user)
expect(helper.can_collaborate_with_project?(project)).to be_truthy expect(helper.can_collaborate_with_project?(project)).to be_truthy

View file

@ -110,7 +110,7 @@ describe Groups::ChildrenController do
matched_project_1 = create(:project, :public, namespace: shared_subgroup, name: 'mobile-soc') matched_project_1 = create(:project, :public, namespace: shared_subgroup, name: 'mobile-soc')
l2_subgroup = create(:group, :public, parent: shared_subgroup, path: 'broadcom') l2_subgroup = create(:group, :public, parent: shared_subgroup, path: 'broadcom')
l3_subgroup = create(:group, :public, parent: l2_subgroup, path: 'wifi-group') l3_subgroup = create(:group, :public, parent: l2_subgroup, path: 'wifi-group')
matched_project_2 = create(:project, :public, namespace: l3_subgroup, name: 'mobile') matched_project_2 = create(:project, :public, namespace: l3_subgroup, name: 'mobile')
get :index, params: { group_id: group.to_param, filter: 'mobile' }, format: :json get :index, params: { group_id: group.to_param, filter: 'mobile' }, format: :json
@ -289,7 +289,7 @@ describe Groups::ChildrenController do
end end
context 'with subgroups and projects', :nested_groups do context 'with subgroups and projects', :nested_groups do
let!(:first_page_subgroups) { create_list(:group, per_page, :public, parent: group) } let!(:first_page_subgroups) { create_list(:group, per_page, :public, parent: group) }
let!(:other_subgroup) { create(:group, :public, parent: group) } let!(:other_subgroup) { create(:group, :public, parent: group) }
let!(:next_page_projects) { create_list(:project, per_page, :public, namespace: group) } let!(:next_page_projects) { create_list(:project, per_page, :public, namespace: group) }
@ -306,7 +306,7 @@ describe Groups::ChildrenController do
end end
context 'with a mixed first page' do context 'with a mixed first page' do
let!(:first_page_subgroups) { [create(:group, :public, parent: group)] } let!(:first_page_subgroups) { [create(:group, :public, parent: group)] }
let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group) } let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group) }
it 'correctly calculates the counts' do it 'correctly calculates the counts' do

View file

@ -1,7 +1,7 @@
require 'spec_helper' require 'spec_helper'
describe Profiles::AvatarsController do describe Profiles::AvatarsController do
let(:user) { create(:user, avatar: fixture_file_upload("spec/fixtures/dk.png")) } let(:user) { create(:user, avatar: fixture_file_upload("spec/fixtures/dk.png")) }
before do before do
sign_in(user) sign_in(user)

View file

@ -5,7 +5,7 @@ describe Projects::CommitController do
set(:user) { create(:user) } set(:user) { create(:user) }
let(:commit) { project.commit("master") } let(:commit) { project.commit("master") }
let(:master_pickable_sha) { '7d3b0f7cff5f37573aea97cebfd5692ea1689924' } let(:master_pickable_sha) { '7d3b0f7cff5f37573aea97cebfd5692ea1689924' }
let(:master_pickable_commit) { project.commit(master_pickable_sha) } let(:master_pickable_commit) { project.commit(master_pickable_sha) }
before do before do
sign_in(user) sign_in(user)

View file

@ -253,8 +253,8 @@ describe Projects::MergeRequestsController do
end end
context 'there is no source project' do context 'there is no source project' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:forked_project) { fork_project_with_submodules(project) } let(:forked_project) { fork_project_with_submodules(project) }
let!(:merge_request) { create(:merge_request, source_project: forked_project, source_branch: 'add-submodule-version-bump', target_branch: 'master', target_project: project) } let!(:merge_request) { create(:merge_request, source_project: forked_project, source_branch: 'add-submodule-version-bump', target_branch: 'master', target_project: project) }
before do before do
@ -884,7 +884,7 @@ describe Projects::MergeRequestsController do
end end
describe 'POST #rebase' do describe 'POST #rebase' do
let(:viewer) { user } let(:viewer) { user }
def post_rebase def post_rebase
post :rebase, params: { namespace_id: project.namespace, project_id: project, id: merge_request } post :rebase, params: { namespace_id: project.namespace, project_id: project, id: merge_request }

View file

@ -50,7 +50,7 @@ describe Projects::PipelinesController do
end end
end end
context 'when using legacy stages', :request_store do context 'when using legacy stages', :request_store do
before do before do
stub_feature_flags(ci_pipeline_persisted_stages: false) stub_feature_flags(ci_pipeline_persisted_stages: false)
end end

View file

@ -87,7 +87,7 @@ describe Projects::Serverless::FunctionsController do
end end
it 'has data' do it 'has data' do
get :index, params: params({ format: :json }) get :index, params: params({ format: :json })
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)

View file

@ -456,7 +456,7 @@ describe ProjectsController do
end end
context "when the project is forked" do context "when the project is forked" do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:forked_project) { fork_project(project, nil, repository: true) } let(:forked_project) { fork_project(project, nil, repository: true) }
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,

Some files were not shown because too many files have changed in this diff Show more