Commit 1f53cf7c authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'master-ce' into artifact-format-v2-with-parser

parents d867081d 5f664759
...@@ -745,7 +745,7 @@ GEM ...@@ -745,7 +745,7 @@ GEM
retriable (3.1.1) retriable (3.1.1)
rinku (2.0.0) rinku (2.0.0)
rotp (2.1.2) rotp (2.1.2)
rouge (3.1.1) rouge (3.2.0)
rqrcode (0.7.0) rqrcode (0.7.0)
chunky_png chunky_png
rqrcode-rails3 (0.1.7) rqrcode-rails3 (0.1.7)
......
...@@ -35,7 +35,9 @@ export default { ...@@ -35,7 +35,9 @@ export default {
watch: { watch: {
dropdownOpen() { dropdownOpen() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dropdownMenu.scrollIntoView(); this.$refs.dropdownMenu.scrollIntoView({
block: 'nearest',
});
}); });
}, },
mouseOver() { mouseOver() {
......
...@@ -137,7 +137,11 @@ export default class SearchAutocomplete { ...@@ -137,7 +137,11 @@ export default class SearchAutocomplete {
if (!term) { if (!term) {
const contents = this.getCategoryContents(); const contents = this.getCategoryContents();
if (contents) { if (contents) {
this.searchInput.data('glDropdown').filter.options.callback(contents); const glDropdownInstance = this.searchInput.data('glDropdown');
if (glDropdownInstance) {
glDropdownInstance.filter.options.callback(contents);
}
this.enableAutocomplete(); this.enableAutocomplete();
} }
return; return;
......
# frozen_string_literal: true
class Admin::ServicesController < Admin::ApplicationController class Admin::ServicesController < Admin::ApplicationController
include ServiceParams include ServiceParams
...@@ -30,7 +32,7 @@ class Admin::ServicesController < Admin::ApplicationController ...@@ -30,7 +32,7 @@ class Admin::ServicesController < Admin::ApplicationController
def services_templates def services_templates
Service.available_services_names.map do |service_name| Service.available_services_names.map do |service_name|
service_template = service_name.concat("_service").camelize.constantize service_template = "#{service_name}_service".camelize.constantize
service_template.where(template: true).first_or_create service_template.where(template: true).first_or_create
end end
end end
......
class Projects::PipelinesController < Projects::ApplicationController class Projects::PipelinesController < Projects::ApplicationController
before_action :whitelist_query_limiting, only: [:create, :retry] before_action :whitelist_query_limiting, only: [:create, :retry]
before_action :pipeline, except: [:index, :new, :create, :charts] before_action :pipeline, except: [:index, :new, :create, :charts]
before_action :commit, only: [:show, :builds, :failures]
before_action :authorize_read_pipeline! before_action :authorize_read_pipeline!
before_action :authorize_create_pipeline!, only: [:new, :create] before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :authorize_update_pipeline!, only: [:retry, :cancel]
...@@ -168,10 +167,6 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -168,10 +167,6 @@ class Projects::PipelinesController < Projects::ApplicationController
.present(current_user: current_user) .present(current_user: current_user)
end end
def commit
@commit ||= @pipeline.commit
end
def whitelist_query_limiting def whitelist_query_limiting
# Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42343 # Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42343
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42339') Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42339')
......
# frozen_string_literal: true
require_dependency 'declarative_policy' require_dependency 'declarative_policy'
class Ability class Ability
......
# frozen_string_literal: true
class AbuseReport < ActiveRecord::Base class AbuseReport < ActiveRecord::Base
include CacheMarkdownField include CacheMarkdownField
......
# frozen_string_literal: true
class ActiveSession class ActiveSession
include ActiveModel::Model include ActiveModel::Model
......
# frozen_string_literal: true
class Appearance < ActiveRecord::Base class Appearance < ActiveRecord::Base
include CacheableAttributes include CacheableAttributes
include CacheMarkdownField include CacheMarkdownField
......
# frozen_string_literal: true
class ApplicationSetting < ActiveRecord::Base class ApplicationSetting < ActiveRecord::Base
include CacheableAttributes include CacheableAttributes
include CacheMarkdownField include CacheMarkdownField
......
# frozen_string_literal: true
class AuditEvent < ActiveRecord::Base class AuditEvent < ActiveRecord::Base
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
......
# frozen_string_literal: true
class AwardEmoji < ActiveRecord::Base class AwardEmoji < ActiveRecord::Base
DOWNVOTE_NAME = "thumbsdown".freeze DOWNVOTE_NAME = "thumbsdown".freeze
UPVOTE_NAME = "thumbsup".freeze UPVOTE_NAME = "thumbsup".freeze
......
# frozen_string_literal: true
class Badge < ActiveRecord::Base class Badge < ActiveRecord::Base
# This structure sets the placeholders that the urls # This structure sets the placeholders that the urls
# can have. This hash also sets which action to ask when # can have. This hash also sets which action to ask when
......
# frozen_string_literal: true
# Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects # Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects
class Blob < SimpleDelegator class Blob < SimpleDelegator
CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute
......
# frozen_string_literal: true
class Board < ActiveRecord::Base class Board < ActiveRecord::Base
belongs_to :group belongs_to :group
belongs_to :project belongs_to :project
......
# frozen_string_literal: true
class BroadcastMessage < ActiveRecord::Base class BroadcastMessage < ActiveRecord::Base
include CacheMarkdownField include CacheMarkdownField
include Sortable include Sortable
......
# frozen_string_literal: true
class ChatName < ActiveRecord::Base class ChatName < ActiveRecord::Base
LAST_USED_AT_INTERVAL = 1.hour LAST_USED_AT_INTERVAL = 1.hour
......
# frozen_string_literal: true
class ChatTeam < ActiveRecord::Base class ChatTeam < ActiveRecord::Base
validates :team_id, presence: true validates :team_id, presence: true
validates :namespace, uniqueness: true validates :namespace, uniqueness: true
......
module Clusters module Clusters
module Applications module Applications
class Ingress < ActiveRecord::Base class Ingress < ActiveRecord::Base
VERSION = '0.23.0'.freeze
self.table_name = 'clusters_applications_ingress' self.table_name = 'clusters_applications_ingress'
include ::Clusters::Concerns::ApplicationCore include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus include ::Clusters::Concerns::ApplicationStatus
include ::Clusters::Concerns::ApplicationVersion
include ::Clusters::Concerns::ApplicationData include ::Clusters::Concerns::ApplicationData
include AfterCommitQueue include AfterCommitQueue
default_value_for :ingress_type, :nginx default_value_for :ingress_type, :nginx
default_value_for :version, :nginx default_value_for :version, VERSION
enum ingress_type: { enum ingress_type: {
nginx: 1 nginx: 1
...@@ -33,6 +36,7 @@ module Clusters ...@@ -33,6 +36,7 @@ module Clusters
def install_command def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new( Gitlab::Kubernetes::Helm::InstallCommand.new(
name, name,
version: VERSION,
chart: chart, chart: chart,
values: values values: values
) )
......
module Clusters module Clusters
module Applications module Applications
class Jupyter < ActiveRecord::Base class Jupyter < ActiveRecord::Base
VERSION = '0.0.1'.freeze VERSION = 'v0.6'.freeze
self.table_name = 'clusters_applications_jupyter' self.table_name = 'clusters_applications_jupyter'
include ::Clusters::Concerns::ApplicationCore include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus include ::Clusters::Concerns::ApplicationStatus
include ::Clusters::Concerns::ApplicationVersion
include ::Clusters::Concerns::ApplicationData include ::Clusters::Concerns::ApplicationData
belongs_to :oauth_application, class_name: 'Doorkeeper::Application' belongs_to :oauth_application, class_name: 'Doorkeeper::Application'
...@@ -36,6 +37,7 @@ module Clusters ...@@ -36,6 +37,7 @@ module Clusters
def install_command def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new( Gitlab::Kubernetes::Helm::InstallCommand.new(
name, name,
version: VERSION,
chart: chart, chart: chart,
values: values, values: values,
repository: repository repository: repository
......
...@@ -9,6 +9,7 @@ module Clusters ...@@ -9,6 +9,7 @@ module Clusters
include ::Clusters::Concerns::ApplicationCore include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus include ::Clusters::Concerns::ApplicationStatus
include ::Clusters::Concerns::ApplicationVersion
include ::Clusters::Concerns::ApplicationData include ::Clusters::Concerns::ApplicationData
default_value_for :version, VERSION default_value_for :version, VERSION
...@@ -44,8 +45,8 @@ module Clusters ...@@ -44,8 +45,8 @@ module Clusters
def install_command def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new( Gitlab::Kubernetes::Helm::InstallCommand.new(
name, name,
version: VERSION,
chart: chart, chart: chart,
version: version,
values: values values: values
) )
end end
......
module Clusters module Clusters
module Applications module Applications
class Runner < ActiveRecord::Base class Runner < ActiveRecord::Base
VERSION = '0.1.13'.freeze VERSION = '0.1.31'.freeze
self.table_name = 'clusters_applications_runners' self.table_name = 'clusters_applications_runners'
include ::Clusters::Concerns::ApplicationCore include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus include ::Clusters::Concerns::ApplicationStatus
include ::Clusters::Concerns::ApplicationVersion
include ::Clusters::Concerns::ApplicationData include ::Clusters::Concerns::ApplicationData
belongs_to :runner, class_name: 'Ci::Runner', foreign_key: :runner_id belongs_to :runner, class_name: 'Ci::Runner', foreign_key: :runner_id
...@@ -29,6 +30,7 @@ module Clusters ...@@ -29,6 +30,7 @@ module Clusters
def install_command def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new( Gitlab::Kubernetes::Helm::InstallCommand.new(
name, name,
version: VERSION,
chart: chart, chart: chart,
values: values, values: values,
repository: repository repository: repository
......
# frozen_string_literal: true
module Clusters
module Concerns
module ApplicationVersion
extend ActiveSupport::Concern
included do
state_machine :status do
after_transition any => [:installing] do |application|
application.update(version: application.class.const_get(:VERSION))
end
end
end
end
end
end
# coding: utf-8 # coding: utf-8
# frozen_string_literal: true
class Commit class Commit
extend ActiveModel::Naming extend ActiveModel::Naming
extend Gitlab::Cache::RequestCache extend Gitlab::Cache::RequestCache
...@@ -339,21 +341,21 @@ class Commit ...@@ -339,21 +341,21 @@ class Commit
end end
def cherry_pick_description(user) def cherry_pick_description(user)
message_body = "(cherry picked from commit #{sha})" message_body = ["(cherry picked from commit #{sha})"]
if merged_merge_request?(user) if merged_merge_request?(user)
commits_in_merge_request = merged_merge_request(user).commits commits_in_merge_request = merged_merge_request(user).commits
if commits_in_merge_request.present? if commits_in_merge_request.present?
message_body << "\n" message_body << ""
commits_in_merge_request.reverse.each do |commit_in_merge| commits_in_merge_request.reverse.each do |commit_in_merge|
message_body << "\n#{commit_in_merge.short_id} #{commit_in_merge.title}" message_body << "#{commit_in_merge.short_id} #{commit_in_merge.title}"
end end
end end
end end
message_body message_body.join("\n")
end end
def cherry_pick_message(user) def cherry_pick_message(user)
......
# frozen_string_literal: true
# CommitRange makes it easier to work with commit ranges # CommitRange makes it easier to work with commit ranges
# #
# Examples: # Examples:
......
# frozen_string_literal: true
class CommitStatus < ActiveRecord::Base class CommitStatus < ActiveRecord::Base
include HasStatus include HasStatus
include Importable include Importable
......
# frozen_string_literal: true
class Compare class Compare
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
class ContainerRepository < ActiveRecord::Base class ContainerRepository < ActiveRecord::Base
belongs_to :project belongs_to :project
......
# frozen_string_literal: true
class CycleAnalytics class CycleAnalytics
STAGES = %i[issue plan code test review staging production].freeze STAGES = %i[issue plan code test review staging production].freeze
......
# frozen_string_literal: true
class DashboardMilestone < GlobalMilestone class DashboardMilestone < GlobalMilestone
def issues_finder_params def issues_finder_params
{ authorized_only: true } { authorized_only: true }
......
# frozen_string_literal: true
class DeployKey < Key class DeployKey < Key
include IgnorableColumn include IgnorableColumn
......
# frozen_string_literal: true
class DeployKeysProject < ActiveRecord::Base class DeployKeysProject < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :deploy_key, inverse_of: :deploy_keys_projects belongs_to :deploy_key, inverse_of: :deploy_keys_projects
......
# frozen_string_literal: true
class DeployToken < ActiveRecord::Base class DeployToken < ActiveRecord::Base
include Expirable include Expirable
include TokenAuthenticatable include TokenAuthenticatable
...@@ -28,7 +30,7 @@ class DeployToken < ActiveRecord::Base ...@@ -28,7 +30,7 @@ class DeployToken < ActiveRecord::Base
end end
def active? def active?
!revoked && expires_at > Date.today !revoked && !expired?
end end
def scopes def scopes
...@@ -61,6 +63,12 @@ class DeployToken < ActiveRecord::Base ...@@ -61,6 +63,12 @@ class DeployToken < ActiveRecord::Base
private private
def expired?
return false unless expires_at
expires_at < Date.today
end
def ensure_at_least_one_scope def ensure_at_least_one_scope
errors.add(:base, "Scopes can't be blank") unless read_repository || read_registry errors.add(:base, "Scopes can't be blank") unless read_repository || read_registry
end end
......
# frozen_string_literal: true
class Deployment < ActiveRecord::Base class Deployment < ActiveRecord::Base
include AtomicInternalId include AtomicInternalId
include IidRoutes include IidRoutes
......
# frozen_string_literal: true
# A discussion on merge request or commit diffs consisting of `DiffNote` notes. # A discussion on merge request or commit diffs consisting of `DiffNote` notes.
# #
# A discussion of this type can be resolvable. # A discussion of this type can be resolvable.
......
# frozen_string_literal: true
# A note on merge request or commit diffs # A note on merge request or commit diffs
# #
# A note of this type can be resolvable. # A note of this type can be resolvable.
......
# frozen_string_literal: true
class DirectlyAddressedUser class DirectlyAddressedUser
class << self class << self
def reference_pattern def reference_pattern
......
# frozen_string_literal: true
# A non-diff discussion on an issue, merge request, commit, or snippet, consisting of `DiscussionNote` notes. # A non-diff discussion on an issue, merge request, commit, or snippet, consisting of `DiscussionNote` notes.
# #
# A discussion of this type can be resolvable. # A discussion of this type can be resolvable.
......
# frozen_string_literal: true
# A note in a non-diff discussion on an issue, merge request, commit, or snippet. # A note in a non-diff discussion on an issue, merge request, commit, or snippet.
# #
# A note of this type can be resolvable. # A note of this type can be resolvable.
......
# frozen_string_literal: true
class Email < ActiveRecord::Base class Email < ActiveRecord::Base
include Sortable include Sortable
include Gitlab::SQL::Pattern include Gitlab::SQL::Pattern
......
# frozen_string_literal: true
class Environment < ActiveRecord::Base class Environment < ActiveRecord::Base
# Used to generate random suffixes for the slug # Used to generate random suffixes for the slug
LETTERS = 'a'..'z' LETTERS = 'a'..'z'
...@@ -173,7 +175,7 @@ class Environment < ActiveRecord::Base ...@@ -173,7 +175,7 @@ class Environment < ActiveRecord::Base
# * cannot end with `-` # * cannot end with `-`
def generate_slug def generate_slug
# Lowercase letters and numbers only # Lowercase letters and numbers only
slugified = name.to_s.downcase.gsub(/[^a-z0-9]/, '-') slugified = +name.to_s.downcase.gsub(/[^a-z0-9]/, '-')
# Must start with a letter # Must start with a letter
slugified = 'env-' + slugified unless LETTERS.cover?(slugified[0]) slugified = 'env-' + slugified unless LETTERS.cover?(slugified[0])
......
# frozen_string_literal: true
# Placeholder class for model that is implemented in EE # Placeholder class for model that is implemented in EE
# It reserves '&' as a reference prefix, but the table does not exists in CE # It reserves '&' as a reference prefix, but the table does not exists in CE
class Epic < ActiveRecord::Base class Epic < ActiveRecord::Base
......
# frozen_string_literal: true
class Event < ActiveRecord::Base class Event < ActiveRecord::Base
include Sortable include Sortable
include IgnorableColumn include IgnorableColumn
......
# frozen_string_literal: true
# A collection of events to display in an event list. # A collection of events to display in an event list.
# #
# An EventCollection is meant to be used for displaying events to a user (e.g. # An EventCollection is meant to be used for displaying events to a user (e.g.
......
# frozen_string_literal: true
class ExternalIssue class ExternalIssue
include Referable include Referable
......
# frozen_string_literal: true
class ForkNetwork < ActiveRecord::Base class ForkNetwork < ActiveRecord::Base
belongs_to :root_project, class_name: 'Project' belongs_to :root_project, class_name: 'Project'
has_many :fork_network_members has_many :fork_network_members
......
# frozen_string_literal: true
class ForkNetworkMember < ActiveRecord::Base class ForkNetworkMember < ActiveRecord::Base
belongs_to :fork_network belongs_to :fork_network
belongs_to :project belongs_to :project
......
# frozen_string_literal: true
class ForkedProjectLink < ActiveRecord::Base class ForkedProjectLink < ActiveRecord::Base
belongs_to :forked_to_project, -> { where.not(pending_delete: true) }, class_name: 'Project' belongs_to :forked_to_project, -> { where.not(pending_delete: true) }, class_name: 'Project'
belongs_to :forked_from_project, -> { where.not(pending_delete: true) }, class_name: 'Project' belongs_to :forked_from_project, -> { where.not(pending_delete: true) }, class_name: 'Project'
......
# frozen_string_literal: true
class GenericCommitStatus < CommitStatus class GenericCommitStatus < CommitStatus
before_validation :set_default_values before_validation :set_default_values
......
# frozen_string_literal: true
class GlobalLabel class GlobalLabel
attr_accessor :title, :labels attr_accessor :title, :labels
alias_attribute :name, :title alias_attribute :name, :title
......
# frozen_string_literal: true
class GlobalMilestone class GlobalMilestone
include Milestoneish include Milestoneish
......
# frozen_string_literal: true
class GpgKey < ActiveRecord::Base class GpgKey < ActiveRecord::Base
KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze
KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'.freeze KEY_SUFFIX = '-----END PGP PUBLIC KEY BLOCK-----'.freeze
......
# frozen_string_literal: true
class GpgKeySubkey < ActiveRecord::Base class GpgKeySubkey < ActiveRecord::Base
include ShaAttribute include ShaAttribute
......
# frozen_string_literal: true
class GpgSignature < ActiveRecord::Base class GpgSignature < ActiveRecord::Base
include ShaAttribute include ShaAttribute
......
# frozen_string_literal: true
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
class Group < Namespace class Group < Namespace
......
# frozen_string_literal: true
class GroupCustomAttribute < ActiveRecord::Base class GroupCustomAttribute < ActiveRecord::Base
belongs_to :group belongs_to :group
......
# frozen_string_literal: true
class GroupLabel < Label class GroupLabel < Label
belongs_to :group belongs_to :group
......
# frozen_string_literal: true
class GroupMilestone < GlobalMilestone class GroupMilestone < GlobalMilestone
attr_accessor :group attr_accessor :group
......
# frozen_string_literal: true
class Guest class Guest
class << self class << self
def can?(action, subject = :global) def can?(action, subject = :global)
......
# frozen_string_literal: true
class Identity < ActiveRecord::Base class Identity < ActiveRecord::Base
def self.uniqueness_scope def self.uniqueness_scope
:provider :provider
......
# frozen_string_literal: true
class ImportExportUpload < ActiveRecord::Base class ImportExportUpload < ActiveRecord::Base
include WithUploads include WithUploads
include ObjectStorage::BackgroundMove include ObjectStorage::BackgroundMove
belongs_to :project belongs_to :project
# These hold the project Import/Export archives (.tar.gz files)
mount_uploader :import_file, ImportExportUploader mount_uploader :import_file, ImportExportUploader
mount_uploader :export_file, ImportExportUploader mount_uploader :export_file, ImportExportUploader
......
# frozen_string_literal: true
# A discussion to wrap a single `Note` note on the root of an issue, merge request, # A discussion to wrap a single `Note` note on the root of an issue, merge request,
# commit, or snippet, that is not displayed as a discussion. # commit, or snippet, that is not displayed as a discussion.
# #
......
# frozen_string_literal: true
require 'resolv' require 'resolv'
class InstanceConfiguration class InstanceConfiguration
......
# frozen_string_literal: true
# An InternalId is a strictly monotone sequence of integers # An InternalId is a strictly monotone sequence of integers
# generated for a given scope and usage. # generated for a given scope and usage.
# #
......
# frozen_string_literal: true
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
class Issue < ActiveRecord::Base class Issue < ActiveRecord::Base
......
# frozen_string_literal: true
class IssueAssignee < ActiveRecord::Base class IssueAssignee < ActiveRecord::Base
belongs_to :issue belongs_to :issue
belongs_to :assignee, class_name: "User", foreign_key: :user_id belongs_to :assignee, class_name: "User", foreign_key: :user_id
......
# frozen_string_literal: true
# IssueCollection can be used to reduce a list of issues down to a subset. # IssueCollection can be used to reduce a list of issues down to a subset.
# #
# IssueCollection is not meant to be some sort of Enumerable, instead it's meant # IssueCollection is not meant to be some sort of Enumerable, instead it's meant
......
# frozen_string_literal: true
require 'digest/md5' require 'digest/md5'
class Key < ActiveRecord::Base class Key < ActiveRecord::Base
......
# frozen_string_literal: true
class Label < ActiveRecord::Base class Label < ActiveRecord::Base
include CacheMarkdownField include CacheMarkdownField
include Referable include Referable
......
# frozen_string_literal: true
class LabelLink < ActiveRecord::Base class LabelLink < ActiveRecord::Base
include Importable include Importable
......
# frozen_string_literal: true
class LabelPriority < ActiveRecord::Base class LabelPriority < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :label belongs_to :label
......
# frozen_string_literal: true
# A discussion on merge request or commit diffs consisting of `LegacyDiffNote` notes. # A discussion on merge request or commit diffs consisting of `LegacyDiffNote` notes.
# #
# All new diff discussions are of the type `DiffDiscussion`, but any diff discussions created # All new diff discussions are of the type `DiffDiscussion`, but any diff discussions created
......
# frozen_string_literal: true
# A note on merge request or commit diffs, using the legacy implementation. # A note on merge request or commit diffs, using the legacy implementation.
# #
# All new diff notes are of the type `DiffNote`, but any diff notes created # All new diff notes are of the type `DiffNote`, but any diff notes created
......
# frozen_string_literal: true
class LfsFileLock < ActiveRecord::Base class LfsFileLock < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :user belongs_to :user
......
# frozen_string_literal: true
class LfsObject < ActiveRecord::Base class LfsObject < ActiveRecord::Base
include AfterCommitQueue include AfterCommitQueue
include ObjectStorage::BackgroundMove include ObjectStorage::BackgroundMove
......
# frozen_string_literal: true
class LfsObjectsProject < ActiveRecord::Base class LfsObjectsProject < ActiveRecord::Base
belongs_to :project belongs_to :project
belongs_to :lfs_object belongs_to :lfs_object
......
# frozen_string_literal: true
class List < ActiveRecord::Base class List < ActiveRecord::Base
belongs_to :board belongs_to :board
belongs_to :label belongs_to :label
......
# frozen_string_literal: true
class Member < ActiveRecord::Base class Member < ActiveRecord::Base
include AfterCommitQueue include AfterCommitQueue
include Sortable include Sortable
......
# frozen_string_literal: true
class MergeRequest < ActiveRecord::Base class MergeRequest < ActiveRecord::Base
include AtomicInternalId include AtomicInternalId
include IidRoutes include IidRoutes
......
# frozen_string_literal: true
class MergeRequestDiff < ActiveRecord::Base class MergeRequestDiff < ActiveRecord::Base
include Sortable include Sortable
include Importable include Importable
...@@ -249,15 +251,13 @@ class MergeRequestDiff < ActiveRecord::Base ...@@ -249,15 +251,13 @@ class MergeRequestDiff < ActiveRecord::Base
end end
def load_diffs(options) def load_diffs(options)
raw = merge_request_diff_files.map(&:to_hash) collection = merge_request_diff_files
if paths = options[:paths] if paths = options[:paths]
raw = raw.select do |diff| collection = collection.where('old_path IN (?) OR new_path IN (?)', paths, paths)
paths.include?(diff[:old_path]) || paths.include?(diff[:new_path])
end
end end
Gitlab::Git::DiffCollection.new(raw, options) Gitlab::Git::DiffCollection.new(collection.map(&:to_hash), options)
end end
def load_commits def load_commits
......
# frozen_string_literal: true
class MergeRequestDiffCommit < ActiveRecord::Base class MergeRequestDiffCommit < ActiveRecord::Base
include ShaAttribute include ShaAttribute
......
# frozen_string_literal: true
class MergeRequestDiffFile < ActiveRecord::Base class MergeRequestDiffFile < ActiveRecord::Base
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
include DiffFile include DiffFile
......
# frozen_string_literal: true
class MergeRequestsClosingIssues < ActiveRecord::Base class MergeRequestsClosingIssues < ActiveRecord::Base
belongs_to :merge_request belongs_to :merge_request
belongs_to :issue belongs_to :issue
......
# frozen_string_literal: true
class Milestone < ActiveRecord::Base class Milestone < ActiveRecord::Base
# Represents a "No Milestone" state used for filtering Issues and Merge # Represents a "No Milestone" state used for filtering Issues and Merge
# Requests that have no milestone assigned. # Requests that have no milestone assigned.
......
# frozen_string_literal: true
class Namespace < ActiveRecord::Base class Namespace < ActiveRecord::Base
include CacheMarkdownField include CacheMarkdownField
include Sortable include Sortable
......
# frozen_string_literal: true
# A note on the root of an issue, merge request, commit, or snippet. # A note on the root of an issue, merge request, commit, or snippet.
# #
# A note of this type is never resolvable. # A note of this type is never resolvable.
......
# frozen_string_literal: true
class NoteDiffFile < ActiveRecord::Base class NoteDiffFile < ActiveRecord::Base
include DiffFile include DiffFile
......
# frozen_string_literal: true
# Holds reasons for a notification to have been sent as well as a priority list to select which reason to use # Holds reasons for a notification to have been sent as well as a priority list to select which reason to use
# above the rest # above the rest
class NotificationReason class NotificationReason
......
# frozen_string_literal: true
class NotificationRecipient class NotificationRecipient
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
class NotificationSetting < ActiveRecord::Base class NotificationSetting < ActiveRecord::Base
include IgnorableColumn include IgnorableColumn
......
# frozen_string_literal: true
class OauthAccessGrant < Doorkeeper::AccessGrant class OauthAccessGrant < Doorkeeper::AccessGrant
belongs_to :resource_owner, class_name: 'User' belongs_to :resource_owner, class_name: 'User'
belongs_to :application, class_name: 'Doorkeeper::Application' belongs_to :application, class_name: 'Doorkeeper::Application'
......
# frozen_string_literal: true
class OauthAccessToken < Doorkeeper::AccessToken class OauthAccessToken < Doorkeeper::AccessToken
belongs_to :resource_owner, class_name: 'User' belongs_to :resource_owner, class_name: 'User'
belongs_to :application, class_name: 'Doorkeeper::Application' belongs_to :application, class_name: 'Doorkeeper::Application'
......
# frozen_string_literal: true
# When notes on a commit are displayed in the context of a merge request that # When notes on a commit are displayed in the context of a merge request that
# contains that commit, they are displayed as if they were a discussion. # contains that commit, they are displayed as if they were a discussion.
# #
......
# frozen_string_literal: true
class PagesDomain < ActiveRecord::Base class PagesDomain < ActiveRecord::Base
VERIFICATION_KEY = 'gitlab-pages-verification-code'.freeze VERIFICATION_KEY = 'gitlab-pages-verification-code'.freeze
VERIFICATION_THRESHOLD = 3.days.freeze VERIFICATION_THRESHOLD = 3.days.freeze
......
# frozen_string_literal: true
class PersonalAccessToken < ActiveRecord::Base class PersonalAccessToken < ActiveRecord::Base
include Expirable include Expirable
include TokenAuthenticatable include TokenAuthenticatable
......
# frozen_string_literal: true
class PersonalSnippet < Snippet class PersonalSnippet < Snippet
include WithUploads include WithUploads
end end
# frozen_string_literal: true
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
class Project < ActiveRecord::Base class Project < ActiveRecord::Base
......
# frozen_string_literal: true
class ProjectAuthorization < ActiveRecord::Base class ProjectAuthorization < ActiveRecord::Base
belongs_to :user belongs_to :user
belongs_to :project belongs_to :project
......
# frozen_string_literal: true
class ProjectAutoDevops < ActiveRecord::Base class ProjectAutoDevops < ActiveRecord::Base
belongs_to :project belongs_to :project
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment