Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2019-11-05 18:08:34 +00:00
parent 4c464055fb
commit 2baa63e740
16 changed files with 106 additions and 47 deletions

View file

@ -81,7 +81,7 @@ export default {
<template>
<div class="info-well d-none d-sm-flex project-last-commit commit p-3">
<gl-loading-icon v-if="isLoading" size="md" class="mx-auto" />
<gl-loading-icon v-if="isLoading" size="md" class="m-auto" />
<template v-else>
<user-avatar-link
v-if="commit.author"
@ -155,3 +155,9 @@ export default {
</template>
</div>
</template>
<style scoped>
.commit {
min-height: 4.75rem;
}
</style>

View file

@ -160,12 +160,6 @@ class ProjectWiki
update_project_activity
end
def page_formatted_data(page)
page_title, page_dir = page_title_and_dir(page.title)
wiki.page_formatted_data(title: page_title, dir: page_dir, version: page.version)
end
def page_title_and_dir(title)
return unless title

View file

@ -112,11 +112,6 @@ class WikiPage
wiki.page_title_and_dir(slug)&.last.to_s
end
# The processed/formatted content of this page.
def formatted_content
@attributes[:formatted_content] ||= @wiki.page_formatted_data(@page)
end
# The markup format for the page.
def format
@attributes[:format] || :markdown

View file

@ -8,6 +8,6 @@ class JobArtifactReportEntity < Grape::Entity
expose :size
expose :download_path do |artifact|
download_project_job_artifacts_path(artifact.job.project, artifact.job, file_type: artifact.file_format)
download_project_job_artifacts_path(artifact.job.project, artifact.job, file_type: artifact.file_type)
end
end

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
class CreatePackagesConanFileMetadata < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :packages_conan_file_metadata do |t|
t.references :package_file, index: { unique: true }, null: false, foreign_key: { to_table: :packages_package_files, on_delete: :cascade }, type: :bigint
t.timestamps_with_timezone
t.string "recipe_revision", null: false, default: "0", limit: 255
t.string "package_revision", limit: 255
t.string "conan_package_reference", limit: 255
t.integer "conan_file_type", limit: 2, null: false
end
end
end

View file

@ -0,0 +1,16 @@
# frozen_string_literal: true
class CreatePackagesConanMetadata < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :packages_conan_metadata do |t|
t.references :package, index: { unique: true }, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :bigint
t.timestamps_with_timezone
t.string "package_username", null: false, limit: 255
t.string "package_channel", null: false, limit: 255
end
end
end

View file

@ -0,0 +1,39 @@
# frozen_string_literal: true
class NullifyFeatureFlagPlaintextTokens < ActiveRecord::Migration[5.2]
DOWNTIME = false
class FeatureFlagsClient < ActiveRecord::Base
include EachBatch
self.table_name = 'operations_feature_flags_clients'
scope :with_encrypted_token, -> { where.not(token_encrypted: nil) }
scope :with_plaintext_token, -> { where.not(token: nil) }
scope :without_plaintext_token, -> { where(token: nil) }
end
disable_ddl_transaction!
def up
return unless Gitlab.ee?
# 7357 records to be updated on GitLab.com
FeatureFlagsClient.with_encrypted_token.with_plaintext_token.each_batch do |relation|
relation.update_all(token: nil)
end
end
def down
return unless Gitlab.ee?
# There is no way to restore only the tokens that were NULLifyed in the `up`
# but we can do is to restore _all_ of them in case it is needed.
say_with_time('Decrypting tokens from operations_feature_flags_clients') do
FeatureFlagsClient.with_encrypted_token.without_plaintext_token.find_each do |feature_flags_client|
token = Gitlab::CryptoHelper.aes256_gcm_decrypt(feature_flags_client.token_encrypted)
feature_flags_client.update_column(:token, token)
end
end
end
end

View file

@ -2653,6 +2653,26 @@ ActiveRecord::Schema.define(version: 2019_10_29_191901) do
t.index ["project_id", "token_encrypted"], name: "index_feature_flags_clients_on_project_id_and_token_encrypted", unique: true
end
create_table "packages_conan_file_metadata", force: :cascade do |t|
t.bigint "package_file_id", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.string "recipe_revision", limit: 255, default: "0", null: false
t.string "package_revision", limit: 255
t.string "conan_package_reference", limit: 255
t.integer "conan_file_type", limit: 2, null: false
t.index ["package_file_id"], name: "index_packages_conan_file_metadata_on_package_file_id", unique: true
end
create_table "packages_conan_metadata", force: :cascade do |t|
t.bigint "package_id", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.string "package_username", limit: 255, null: false
t.string "package_channel", limit: 255, null: false
t.index ["package_id"], name: "index_packages_conan_metadata_on_package_id", unique: true
end
create_table "packages_maven_metadata", force: :cascade do |t|
t.bigint "package_id", null: false
t.datetime_with_timezone "created_at", null: false
@ -4326,6 +4346,8 @@ ActiveRecord::Schema.define(version: 2019_10_29_191901) do
add_foreign_key "operations_feature_flag_scopes", "operations_feature_flags", column: "feature_flag_id", on_delete: :cascade
add_foreign_key "operations_feature_flags", "projects", on_delete: :cascade
add_foreign_key "operations_feature_flags_clients", "projects", on_delete: :cascade
add_foreign_key "packages_conan_file_metadata", "packages_package_files", column: "package_file_id", on_delete: :cascade
add_foreign_key "packages_conan_metadata", "packages_packages", column: "package_id", on_delete: :cascade
add_foreign_key "packages_maven_metadata", "packages_packages", column: "package_id", name: "fk_be88aed360", on_delete: :cascade
add_foreign_key "packages_package_files", "packages_packages", column: "package_id", name: "fk_86f0f182f8", on_delete: :cascade
add_foreign_key "packages_package_metadata", "packages_packages", column: "package_id", on_delete: :cascade

View file

@ -715,7 +715,7 @@ For more information, see the [confidential issue](../../user/project/issues/con
```ruby
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').each {|p| p.cancel}
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').each {|p| p.cancel if p.stuck?}
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count
```

View file

@ -1,6 +1,6 @@
# GitLab Conan Repository **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/8248) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.4.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/8248) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5.
With the GitLab Conan Repository, every
project can have its own space to store Conan packages.

View file

@ -133,14 +133,6 @@ module Gitlab
GollumSlug.generate(title, format)
end
def page_formatted_data(title:, dir: nil, version: nil)
version = version&.id
wrapped_gitaly_errors do
gitaly_wiki_client.get_formatted_data(title: title, dir: dir, version: version)
end
end
private
def gitaly_wiki_client

View file

@ -179,18 +179,6 @@ module Gitlab
wiki_file
end
def get_formatted_data(title:, dir: nil, version: nil)
request = Gitaly::WikiGetFormattedDataRequest.new(
repository: @gitaly_repo,
title: encode_binary(title),
revision: encode_binary(version),
directory: encode_binary(dir)
)
response = GitalyClient.call(@repository.storage, :wiki_service, :wiki_get_formatted_data, request, timeout: GitalyClient.medium_timeout)
response.reduce([]) { |memo, msg| memo << msg.data }.join
end
private
# If a block is given and the yielded value is truthy, iteration will be

View file

@ -563,17 +563,6 @@ describe WikiPage do
end
end
describe '#formatted_content' do
it 'returns processed content of the page' do
subject.create({ title: "RDoc", content: "*bold*", format: "rdoc" })
page = wiki.find_page('RDoc')
expect(page.formatted_content).to eq("\n<p><strong>bold</strong></p>\n")
destroy_page('RDoc')
end
end
describe '#hook_attrs' do
it 'adds absolute urls for images in the content' do
create_page("test page", "test![WikiPage_Image](/uploads/abc/WikiPage_Image.png)")

View file

@ -22,7 +22,7 @@ describe JobArtifactReportEntity do
end
it 'exposes download path' do
expect(subject[:download_path]).to include("jobs/#{report.job.id}/artifacts/download")
expect(subject[:download_path]).to include("jobs/#{report.job.id}/artifacts/download?file_type=#{report.file_type}")
end
end
end

0
vendor/gitignore/C++.gitignore vendored Executable file → Normal file
View file

0
vendor/gitignore/Java.gitignore vendored Executable file → Normal file
View file