提交 96f3246b 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 2477ab55
......@@ -12,3 +12,5 @@ module Types
end
# rubocop: enable Graphql/AuthorizeTypes
end
Types::IssueSortEnum.prepend_if_ee('::EE::Types::IssueSortEnum')
......@@ -183,4 +183,4 @@ module IssuesHelper
module_function :url_for_tracker_issue
end
IssuesHelper.include_if_ee('EE::IssuesHelper')
IssuesHelper.prepend_if_ee('EE::IssuesHelper')
---
title: Graphql query for issues can now be sorted by weight
merge_request: 19721
author:
type: added
---
title: Fixes MR approvers tooltip wrong color
merge_request: 20287
author: Dheeraj Joshi
type: fixed
---
title: 'Backup: Disable setting of ACL for Google uploads'
merge_request: 20407
author:
type: fixed
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddPromotedToEpicToIssues < ActiveRecord::Migration[5.2]
DOWNTIME = false
def up
add_column :issues, :promoted_to_epic_id, :integer
end
def down
remove_column :issues, :promoted_to_epic_id
end
end
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddPromotedToEpicToIssuesIndex < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_foreign_key :issues, :epics, column: :promoted_to_epic_id, on_delete: :nullify
add_concurrent_index :issues, :promoted_to_epic_id, where: 'promoted_to_epic_id IS NOT NULL'
end
def down
remove_concurrent_index(:issues, :promoted_to_epic_id)
remove_foreign_key :issues, column: :promoted_to_epic_id
end
end
......@@ -2049,6 +2049,7 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do
t.integer "closed_by_id"
t.integer "state_id", limit: 2, default: 1, null: false
t.integer "duplicated_to_id"
t.integer "promoted_to_epic_id"
t.index ["author_id"], name: "index_issues_on_author_id"
t.index ["closed_by_id"], name: "index_issues_on_closed_by_id"
t.index ["confidential"], name: "index_issues_on_confidential"
......@@ -2065,6 +2066,7 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do
t.index ["project_id", "relative_position", "state_id", "id"], name: "idx_issues_on_project_id_and_rel_position_and_state_id_and_id", order: { id: :desc }
t.index ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state"
t.index ["project_id", "updated_at", "id", "state_id"], name: "idx_issues_on_project_id_and_updated_at_and_id_and_state_id"
t.index ["promoted_to_epic_id"], name: "index_issues_on_promoted_to_epic_id", where: "(promoted_to_epic_id IS NOT NULL)"
t.index ["relative_position"], name: "index_issues_on_relative_position"
t.index ["state"], name: "index_issues_on_state"
t.index ["state_id"], name: "idx_issues_on_state_id"
......@@ -4428,6 +4430,7 @@ ActiveRecord::Schema.define(version: 2019_11_18_182722) do
add_foreign_key "issue_tracker_data", "services", on_delete: :cascade
add_foreign_key "issue_user_mentions", "issues", on_delete: :cascade
add_foreign_key "issue_user_mentions", "notes", on_delete: :cascade
add_foreign_key "issues", "epics", column: "promoted_to_epic_id", name: "fk_df75a7c8b8", on_delete: :nullify
add_foreign_key "issues", "issues", column: "duplicated_to_id", name: "fk_9c4516d665", on_delete: :nullify
add_foreign_key "issues", "issues", column: "moved_to_id", name: "fk_a194299be1", on_delete: :nullify
add_foreign_key "issues", "milestones", name: "fk_96b1dd429c", on_delete: :nullify
......
......@@ -2537,6 +2537,16 @@ enum IssueSort {
"""
RELATIVE_POSITION_ASC
"""
Weight by ascending order
"""
WEIGHT_ASC
"""
Weight by descending order
"""
WEIGHT_DESC
"""
Created at ascending order
"""
......
......@@ -13772,6 +13772,18 @@
"description": "Relative position by ascending order",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_ASC",
"description": "Weight by ascending order",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "WEIGHT_DESC",
"description": "Weight by descending order",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
......
......@@ -47,11 +47,7 @@ module Backup
directory = connect_to_remote_directory(connection_settings)
if directory.files.create(key: remote_target, body: File.open(tar_file), public: false,
multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size,
encryption: Gitlab.config.backup.upload.encryption,
encryption_key: Gitlab.config.backup.upload.encryption_key,
storage_class: Gitlab.config.backup.upload.storage_class)
if directory.files.create(create_attributes)
progress.puts "done".color(:green)
else
puts "uploading backup to #{remote_directory} failed".color(:red)
......@@ -252,5 +248,27 @@ module Backup
skipped: ENV["SKIP"]
}
end
def create_attributes
attrs = {
key: remote_target,
body: File.open(tar_file),
multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size,
encryption: Gitlab.config.backup.upload.encryption,
encryption_key: Gitlab.config.backup.upload.encryption_key,
storage_class: Gitlab.config.backup.upload.storage_class
}
# Google bucket-only policies prevent setting an ACL. In any case, by default,
# all objects are set to the default ACL, which is project-private:
# https://cloud.google.com/storage/docs/json_api/v1/defaultObjectAccessControls
attrs[:public] = false unless google_provider?
attrs
end
def google_provider?
Gitlab.config.backup.upload.connection&.provider&.downcase == 'google'
end
end
end
......@@ -9565,6 +9565,9 @@ msgstr ""
msgid "IssuableStatus|moved"
msgstr ""
msgid "IssuableStatus|promoted"
msgstr ""
msgid "Issue"
msgstr ""
......
......@@ -326,7 +326,7 @@ describe Backup::Manager do
context 'target path' do
it 'uses the tar filename by default' do
expect_any_instance_of(Fog::Collection).to receive(:create)
.with(hash_including(key: backup_filename))
.with(hash_including(key: backup_filename, public: false))
.and_return(true)
Dir.chdir(Gitlab.config.backup.path) do
......@@ -338,7 +338,39 @@ describe Backup::Manager do
stub_env('DIRECTORY', 'daily')
expect_any_instance_of(Fog::Collection).to receive(:create)
.with(hash_including(key: "daily/#{backup_filename}"))
.with(hash_including(key: "daily/#{backup_filename}", public: false))
.and_return(true)
Dir.chdir(Gitlab.config.backup.path) do
subject.upload
end
end
end
context 'with Google provider' do
before do
stub_backup_setting(
upload: {
connection: {
provider: 'Google',
google_storage_access_key_id: 'test-access-id',
google_storage_secret_access_key: 'secret'
},
remote_directory: 'directory',
multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size,
encryption: nil,
encryption_key: nil,
storage_class: nil
}
)
connection = ::Fog::Storage.new(Gitlab.config.backup.upload.connection.symbolize_keys)
connection.directories.create(key: Gitlab.config.backup.upload.remote_directory)
end
it 'does not attempt to set ACL' do
expect_any_instance_of(Fog::Collection).to receive(:create)
.with(hash_excluding(public: false))
.and_return(true)
Dir.chdir(Gitlab.config.backup.path) do
......
......@@ -15,6 +15,7 @@ issues:
- user_agent_detail
- moved_to
- duplicated_to
- promoted_to_epic
- events
- merge_requests_closing_issues
- metrics
......
......@@ -20,6 +20,7 @@ Issue:
- due_date
- moved_to_id
- duplicated_to_id
- promoted_to_epic_id
- lock_version
- milestone_id
- weight
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册