Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
50de2638aa
commit
488dae5540
12 changed files with 22 additions and 67 deletions
|
@ -1,20 +1,9 @@
|
|||
#import "./work_item.fragment.graphql"
|
||||
|
||||
subscription issuableAssignees($issuableId: IssuableID!) {
|
||||
issuableAssigneesUpdated(issuableId: $issuableId) {
|
||||
... on WorkItem {
|
||||
id
|
||||
widgets {
|
||||
... on WorkItemWidgetAssignees {
|
||||
assignees {
|
||||
nodes {
|
||||
avatarUrl
|
||||
id
|
||||
name
|
||||
username
|
||||
webUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
...WorkItem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
#import "./work_item.fragment.graphql"
|
||||
|
||||
subscription issuableDatesUpdated($issuableId: IssuableID!) {
|
||||
issuableDatesUpdated(issuableId: $issuableId) {
|
||||
... on WorkItem {
|
||||
id
|
||||
widgets {
|
||||
... on WorkItemWidgetStartAndDueDate {
|
||||
dueDate
|
||||
startDate
|
||||
}
|
||||
}
|
||||
...WorkItem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ RSpec.describe ProjectsController do
|
|||
end
|
||||
|
||||
context "project with broken repo" do
|
||||
let_it_be(:empty_project) { create(:project_broken_repo, :public) }
|
||||
let_it_be(:empty_project) { create(:project, :public) }
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
|
@ -246,8 +246,6 @@ RSpec.describe ProjectsController do
|
|||
end
|
||||
|
||||
it "renders the empty project view" do
|
||||
allow(Project).to receive(:repo).and_raise(Gitlab::Git::Repository::NoRepository)
|
||||
|
||||
expect(response).to render_template('projects/no_repo')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -332,12 +332,6 @@ FactoryBot.define do
|
|||
repository_read_only { true }
|
||||
end
|
||||
|
||||
trait :broken_repo do
|
||||
after(:create) do |project|
|
||||
TestEnv.rm_storage_dir(project.repository_storage, "#{project.disk_path}.git/refs")
|
||||
end
|
||||
end
|
||||
|
||||
trait :test_repo do
|
||||
after :create do |project|
|
||||
# There are various tests that rely on there being no repository cache.
|
||||
|
@ -455,13 +449,6 @@ FactoryBot.define do
|
|||
empty_repo
|
||||
end
|
||||
|
||||
# Project with broken repository
|
||||
#
|
||||
# Project with an invalid repository state
|
||||
factory :project_broken_repo, parent: :project do
|
||||
broken_repo
|
||||
end
|
||||
|
||||
factory :forked_project_with_submodules, parent: :project do
|
||||
path { 'forked-gitlabhq' }
|
||||
|
||||
|
|
|
@ -461,7 +461,11 @@ RSpec.describe Gitlab::Git::Repository do
|
|||
end
|
||||
|
||||
it 'raises an error if it failed' do
|
||||
expect { repository.delete_refs('refs\heads\fix') }.to raise_error(Gitlab::Git::Repository::GitError)
|
||||
# TODO: Once https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4921
|
||||
# is merged, remove the assertion for Gitlab::Git::Repository::GitError
|
||||
expect { repository.delete_refs('refs\heads\fix') }.to raise_error do |e|
|
||||
expect(e).to be_a(Gitlab::Git::Repository::GitError).or be_a(Gitlab::Git::InvalidRefFormatError)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -80,7 +80,6 @@ RSpec.describe 'factories' do
|
|||
member_task
|
||||
milestone_release
|
||||
namespace
|
||||
project_broken_repo
|
||||
project_namespace
|
||||
project_repository
|
||||
prometheus_alert
|
||||
|
|
|
@ -117,12 +117,6 @@ RSpec.describe Groups::DestroyService do
|
|||
Sidekiq::Testing.fake! { destroy_group(group, user, true) }
|
||||
end
|
||||
|
||||
after do
|
||||
# Clean up stale directories
|
||||
TestEnv.rm_storage_dir(project.repository_storage, group.path)
|
||||
TestEnv.rm_storage_dir(project.repository_storage, remove_path)
|
||||
end
|
||||
|
||||
it 'verifies original paths and projects still exist' do
|
||||
expect(TestEnv.storage_dir_exists?(project.repository_storage, group.path)).to be_truthy
|
||||
expect(TestEnv.storage_dir_exists?(project.repository_storage, remove_path)).to be_falsey
|
||||
|
|
|
@ -307,7 +307,7 @@ RSpec.describe Projects::UpdateService do
|
|||
|
||||
context 'when we update project but not enabling a wiki' do
|
||||
it 'does not try to create an empty wiki' do
|
||||
TestEnv.rm_storage_dir(project.repository_storage, project.wiki.path)
|
||||
project.wiki.repository.raw.remove
|
||||
|
||||
result = update_project(project, user, { name: 'test1' })
|
||||
|
||||
|
@ -328,7 +328,7 @@ RSpec.describe Projects::UpdateService do
|
|||
context 'when enabling a wiki' do
|
||||
it 'creates a wiki' do
|
||||
project.project_feature.update!(wiki_access_level: ProjectFeature::DISABLED)
|
||||
TestEnv.rm_storage_dir(project.repository_storage, project.wiki.path)
|
||||
project.wiki.repository.raw.remove
|
||||
|
||||
result = update_project(project, user, project_feature_attributes: { wiki_access_level: ProjectFeature::ENABLED })
|
||||
|
||||
|
|
|
@ -295,14 +295,6 @@ module TestEnv
|
|||
end
|
||||
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)
|
||||
FileUtils.remove_dir(target_repo_refs_path)
|
||||
end
|
||||
rescue Errno::ENOENT
|
||||
end
|
||||
|
||||
def storage_dir_exists?(storage, dir)
|
||||
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
|
||||
File.exist?(File.join(GitalySetup.repos_path(storage), dir))
|
||||
|
|
|
@ -166,7 +166,6 @@ RSpec.describe Tooling::Danger::Specs do
|
|||
" let(:project) { create(:project, :repository) }",
|
||||
" str = 'let(:project) { create(:project) }'",
|
||||
" let(:project) { create(:project_empty_repo) }",
|
||||
" let(:project) { create(:project_broken_repo) }",
|
||||
" let(:project) { create(:forked_project_with_submodules) }",
|
||||
" let(:project) { create(:redmine_project) }",
|
||||
" let(:project) { create(:jira_project) }",
|
||||
|
@ -185,7 +184,6 @@ RSpec.describe Tooling::Danger::Specs do
|
|||
"+ let!(:var) { create(:project) }",
|
||||
"+ let(:project) { create(:project, :repository) }",
|
||||
"+ let(:project) { create(:project_empty_repo) }",
|
||||
"+ let(:project) { create(:project_broken_repo) }",
|
||||
"+ let(:project) { create(:forked_project_with_submodules) }",
|
||||
"+ let(:project) { create(:redmine_project) }",
|
||||
"+ let(:project) { create(:jira_project) }",
|
||||
|
@ -215,12 +213,11 @@ RSpec.describe Tooling::Danger::Specs do
|
|||
{ suggested_line: " let_it_be(:var) { create(:project) }", number: 9 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:project, :repository) }", number: 15 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:project_empty_repo) }", number: 17 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:project_broken_repo) }", number: 18 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:forked_project_with_submodules) }", number: 19 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:redmine_project) }", number: 20 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:jira_project) }", number: 21 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:prometheus_project) }", number: 22 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:project_with_design) }", number: 23 }
|
||||
{ suggested_line: " let_it_be(:project) { create(:forked_project_with_submodules) }", number: 18 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:redmine_project) }", number: 19 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:jira_project) }", number: 20 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:prometheus_project) }", number: 21 },
|
||||
{ suggested_line: " let_it_be(:project) { create(:project_with_design) }", number: 22 }
|
||||
].each do |test_case|
|
||||
comment = format(template, suggested_line: test_case[:suggested_line])
|
||||
expect(specs).to receive(:markdown).with(comment, file: filename, line: test_case[:number])
|
||||
|
|
|
@ -68,7 +68,7 @@ RSpec.describe RepositoryCheck::SingleRepositoryWorker do
|
|||
|
||||
it 'creates missing wikis' do
|
||||
project = create(:project, :wiki_enabled)
|
||||
TestEnv.rm_storage_dir(project.repository_storage, project.wiki.path)
|
||||
project.wiki.repository.raw.remove
|
||||
|
||||
subject.perform(project.id)
|
||||
|
||||
|
@ -77,8 +77,8 @@ RSpec.describe RepositoryCheck::SingleRepositoryWorker do
|
|||
|
||||
it 'does not create a wiki if the main repo does not exist at all' do
|
||||
project = create(:project, :repository)
|
||||
TestEnv.rm_storage_dir(project.repository_storage, project.path)
|
||||
TestEnv.rm_storage_dir(project.repository_storage, project.wiki.path)
|
||||
project.repository.raw.remove
|
||||
project.wiki.repository.raw.remove
|
||||
|
||||
subject.perform(project.id)
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ module Tooling
|
|||
PROJECT_FACTORIES = %w[
|
||||
:project
|
||||
:project_empty_repo
|
||||
:project_broken_repo
|
||||
:forked_project_with_submodules
|
||||
:redmine_project
|
||||
:jira_project
|
||||
|
|
Loading…
Reference in a new issue