Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
813226e2ba
commit
cfd505b198
8 changed files with 55 additions and 14 deletions
|
@ -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>
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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)
|
||||
```
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue