Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-21 00:11:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-21 00:11:31 +0300
commitcfd505b1984183857fcfeab259c5a38791205914 (patch)
tree816c1ca2c84eeb9f6faf8bf15162703b48ba918f
parent813226e2ba738fd7157e7014e1a115557a25b172 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/repository/components/table/row.vue5
-rw-r--r--doc/administration/external_pipeline_validation.md3
-rw-r--r--doc/user/project/settings/import_export.md26
-rw-r--r--generator_templates/active_record/migration/create_table_migration.rb4
-rw-r--r--lib/gitlab/ci/pipeline/chain/validate/external.rb3
-rw-r--r--spec/controllers/projects_controller_spec.rb11
-rw-r--r--spec/fixtures/api/schemas/external_validation.json3
-rw-r--r--spec/support/before_all_adapter.rb14
8 files changed, 55 insertions, 14 deletions
diff --git a/app/assets/javascripts/repository/components/table/row.vue b/app/assets/javascripts/repository/components/table/row.vue
index 009dd19b4a5..09b80a8ef8e 100644
--- a/app/assets/javascripts/repository/components/table/row.vue
+++ b/app/assets/javascripts/repository/components/table/row.vue
@@ -7,6 +7,7 @@ import {
GlLoadingIcon,
GlIcon,
GlHoverLoadDirective,
+ GlSafeHtmlDirective,
} from '@gitlab/ui';
import { escapeRegExp } from 'lodash';
import filesQuery from 'shared_queries/repository/files.query.graphql';
@@ -33,6 +34,7 @@ export default {
directives: {
GlTooltip: GlTooltipDirective,
GlHoverLoad: GlHoverLoadDirective,
+ SafeHtml: GlSafeHtmlDirective,
},
apollo: {
commit: {
@@ -178,6 +180,7 @@ export default {
this.$apollo.query({ query, variables });
},
},
+ safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] },
};
</script>
@@ -228,10 +231,10 @@ export default {
<td class="d-none d-sm-table-cell tree-commit cursor-default">
<gl-link
v-if="commit"
+ v-safe-html:[$options.safeHtmlConfig]="commit.titleHtml"
:href="commit.commitPath"
:title="commit.message"
class="str-truncated-100 tree-commit-link"
- v-html="commit.titleHtml /* eslint-disable-line vue/no-v-html */"
/>
<gl-skeleton-loading v-else :lines="1" class="h-auto" />
</td>
diff --git a/doc/administration/external_pipeline_validation.md b/doc/administration/external_pipeline_validation.md
index 738cf591210..a4ed287cc3b 100644
--- a/doc/administration/external_pipeline_validation.md
+++ b/doc/administration/external_pipeline_validation.md
@@ -76,7 +76,8 @@ required number of seconds.
"email": { "type": "string" },
"created_at": { "type": ["string", "null"], "format": "date-time" },
"current_sign_in_ip": { "type": ["string", "null"] },
- "last_sign_in_ip": { "type": ["string", "null"] }
+ "last_sign_in_ip": { "type": ["string", "null"] },
+ "sign_in_count": { "type": "integer" }
}
},
"pipeline": {
diff --git a/doc/user/project/settings/import_export.md b/doc/user/project/settings/import_export.md
index d983bcc9cf2..8d14e461e49 100644
--- a/doc/user/project/settings/import_export.md
+++ b/doc/user/project/settings/import_export.md
@@ -279,3 +279,29 @@ reduce the repository size for another import attempt.
its [default branch](../repository/branches/default.md), and
delete the temporary, `smaller-tmp-main` branch, and
the local, temporary data.
+
+### Manually execute export steps
+
+Exports sometimes fail without giving enough information to troubleshoot. In these cases, it can be
+helpful to [execute the export process manually within rails](https://gitlab.com/gitlab-com/runbooks/-/blob/master/docs/uncategorized/project-export.md#export-a-project-via-rails-console).
+Execute each line individually, rather than pasting the entire block at once, so you can see any
+errors each command returns.
+
+```shell
+u = User.find_by_username('someuser')
+p = Project.find_by_full_path('some/project')
+e = Projects::ImportExport::ExportService.new(p,u)
+
+e.send(:version_saver).send(:save)
+e.send(:avatar_saver).send(:save)
+e.send(:project_tree_saver).send(:save)
+e.send(:uploads_saver).send(:save)
+e.send(:wiki_repo_saver).send(:save)
+e.send(:lfs_saver).send(:save)
+e.send(:snippets_repo_saver).send(:save)
+e.send(:design_repo_saver).send(:save)
+
+s = Gitlab::ImportExport::Saver.new(exportable: p, shared:p.import_export_shared)
+s.send(:compress_and_save)
+s.send(:save_upload)
+```
diff --git a/generator_templates/active_record/migration/create_table_migration.rb b/generator_templates/active_record/migration/create_table_migration.rb
index 7d52336cd4c..0b0cb05249c 100644
--- a/generator_templates/active_record/migration/create_table_migration.rb
+++ b/generator_templates/active_record/migration/create_table_migration.rb
@@ -3,9 +3,7 @@
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
-class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
- include Gitlab::Database::MigrationHelpers
-
+class <%= migration_class_name %> < Gitlab::Database::Migration[<%= Gitlab::Database::Migration.current_version %>]
# When using the methods "add_concurrent_index" or "remove_concurrent_index"
# you must disable the use of transactions
# as these methods can not run in an existing transaction.
diff --git a/lib/gitlab/ci/pipeline/chain/validate/external.rb b/lib/gitlab/ci/pipeline/chain/validate/external.rb
index 27bb7fdc05a..28ba1cd4d47 100644
--- a/lib/gitlab/ci/pipeline/chain/validate/external.rb
+++ b/lib/gitlab/ci/pipeline/chain/validate/external.rb
@@ -91,7 +91,8 @@ module Gitlab
email: current_user.email,
created_at: current_user.created_at&.iso8601,
current_sign_in_ip: current_user.current_sign_in_ip,
- last_sign_in_ip: current_user.last_sign_in_ip
+ last_sign_in_ip: current_user.last_sign_in_ip,
+ sign_in_count: current_user.sign_in_count
},
pipeline: {
sha: pipeline.sha,
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index 8afb80d9cc5..a7aa0f1a1b8 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -312,6 +312,17 @@ RSpec.describe ProjectsController do
expect { get_show }.not_to change { Gitlab::GitalyClient.get_request_count }
end
+
+ it "renders files even with invalid license" do
+ controller.instance_variable_set(:@project, public_project)
+ expect(public_project.repository).to receive(:license_key).and_return('woozle wuzzle').at_least(:once)
+
+ get_show
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template('_files')
+ expect(response.body).to have_content('LICENSE') # would be 'MIT license' if stub not works
+ end
end
context "when the url contains .atom" do
diff --git a/spec/fixtures/api/schemas/external_validation.json b/spec/fixtures/api/schemas/external_validation.json
index 280b77b221a..e95909a2922 100644
--- a/spec/fixtures/api/schemas/external_validation.json
+++ b/spec/fixtures/api/schemas/external_validation.json
@@ -34,7 +34,8 @@
"email": { "type": "string" },
"created_at": { "type": ["string", "null"], "format": "date-time" },
"current_sign_in_ip": { "type": ["string", "null"] },
- "last_sign_in_ip": { "type": ["string", "null"] }
+ "last_sign_in_ip": { "type": ["string", "null"] },
+ "sign_in_count": { "type": "integer" }
}
},
"pipeline": {
diff --git a/spec/support/before_all_adapter.rb b/spec/support/before_all_adapter.rb
index f48e0f46e80..890bdd6a2c4 100644
--- a/spec/support/before_all_adapter.rb
+++ b/spec/support/before_all_adapter.rb
@@ -1,25 +1,25 @@
# frozen_string_literal: true
class BeforeAllAdapter # rubocop:disable Gitlab/NamespacedClass
- def self.all_connection_pools
- ::ActiveRecord::Base.connection_handler.all_connection_pools
+ def self.all_connection_classes
+ @all_connection_classes ||= [ActiveRecord::Base] + ActiveRecord::Base.descendants.select(&:connection_class?) # rubocop: disable Database/MultipleDatabases
end
def self.begin_transaction
- self.all_connection_pools.each do |connection_pool|
- connection_pool.connection.begin_transaction(joinable: false)
+ self.all_connection_classes.each do |connection_class|
+ connection_class.connection.begin_transaction(joinable: false)
end
end
def self.rollback_transaction
- self.all_connection_pools.each do |connection_pool|
- if connection_pool.connection.open_transactions.zero?
+ self.all_connection_classes.each do |connection_class|
+ if connection_class.connection.open_transactions.zero?
warn "!!! before_all transaction has been already rollbacked and " \
"could work incorrectly"
next
end
- connection_pool.connection.rollback_transaction
+ connection_class.connection.rollback_transaction
end
end
end