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

Add latest changes from gitlab-org/gitlab@master

parent 9735395f
No related branches found
No related tags found
No related merge requests found
Showing
with 111 additions and 33 deletions
Loading
Loading
@@ -46,7 +46,6 @@ rules:
promise/always-return: off
promise/no-callback-in-promise: off
promise/no-nesting: off
promise/valid-params: off
overrides:
files:
- '**/spec/**/*'
Loading
Loading
Loading
Loading
@@ -442,19 +442,6 @@ Rails/LinkToBlank:
- 'ee/app/helpers/ee/user_callouts_helper.rb'
- 'ee/app/helpers/license_helper.rb'
 
# Offense count: 11
# Cop supports --auto-correct.
Rails/Presence:
Exclude:
- 'app/models/ci/pipeline.rb'
- 'app/models/concerns/mentionable.rb'
- 'app/models/project_services/hipchat_service.rb'
- 'app/models/project_services/irker_service.rb'
- 'app/models/project_services/jira_service.rb'
- 'app/models/project_services/packagist_service.rb'
- 'app/models/wiki_page.rb'
- 'lib/gitlab/github_import/importer/releases_importer.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
Loading
Loading
Loading
Loading
@@ -55,6 +55,37 @@ export const logLinesParser = (lines = [], lineNumberStart) =>
return acc;
}, []);
 
/**
* Finds the repeated offset, removes the old one
*
* Returns a new array with the updated log without
* the repeated offset
*
* @param Array newLog
* @param Array oldParsed
* @returns Array
*
*/
export const findOffsetAndRemove = (newLog, oldParsed) => {
const cloneOldLog = [...oldParsed];
const lastIndex = cloneOldLog.length - 1;
const last = cloneOldLog[lastIndex];
const firstNew = newLog[0];
if (last.offset === firstNew.offset || (last.line && last.line.offset === firstNew.offset)) {
cloneOldLog.splice(lastIndex);
} else if (last.lines && last.lines.length) {
const lastNestedIndex = last.lines.length - 1;
const lastNested = last.lines[lastNestedIndex];
if (lastNested.offset === firstNew.offset) {
last.lines.splice(lastNestedIndex);
}
}
return cloneOldLog;
};
/**
* When the trace is not complete, backend may send the last received line
* in the new response.
Loading
Loading
# frozen_string_literal: true
 
class AuditEvent < ApplicationRecord
include CreatedAtFilterable
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
 
belongs_to :user, foreign_key: :author_id
Loading
Loading
@@ -9,6 +11,9 @@ class AuditEvent < ApplicationRecord
validates :entity_id, presence: true
validates :entity_type, presence: true
 
scope :by_entity_type, -> (entity_type) { where(entity_type: entity_type) }
scope :by_entity_id, -> (entity_id) { where(entity_id: entity_id) }
after_initialize :initialize_details
 
def initialize_details
Loading
Loading
@@ -18,6 +23,10 @@ class AuditEvent < ApplicationRecord
def author_name
self.user.name
end
def formatted_details
details.merge(details.slice(:from, :to).transform_values(&:to_s))
end
end
 
AuditEvent.prepend_if_ee('EE::AuditEvent')
Loading
Loading
@@ -584,11 +584,7 @@ module Ci
def ci_yaml_file_path
return unless repository_source? || unknown_source?
 
if project.ci_config_path.blank?
'.gitlab-ci.yml'
else
project.ci_config_path
end
project.ci_config_path.presence || '.gitlab-ci.yml'
end
 
def ci_yaml_file
Loading
Loading
Loading
Loading
@@ -150,7 +150,7 @@ module Mentionable
#
# Returns a Hash.
def detect_mentionable_changes
source = (changes.present? ? changes : previous_changes).dup
source = (changes.presence || previous_changes).dup
 
mentionable = self.class.mentionable_attrs.map { |attr, options| attr }
 
Loading
Loading
Loading
Loading
@@ -73,7 +73,7 @@ class HipchatService < Service
private
 
def gate
options = { api_version: api_version.present? ? api_version : 'v2' }
options = { api_version: api_version.presence || 'v2' }
options[:server_url] = server unless server.blank?
@gate ||= HipChat::Client.new(token, options)
end
Loading
Loading
Loading
Loading
@@ -36,8 +36,8 @@ class IrkerService < Service
 
def settings
{
server_host: server_host.present? ? server_host : 'localhost',
server_port: server_port.present? ? server_port : 6659
server_host: server_host.presence || 'localhost',
server_port: server_port.presence || 6659
}
end
 
Loading
Loading
Loading
Loading
@@ -337,7 +337,7 @@ class JiraService < IssueTrackerService
end
 
def client_url
api_url.present? ? api_url : url
api_url.presence || url
end
 
def reset_password?
Loading
Loading
Loading
Loading
@@ -59,7 +59,7 @@ class PackagistService < Service
end
 
def hook_url
base_url = server.present? ? server : 'https://packagist.org'
base_url = server.presence || 'https://packagist.org'
"#{base_url}/api/update-package?username=#{username}&apiToken=#{token}"
end
end
Loading
Loading
@@ -77,11 +77,7 @@ class WikiPage
 
# The escaped URL path of this page.
def slug
if @attributes[:slug].present?
@attributes[:slug]
else
wiki.wiki.preview_slug(title, format)
end
@attributes[:slug].presence || wiki.wiki.preview_slug(title, format)
end
 
alias_method :to_param, :slug
Loading
Loading
Loading
Loading
@@ -24,9 +24,9 @@
%a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path }
= sprite_icon(diff_file_changed_icon(diff_file), size: 16, css_class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon append-right-8")
%span.diff-changed-file-content.append-right-8
- if diff_file.blob&.name
- if diff_file.file_path
%strong.diff-changed-file-name
= diff_file.blob.name
= diff_file.file_path
- else
%strong.diff-changed-blank-file-name
= s_('Diffs|No file name available')
Loading
Loading
---
title: Add user_id and created_at columns to design_management_versions table
merge_request: 17316
author:
type: added
---
title: Fix inline rendering of videos for uploads with uppercase file extensions
merge_request: 17581
author:
type: fixed
---
title: Reduce Gitaly calls when viewing a commit
merge_request: 17095
author:
type: performance
---
title: Add status to deployments and state to environments in API responses
merge_request: 16242
author:
type: changed
# frozen_string_literal: true
class AddUserAndTimestampsToDesignManagementVersions < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
add_column :design_management_versions, :user_id, :integer
add_column :design_management_versions, :created_at, :datetime_with_timezone
end
def down
remove_columns :design_management_versions, :user_id, :created_at
end
end
# frozen_string_literal: true
class AddUserIndexesToDesignManagementVersions < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_foreign_key :design_management_versions, :users, column: :user_id, on_delete: :nullify
add_concurrent_index :design_management_versions, :user_id, where: 'user_id IS NOT NULL'
end
def down
remove_concurrent_index :design_management_versions, :user_id
remove_foreign_key :design_management_versions, column: :user_id
end
end
Loading
Loading
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
 
ActiveRecord::Schema.define(version: 2019_09_19_162036) do
ActiveRecord::Schema.define(version: 2019_09_26_041216) do
 
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
Loading
Loading
@@ -1232,8 +1232,11 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do
create_table "design_management_versions", force: :cascade do |t|
t.binary "sha", null: false
t.bigint "issue_id"
t.integer "user_id"
t.datetime_with_timezone "created_at"
t.index ["issue_id"], name: "index_design_management_versions_on_issue_id"
t.index ["sha", "issue_id"], name: "index_design_management_versions_on_sha_and_issue_id", unique: true
t.index ["user_id"], name: "index_design_management_versions_on_user_id", where: "(user_id IS NOT NULL)"
end
 
create_table "draft_notes", force: :cascade do |t|
Loading
Loading
@@ -3930,6 +3933,7 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do
add_foreign_key "design_management_designs_versions", "design_management_designs", column: "design_id", name: "fk_03c671965c", on_delete: :cascade
add_foreign_key "design_management_designs_versions", "design_management_versions", column: "version_id", name: "fk_f4d25ba00c", on_delete: :cascade
add_foreign_key "design_management_versions", "issues", on_delete: :cascade
add_foreign_key "design_management_versions", "users", name: "fk_ee16b939e5", on_delete: :nullify
add_foreign_key "draft_notes", "merge_requests", on_delete: :cascade
add_foreign_key "draft_notes", "users", column: "author_id", on_delete: :cascade
add_foreign_key "elasticsearch_indexed_namespaces", "namespaces", on_delete: :cascade
Loading
Loading
Loading
Loading
@@ -104,6 +104,7 @@ The following API resources are available outside of project and group contexts
| Resource | Available endpoints |
|:--------------------------------------------------|:------------------------------------------------------------------------|
| [Applications](applications.md) | `/applications` |
| [Audit Events](audit_events.md) **(PREMIUM ONLY)** | `/audit_events` |
| [Avatar](avatar.md) | `/avatar` |
| [Broadcast messages](broadcast_messages.md) | `/broadcast_messages` |
| [Code snippets](snippets.md) | `/snippets` |
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment