Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
529d16eb9c
commit
54cd986c9f
|
@ -201,8 +201,9 @@ setup-test-env:
|
|||
- ${TMP_TEST_FOLDER}/gitlab-elasticsearch-indexer/bin/gitlab-elasticsearch-indexer
|
||||
- ${TMP_TEST_FOLDER}/gitlab-shell/
|
||||
- ${TMP_TEST_FOLDER}/gitlab-test-fork/
|
||||
- ${TMP_TEST_FOLDER}/gitlab-test-fork_bare/
|
||||
- ${TMP_TEST_FOLDER}/gitlab-test-fork.bundle
|
||||
- ${TMP_TEST_FOLDER}/gitlab-test/
|
||||
- ${TMP_TEST_FOLDER}/gitlab-test.bundle
|
||||
- ${TMP_TEST_FOLDER}/repositories/
|
||||
- ${TMP_TEST_FOLDER}/second_storage/
|
||||
- ${TMP_TEST_GITLAB_WORKHORSE_PATH}/
|
||||
|
|
|
@ -1 +1 @@
|
|||
0c72a4ba3de2125098d72fce52b99df3d4ad5475
|
||||
293518c0125d37fd692850f1c6865058ef7e4fb1
|
||||
|
|
|
@ -20,7 +20,6 @@ import {
|
|||
UNSCHEDULED_STATUS,
|
||||
SCHEDULED_STATUS,
|
||||
ONGOING_STATUS,
|
||||
ROOT_IMAGE_TEXT,
|
||||
ROOT_IMAGE_TOOLTIP,
|
||||
} from '../../constants/index';
|
||||
|
||||
|
@ -100,7 +99,7 @@ export default {
|
|||
return !this.imageDetails.name ? ROOT_IMAGE_TOOLTIP : '';
|
||||
},
|
||||
imageName() {
|
||||
return this.imageDetails.name || ROOT_IMAGE_TEXT;
|
||||
return this.imageDetails.name || this.imageDetails.project?.path;
|
||||
},
|
||||
formattedSize() {
|
||||
const { size } = this.imageDetails;
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
IMAGE_DELETE_SCHEDULED_STATUS,
|
||||
IMAGE_FAILED_DELETED_STATUS,
|
||||
IMAGE_MIGRATING_STATE,
|
||||
ROOT_IMAGE_TEXT,
|
||||
COPY_IMAGE_PATH_TITLE,
|
||||
} from '../../constants/index';
|
||||
import DeleteButton from '../delete_button.vue';
|
||||
|
@ -79,7 +78,7 @@ export default {
|
|||
);
|
||||
},
|
||||
imageName() {
|
||||
return this.item.name ? this.item.path : `${this.item.path}/ ${ROOT_IMAGE_TEXT}`;
|
||||
return this.item.path;
|
||||
},
|
||||
routerLinkEvent() {
|
||||
return this.deleting ? '' : 'click';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { s__, __ } from '~/locale';
|
||||
import { __ } from '~/locale';
|
||||
|
||||
export const ROOT_IMAGE_TEXT = s__('ContainerRegistry|Root image');
|
||||
export const MORE_ACTIONS_TEXT = __('More actions');
|
||||
|
||||
export const NAME_SORT_FIELD = { orderBy: 'NAME', label: __('Name') };
|
||||
|
|
|
@ -24,7 +24,6 @@ import {
|
|||
FETCH_IMAGES_LIST_ERROR_MESSAGE,
|
||||
UNFINISHED_STATUS,
|
||||
MISSING_OR_DELETED_IMAGE_BREADCRUMB,
|
||||
ROOT_IMAGE_TEXT,
|
||||
GRAPHQL_PAGE_SIZE,
|
||||
MISSING_OR_DELETED_IMAGE_TITLE,
|
||||
MISSING_OR_DELETED_IMAGE_MESSAGE,
|
||||
|
@ -111,7 +110,7 @@ export default {
|
|||
methods: {
|
||||
updateBreadcrumb() {
|
||||
const name = this.containerRepository?.id
|
||||
? this.containerRepository?.name || ROOT_IMAGE_TEXT
|
||||
? this.containerRepository?.name || this.containerRepository?.project?.path
|
||||
: MISSING_OR_DELETED_IMAGE_BREADCRUMB;
|
||||
this.breadCrumbState.updateName(name);
|
||||
},
|
||||
|
|
|
@ -37,6 +37,9 @@ Rails.application.configure do
|
|||
# Expands the lines which load the assets
|
||||
# config.assets.debug = true
|
||||
|
||||
# Annotate rendered view with template file names as HTML comments
|
||||
config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Adds additional error checking when serving assets at runtime.
|
||||
# Checks for improperly declared sprockets dependencies.
|
||||
# Raises helpful error messages.
|
||||
|
@ -66,6 +69,7 @@ Rails.application.configure do
|
|||
config.active_record.migration_error = false
|
||||
config.active_record.verbose_query_logs = false
|
||||
config.action_view.cache_template_loading = true
|
||||
config.action_view.annotate_rendered_view_with_filenames = false
|
||||
|
||||
config.middleware.delete BetterErrors::Middleware
|
||||
end
|
||||
|
|
|
@ -11,29 +11,31 @@ class Gitlab::Seeder::TriageOps
|
|||
puts "Updating settings to allow web hooks to localhost"
|
||||
ApplicationSetting.current_without_cache.update!(allow_local_requests_from_web_hooks_and_services: true)
|
||||
|
||||
Sidekiq::Testing.inline! do
|
||||
puts "Ensuring required groups"
|
||||
ensure_group('gitlab-com')
|
||||
ensure_group('gitlab-com/gl-security/appsec')
|
||||
ensure_group('gitlab-jh/jh-team')
|
||||
ensure_group('gitlab-org')
|
||||
ensure_group('gitlab-org/gitlab-core-team/community-members')
|
||||
ensure_group('gitlab-org/security')
|
||||
Sidekiq::Worker.skipping_transaction_check do
|
||||
Sidekiq::Testing.inline! do
|
||||
puts "Ensuring required groups"
|
||||
ensure_group('gitlab-com')
|
||||
ensure_group('gitlab-com/gl-security/appsec')
|
||||
ensure_group('gitlab-jh/jh-team')
|
||||
ensure_group('gitlab-org')
|
||||
ensure_group('gitlab-org/gitlab-core-team/community-members')
|
||||
ensure_group('gitlab-org/security')
|
||||
|
||||
puts "Ensuring required projects"
|
||||
ensure_project('gitlab-org/gitlab')
|
||||
ensure_project('gitlab-org/security/gitlab')
|
||||
puts "Ensuring required projects"
|
||||
ensure_project('gitlab-org/gitlab')
|
||||
ensure_project('gitlab-org/security/gitlab')
|
||||
|
||||
puts "Ensuring required bot user"
|
||||
ensure_bot_user
|
||||
puts "Ensuring required bot user"
|
||||
ensure_bot_user
|
||||
|
||||
puts "Setting up webhooks"
|
||||
ensure_webhook_for('gitlab-com')
|
||||
ensure_webhook_for('gitlab-org')
|
||||
puts "Setting up webhooks"
|
||||
ensure_webhook_for('gitlab-com')
|
||||
ensure_webhook_for('gitlab-org')
|
||||
|
||||
puts "Ensuring work type labels"
|
||||
ensure_work_type_labels_for('gitlab-com')
|
||||
ensure_work_type_labels_for('gitlab-org')
|
||||
puts "Ensuring work type labels"
|
||||
ensure_work_type_labels_for('gitlab-com')
|
||||
ensure_work_type_labels_for('gitlab-org')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,9 +7,11 @@ type: reference, howto
|
|||
|
||||
# PlantUML and GitLab **(FREE)**
|
||||
|
||||
When [PlantUML](https://plantuml.com) integration is enabled and configured in
|
||||
GitLab, you can create diagrams in snippets, wikis, and repositories. To set up
|
||||
the integration, you must:
|
||||
When the [PlantUML](https://plantuml.com) integration is enabled and configured in
|
||||
GitLab, you can create diagrams in snippets, wikis, and repositories. This integration
|
||||
is enabled on GitLab.com for all SaaS users and does not require any additional configuration.
|
||||
|
||||
To set up the integration on a self-managed instance, you must:
|
||||
|
||||
1. [Configure your PlantUML server](#configure-your-plantuml-server).
|
||||
1. [Configure local PlantUML access](#configure-local-plantuml-access).
|
||||
|
|
|
@ -4,13 +4,13 @@ module Gitlab
|
|||
module Tracking
|
||||
class << self
|
||||
def enabled?
|
||||
snowplow.enabled?
|
||||
tracker.enabled?
|
||||
end
|
||||
|
||||
def event(category, action, label: nil, property: nil, value: nil, context: [], project: nil, user: nil, namespace: nil, **extra) # rubocop:disable Metrics/ParameterLists
|
||||
contexts = [Tracking::StandardContext.new(project: project, user: user, namespace: namespace, **extra).to_context, *context]
|
||||
|
||||
snowplow.event(category, action, label: label, property: property, value: value, context: contexts)
|
||||
tracker.event(category, action, label: label, property: property, value: value, context: contexts)
|
||||
rescue StandardError => error
|
||||
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(error, snowplow_category: category, snowplow_action: action)
|
||||
end
|
||||
|
@ -31,11 +31,11 @@ module Gitlab
|
|||
end
|
||||
|
||||
def options(group)
|
||||
snowplow.options(group)
|
||||
tracker.options(group)
|
||||
end
|
||||
|
||||
def collector_hostname
|
||||
snowplow.hostname
|
||||
tracker.hostname
|
||||
end
|
||||
|
||||
def snowplow_micro_enabled?
|
||||
|
@ -44,12 +44,12 @@ module Gitlab
|
|||
|
||||
private
|
||||
|
||||
def snowplow
|
||||
@snowplow ||= if snowplow_micro_enabled?
|
||||
Gitlab::Tracking::Destinations::SnowplowMicro.new
|
||||
else
|
||||
Gitlab::Tracking::Destinations::Snowplow.new
|
||||
end
|
||||
def tracker
|
||||
@tracker ||= if snowplow_micro_enabled?
|
||||
Gitlab::Tracking::Destinations::SnowplowMicro.new
|
||||
else
|
||||
Gitlab::Tracking::Destinations::Snowplow.new
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10057,9 +10057,6 @@ msgstr ""
|
|||
msgid "ContainerRegistry|Remove these tags"
|
||||
msgstr ""
|
||||
|
||||
msgid "ContainerRegistry|Root image"
|
||||
msgstr ""
|
||||
|
||||
msgid "ContainerRegistry|Run cleanup:"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ module QA
|
|||
imported_group # trigger import
|
||||
|
||||
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
|
||||
expect(imported_projects.count).to eq(1), 'Expected to have 1 imported project'
|
||||
expect(imported_projects.count).to eq(1), "Expected to have 1 imported project. Found: #{imported_projects.count}"
|
||||
end
|
||||
|
||||
before do
|
||||
|
|
|
@ -328,9 +328,10 @@ FactoryBot.define do
|
|||
|
||||
trait :test_repo do
|
||||
after :create do |project|
|
||||
TestEnv.copy_repo(project,
|
||||
bare_repo: TestEnv.factory_repo_path_bare,
|
||||
refs: TestEnv::BRANCH_SHA)
|
||||
# There are various tests that rely on there being no repository cache.
|
||||
# Using raw avoids caching.
|
||||
repo = Gitlab::GlRepository::PROJECT.repository_for(project).raw
|
||||
repo.create_from_bundle(TestEnv.factory_repo_bundle_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -428,9 +429,10 @@ FactoryBot.define do
|
|||
path { 'forked-gitlabhq' }
|
||||
|
||||
after :create do |project|
|
||||
TestEnv.copy_repo(project,
|
||||
bare_repo: TestEnv.forked_repo_path_bare,
|
||||
refs: TestEnv::FORKED_BRANCH_SHA)
|
||||
# There are various tests that rely on there being no repository cache.
|
||||
# Using raw avoids caching.
|
||||
repo = Gitlab::GlRepository::PROJECT.repository_for(project).raw
|
||||
repo.create_from_bundle(TestEnv.forked_repo_bundle_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ FactoryBot.define do
|
|||
file_name { generate(:filename) }
|
||||
secret { false }
|
||||
|
||||
transient do
|
||||
repository_storage { 'default' }
|
||||
end
|
||||
|
||||
trait :public do
|
||||
visibility_level { Snippet::PUBLIC }
|
||||
end
|
||||
|
@ -23,12 +27,13 @@ FactoryBot.define do
|
|||
|
||||
# Test repository - https://gitlab.com/gitlab-org/gitlab-test
|
||||
trait :repository do
|
||||
after :create do |snippet|
|
||||
TestEnv.copy_repo(snippet,
|
||||
bare_repo: TestEnv.factory_repo_path_bare,
|
||||
refs: TestEnv::BRANCH_SHA)
|
||||
after :create do |snippet, evaluator|
|
||||
snippet.track_snippet_repository(evaluator.repository_storage)
|
||||
|
||||
snippet.track_snippet_repository(snippet.repository.storage)
|
||||
# There are various tests that rely on there being no repository cache.
|
||||
# Using raw avoids caching.
|
||||
repo = Gitlab::GlRepository::SNIPPET.repository_for(snippet).raw
|
||||
repo.create_from_bundle(TestEnv.factory_repo_bundle_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -233,6 +233,8 @@ RSpec.describe 'Branches' do
|
|||
end
|
||||
|
||||
context 'with one or more pipeline', :js do
|
||||
let(:project) { create(:project, :public, :empty_repo) }
|
||||
|
||||
before do
|
||||
sha = create_file(branch_name: "branch")
|
||||
create(:ci_pipeline,
|
||||
|
|
|
@ -181,17 +181,17 @@ RSpec.describe BranchesFinder do
|
|||
it 'filters branches' do
|
||||
result = subject
|
||||
|
||||
expect(result.map(&:name)).to eq(%w(feature_conflict fix))
|
||||
expect(result.map(&:name)).to eq(%w(feature_conflict few-commits))
|
||||
end
|
||||
end
|
||||
|
||||
context 'by next page_token and per_page' do
|
||||
let(:params) { { page_token: 'fix', per_page: 2 } }
|
||||
let(:params) { { page_token: 'few-commits', per_page: 2 } }
|
||||
|
||||
it 'filters branches' do
|
||||
result = subject
|
||||
|
||||
expect(result.map(&:name)).to eq(%w(flatten-dir gitattributes))
|
||||
expect(result.map(&:name)).to eq(%w(fix flatten-dir))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -254,7 +254,7 @@ RSpec.describe BranchesFinder do
|
|||
it 'falls back to default execute and ignore paginations' do
|
||||
result = subject
|
||||
|
||||
expect(result.map(&:name)).to eq(%w(feature feature_conflict fix flatten-dir))
|
||||
expect(result.map(&:name)).to eq(%w(feature feature_conflict few-commits fix flatten-dir))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"id": { "type": ["string", "null"] },
|
||||
"short_id": { "type": ["string", "null"] },
|
||||
"title": { "type": "string" },
|
||||
"created_at": { "type": "string", "format": "date-time" },
|
||||
"created_at": { "type": "string" },
|
||||
"parent_ids": {
|
||||
"type": ["array", "null"],
|
||||
"items": {
|
||||
|
@ -30,10 +30,10 @@
|
|||
"message": { "type": "string" },
|
||||
"author_name": { "type": "string" },
|
||||
"author_email": { "type": "string" },
|
||||
"authored_date": { "type": "string", "format": "date-time" },
|
||||
"authored_date": { "type": "string" },
|
||||
"committer_name": { "type": "string" },
|
||||
"committer_email": { "type": "string" },
|
||||
"committed_date": { "type": "string", "format": "date-time" },
|
||||
"committed_date": { "type": "string" },
|
||||
"web_url": { "type": "string" }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import {
|
|||
CLEANUP_SCHEDULED_TOOLTIP,
|
||||
CLEANUP_ONGOING_TOOLTIP,
|
||||
CLEANUP_UNFINISHED_TOOLTIP,
|
||||
ROOT_IMAGE_TEXT,
|
||||
ROOT_IMAGE_TOOLTIP,
|
||||
} from '~/packages_and_registries/container_registry/explorer/constants';
|
||||
import getContainerRepositoryMetadata from '~/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_metadata.query.graphql';
|
||||
|
@ -35,6 +34,7 @@ describe('Details Header', () => {
|
|||
canDelete: true,
|
||||
project: {
|
||||
visibility: 'public',
|
||||
path: 'path',
|
||||
containerExpirationPolicy: {
|
||||
enabled: false,
|
||||
},
|
||||
|
@ -98,8 +98,8 @@ describe('Details Header', () => {
|
|||
return waitForPromises();
|
||||
});
|
||||
|
||||
it('root image ', () => {
|
||||
expect(findTitle().text()).toBe(ROOT_IMAGE_TEXT);
|
||||
it('root image shows project path name', () => {
|
||||
expect(findTitle().text()).toBe('path');
|
||||
});
|
||||
|
||||
it('has an icon', () => {
|
||||
|
|
|
@ -12,7 +12,6 @@ import {
|
|||
IMAGE_DELETE_SCHEDULED_STATUS,
|
||||
IMAGE_MIGRATING_STATE,
|
||||
SCHEDULED_STATUS,
|
||||
ROOT_IMAGE_TEXT,
|
||||
COPY_IMAGE_PATH_TITLE,
|
||||
} from '~/packages_and_registries/container_registry/explorer/constants';
|
||||
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
|
||||
|
@ -96,10 +95,10 @@ describe('Image List Row', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it(`when the image has no name appends ${ROOT_IMAGE_TEXT} to the path`, () => {
|
||||
it(`when the image has no name lists the path`, () => {
|
||||
mountComponent({ item: { ...item, name: '' } });
|
||||
|
||||
expect(findDetailsLink().text()).toBe(`${item.path}/ ${ROOT_IMAGE_TEXT}`);
|
||||
expect(findDetailsLink().text()).toBe(item.path);
|
||||
});
|
||||
|
||||
it('contains a clipboard button', () => {
|
||||
|
|
|
@ -20,7 +20,6 @@ import {
|
|||
ALERT_DANGER_IMAGE,
|
||||
ALERT_DANGER_IMPORTING,
|
||||
MISSING_OR_DELETED_IMAGE_BREADCRUMB,
|
||||
ROOT_IMAGE_TEXT,
|
||||
MISSING_OR_DELETED_IMAGE_TITLE,
|
||||
MISSING_OR_DELETED_IMAGE_MESSAGE,
|
||||
} from '~/packages_and_registries/container_registry/explorer/constants';
|
||||
|
@ -482,7 +481,7 @@ describe('Details Page', () => {
|
|||
expect(breadCrumbState.updateName).toHaveBeenCalledWith(MISSING_OR_DELETED_IMAGE_BREADCRUMB);
|
||||
});
|
||||
|
||||
it(`when the image has no name set the breadcrumb to ${ROOT_IMAGE_TEXT}`, async () => {
|
||||
it(`when the image has no name set the breadcrumb to project name`, async () => {
|
||||
mountComponent({
|
||||
resolver: jest
|
||||
.fn()
|
||||
|
@ -491,7 +490,7 @@ describe('Details Page', () => {
|
|||
|
||||
await waitForApolloRequestRender();
|
||||
|
||||
expect(breadCrumbState.updateName).toHaveBeenCalledWith(ROOT_IMAGE_TEXT);
|
||||
expect(breadCrumbState.updateName).toHaveBeenCalledWith('gitlab-test');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -47,10 +47,7 @@ RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migrat
|
|||
before do
|
||||
allow(snippet_with_repo).to receive(:disk_path).and_return(disk_path(snippet_with_repo))
|
||||
|
||||
TestEnv.copy_repo(snippet_with_repo,
|
||||
bare_repo: TestEnv.factory_repo_path_bare,
|
||||
refs: TestEnv::BRANCH_SHA)
|
||||
|
||||
raw_repository(snippet_with_repo).create_from_bundle(TestEnv.factory_repo_bundle_path)
|
||||
raw_repository(snippet_with_empty_repo).create_repository
|
||||
end
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ RSpec.describe Gitlab::Tracking do
|
|||
stub_application_setting(snowplow_cookie_domain: '.gitfoo.com')
|
||||
stub_application_setting(snowplow_app_id: '_abc123_')
|
||||
|
||||
described_class.instance_variable_set("@snowplow", nil)
|
||||
described_class.instance_variable_set("@tracker", nil)
|
||||
end
|
||||
|
||||
after do
|
||||
described_class.instance_variable_set("@snowplow", nil)
|
||||
described_class.instance_variable_set("@tracker", nil)
|
||||
end
|
||||
|
||||
describe '.options' do
|
||||
|
|
|
@ -581,8 +581,7 @@ RSpec.describe Suggestions::ApplyService do
|
|||
let(:project) { create(:project, :public, :repository) }
|
||||
|
||||
let(:forked_project) do
|
||||
fork_project_with_submodules(project,
|
||||
user, repository: project.repository)
|
||||
fork_project_with_submodules(project, user)
|
||||
end
|
||||
|
||||
let(:merge_request) do
|
||||
|
|
|
@ -70,12 +70,9 @@ module ProjectForksHelper
|
|||
def fork_project_with_submodules(project, user = nil, params = {})
|
||||
Gitlab::GitalyClient.allow_n_plus_1_calls do
|
||||
forked_project = fork_project_direct(project, user, params)
|
||||
TestEnv.copy_repo(
|
||||
forked_project,
|
||||
bare_repo: TestEnv.forked_repo_path_bare,
|
||||
refs: TestEnv::FORKED_BRANCH_SHA
|
||||
)
|
||||
forked_project.repository.expire_content_cache
|
||||
repo = Gitlab::GlRepository::PROJECT.repository_for(forked_project)
|
||||
repo.create_from_bundle(TestEnv.forked_repo_bundle_path)
|
||||
repo.expire_content_cache
|
||||
|
||||
forked_project
|
||||
end
|
||||
|
|
|
@ -82,7 +82,13 @@ module TestEnv
|
|||
'trailers' => 'f0a5ed6',
|
||||
'add_commit_with_5mb_subject' => '8cf8e80',
|
||||
'blame-on-renamed' => '32c33da',
|
||||
'with-executables' => '6b8dc4a'
|
||||
'with-executables' => '6b8dc4a',
|
||||
'spooky-stuff' => 'ba3343b',
|
||||
'few-commits' => '0031876',
|
||||
'two-commits' => '304d257',
|
||||
'utf-16' => 'f05a987',
|
||||
'gitaly-rename-test' => '94bb47c',
|
||||
'smime-signed-commits' => 'ed775cc'
|
||||
}.freeze
|
||||
|
||||
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
|
||||
|
@ -259,43 +265,35 @@ module TestEnv
|
|||
|
||||
# Create repository for FactoryBot.create(:project)
|
||||
def setup_factory_repo
|
||||
setup_repo(factory_repo_path, factory_repo_path_bare, factory_repo_name, BRANCH_SHA)
|
||||
setup_repo(factory_repo_path, factory_repo_bundle_path, factory_repo_name, BRANCH_SHA)
|
||||
end
|
||||
|
||||
# Create repository for FactoryBot.create(:forked_project_with_submodules)
|
||||
# This repo has a submodule commit that is not present in the main test
|
||||
# repository.
|
||||
def setup_forked_repo
|
||||
setup_repo(forked_repo_path, forked_repo_path_bare, forked_repo_name, FORKED_BRANCH_SHA)
|
||||
setup_repo(forked_repo_path, forked_repo_bundle_path, forked_repo_name, FORKED_BRANCH_SHA)
|
||||
end
|
||||
|
||||
def setup_repo(repo_path, repo_path_bare, repo_name, refs)
|
||||
def setup_repo(repo_path, repo_bundle_path, repo_name, refs)
|
||||
clone_url = "https://gitlab.com/gitlab-org/#{repo_name}.git"
|
||||
|
||||
unless File.directory?(repo_path)
|
||||
start = Time.now
|
||||
system(*%W(#{Gitlab.config.git.bin_path} clone --quiet -- #{clone_url} #{repo_path}))
|
||||
system(*%W(#{Gitlab.config.git.bin_path} -C #{repo_path} remote remove origin))
|
||||
puts "==> #{repo_path} set up in #{Time.now - start} seconds...\n"
|
||||
end
|
||||
|
||||
set_repo_refs(repo_path, refs)
|
||||
|
||||
unless File.directory?(repo_path_bare)
|
||||
unless File.file?(repo_bundle_path)
|
||||
start = Time.now
|
||||
# We must copy bare repositories because we will push to them.
|
||||
system(git_env, *%W(#{Gitlab.config.git.bin_path} clone --quiet --bare -- #{repo_path} #{repo_path_bare}))
|
||||
puts "==> #{repo_path_bare} set up in #{Time.now - start} seconds...\n"
|
||||
system(git_env, *%W(#{Gitlab.config.git.bin_path} -C #{repo_path} bundle create #{repo_bundle_path} --all))
|
||||
puts "==> #{repo_bundle_path} generated in #{Time.now - start} seconds...\n"
|
||||
end
|
||||
end
|
||||
|
||||
def copy_repo(subject, bare_repo:, refs:)
|
||||
target_repo_path = File.expand_path(repos_path + "/#{subject.disk_path}.git")
|
||||
|
||||
FileUtils.mkdir_p(target_repo_path)
|
||||
FileUtils.cp_r("#{File.expand_path(bare_repo)}/.", target_repo_path)
|
||||
FileUtils.chmod_R 0755, target_repo_path
|
||||
end
|
||||
|
||||
def rm_storage_dir(storage, dir)
|
||||
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
|
||||
target_repo_refs_path = File.join(GitalySetup.repos_path(storage), dir)
|
||||
|
@ -349,12 +347,12 @@ module TestEnv
|
|||
Capybara.current_session.visit '/'
|
||||
end
|
||||
|
||||
def factory_repo_path_bare
|
||||
"#{factory_repo_path}_bare"
|
||||
def factory_repo_bundle_path
|
||||
"#{factory_repo_path}.bundle"
|
||||
end
|
||||
|
||||
def forked_repo_path_bare
|
||||
"#{forked_repo_path}_bare"
|
||||
def forked_repo_bundle_path
|
||||
"#{forked_repo_path}.bundle"
|
||||
end
|
||||
|
||||
def with_empty_bare_repository(name = nil)
|
||||
|
@ -378,9 +376,9 @@ module TestEnv
|
|||
gitaly
|
||||
gitlab-shell
|
||||
gitlab-test
|
||||
gitlab-test_bare
|
||||
gitlab-test.bundle
|
||||
gitlab-test-fork
|
||||
gitlab-test-fork_bare
|
||||
gitlab-test-fork.bundle
|
||||
gitlab-workhorse
|
||||
gitlab_workhorse_secret
|
||||
]
|
||||
|
|
|
@ -11,6 +11,6 @@ RSpec.configure do |config|
|
|||
end
|
||||
|
||||
config.after(:each, :snowplow) do
|
||||
Gitlab::Tracking.send(:snowplow).send(:tracker).flush
|
||||
Gitlab::Tracking.send(:tracker).send(:tracker).flush
|
||||
end
|
||||
end
|
||||
|
|
|
@ -348,14 +348,16 @@ RSpec.describe 'gitlab:app namespace rake task', :delete do
|
|||
project_a = create(:project, :repository)
|
||||
project_snippet_a = create(:project_snippet, :repository, project: project_a, author: project_a.first_owner)
|
||||
project_b = create(:project, :repository, repository_storage: second_storage_name)
|
||||
project_snippet_b = create(:project_snippet, :repository, project: project_b, author: project_b.first_owner)
|
||||
project_snippet_b.snippet_repository.update!(shard: project_b.project_repository.shard)
|
||||
project_snippet_b = create(
|
||||
:project_snippet,
|
||||
:repository,
|
||||
project: project_b,
|
||||
author: project_b.first_owner,
|
||||
repository_storage: second_storage_name
|
||||
)
|
||||
create(:wiki_page, container: project_a)
|
||||
create(:design, :with_file, issue: create(:issue, project: project_a))
|
||||
|
||||
move_repository_to_secondary(project_b)
|
||||
move_repository_to_secondary(project_snippet_b)
|
||||
|
||||
expect { run_rake_task('gitlab:backup:create') }.to output.to_stdout_from_any_process
|
||||
|
||||
tar_contents, exit_status = Gitlab::Popen.popen(
|
||||
|
@ -400,14 +402,16 @@ RSpec.describe 'gitlab:app namespace rake task', :delete do
|
|||
project_a = create(:project, :repository)
|
||||
project_snippet_a = create(:project_snippet, :repository, project: project_a, author: project_a.first_owner)
|
||||
project_b = create(:project, :repository, repository_storage: second_storage_name)
|
||||
project_snippet_b = create(:project_snippet, :repository, project: project_b, author: project_b.first_owner)
|
||||
project_snippet_b.snippet_repository.update!(shard: project_b.project_repository.shard)
|
||||
project_snippet_b = create(
|
||||
:project_snippet,
|
||||
:repository,
|
||||
project: project_b,
|
||||
author: project_b.first_owner,
|
||||
repository_storage: second_storage_name
|
||||
)
|
||||
create(:wiki_page, container: project_a)
|
||||
create(:design, :with_file, issue: create(:issue, project: project_a))
|
||||
|
||||
move_repository_to_secondary(project_b)
|
||||
move_repository_to_secondary(project_snippet_b)
|
||||
|
||||
expect { run_rake_task('gitlab:backup:create') }.to output.to_stdout_from_any_process
|
||||
|
||||
tar_contents, exit_status = Gitlab::Popen.popen(
|
||||
|
@ -435,21 +439,6 @@ RSpec.describe 'gitlab:app namespace rake task', :delete do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def move_repository_to_secondary(record)
|
||||
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
|
||||
default_shard_legacy_path = Gitlab.config.repositories.storages.default.legacy_disk_path
|
||||
secondary_legacy_path = Gitlab.config.repositories.storages[second_storage_name].legacy_disk_path
|
||||
dst_dir = File.join(secondary_legacy_path, File.dirname(record.disk_path))
|
||||
|
||||
FileUtils.mkdir_p(dst_dir) unless Dir.exist?(dst_dir)
|
||||
|
||||
FileUtils.mv(
|
||||
File.join(default_shard_legacy_path, record.disk_path + '.git'),
|
||||
File.join(secondary_legacy_path, record.disk_path + '.git')
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'concurrency settings' do
|
||||
|
|
|
@ -17,11 +17,11 @@ require (
|
|||
github.com/gorilla/websocket v1.4.1
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
||||
github.com/johannesboyne/gofakes3 v0.0.0-20200510090907-02d71f533bec
|
||||
github.com/johannesboyne/gofakes3 v0.0.0-20220627085814-c3ac35da23b2
|
||||
github.com/jpillora/backoff v1.0.0
|
||||
github.com/mitchellh/copystructure v1.0.0
|
||||
github.com/prometheus/client_golang v1.12.1
|
||||
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1
|
||||
github.com/rafaeljusto/redigomock/v3 v3.1.1
|
||||
github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
github.com/smartystreets/goconvey v1.6.4
|
||||
|
|
|
@ -261,7 +261,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
|
|||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
|
||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
|
@ -505,6 +504,7 @@ github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8l
|
|||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/gomodule/redigo v1.8.8/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
|
@ -707,8 +707,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
|
|||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/johannesboyne/gofakes3 v0.0.0-20200510090907-02d71f533bec h1:jEZFmuFe51KdrceqM4NL3dJiuog0zojzcN/VculG26o=
|
||||
github.com/johannesboyne/gofakes3 v0.0.0-20200510090907-02d71f533bec/go.mod h1:fNiSoOiEI5KlkWXn26OwKnNe58ilTIkpBlgOrt7Olu8=
|
||||
github.com/johannesboyne/gofakes3 v0.0.0-20220627085814-c3ac35da23b2 h1:V5q1Mx2WTE5coXLG2QpkRZ7LsJvgkedm6Ib4AwC1Lfg=
|
||||
github.com/johannesboyne/gofakes3 v0.0.0-20220627085814-c3ac35da23b2/go.mod h1:LIAXxPvcUXwOcTIj9LSNSUpE9/eMHalTWxsP/kmWxQI=
|
||||
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
|
@ -961,8 +961,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
|
|||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
|
||||
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1 h1:+kGqA4dNN5hn7WwvKdzHl0rdN5AEkbNZd0VjRltAiZg=
|
||||
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY=
|
||||
github.com/rafaeljusto/redigomock/v3 v3.1.1 h1:SdWE9v+SPy3x6G5hS3aofIJgHJY3OdBJ0BdUTk4dYbA=
|
||||
github.com/rafaeljusto/redigomock/v3 v3.1.1/go.mod h1:F9zPqz8rMriScZkPtUiLJoLruYcpGo/XXREpeyasREM=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
|
@ -1115,6 +1115,7 @@ gitlab.com/gitlab-org/labkit v1.14.0/go.mod h1:bcxc4ZpAC+WyACgyKl7FcvT2XXAbl8Crz
|
|||
gitlab.com/gitlab-org/labkit v1.15.0 h1:rMdhIdONc7bcd5qGRtWav6iInpeDmavDmP9A1tai92k=
|
||||
gitlab.com/gitlab-org/labkit v1.15.0/go.mod h1:bcxc4ZpAC+WyACgyKl7FcvT2XXAbl8CrzN6UY+w8cMc=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
|
@ -1352,7 +1353,6 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h
|
|||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
"github.com/rafaeljusto/redigomock"
|
||||
"github.com/rafaeljusto/redigomock/v3"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
"github.com/rafaeljusto/redigomock"
|
||||
"github.com/rafaeljusto/redigomock/v3"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"gitlab.com/gitlab-org/gitlab/workhorse/internal/config"
|
||||
|
|
Loading…
Reference in New Issue