Commit 92482e01 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Bump Gitaly to 0.98.0

Hooks were run for wikis, but given the internal API wasn't responding
failures happended, as seen on:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18693
parent 965d0394
......@@ -2,7 +2,7 @@ FactoryBot.define do
factory :project_wiki do
skip_create
project
association :project, :wiki_repo
user { project.creator }
initialize_with { new(project, user) }
end
......
......@@ -193,6 +193,13 @@ FactoryBot.define do
trait :wiki_repo do
after(:create) do |project|
raise 'Failed to create wiki repository!' unless project.create_wiki
# We delete hooks so that gitlab-shell will not try to authenticate with
# an API that isn't running
project.gitlab_shell.rm_directory(
project.repository_storage,
File.join("#{project.wiki.repository.disk_path}.git", "hooks")
)
end
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Projects > Wiki > User previews markdown changes', :js do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_content) do
<<-HEREDOC
[regular link](regular)
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Wiki shortcuts', :js do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: 'Home page' }) }
before do
......
......@@ -12,7 +12,7 @@ describe "User creates wiki page" do
context "when wiki is empty" do
context "in a user namespace" do
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
it "shows validation error message" do
page.within(".wiki-form") do
......@@ -142,7 +142,7 @@ describe "User creates wiki page" do
end
context "in a group namespace", :js do
let(:project) { create(:project, namespace: create(:group, :public)) }
let(:project) { create(:project, :wiki_repo, namespace: create(:group, :public)) }
it "has `Create home` as a commit message" do
expect(page).to have_field("wiki[message]", with: "Create home")
......@@ -164,11 +164,11 @@ describe "User creates wiki page" do
context "when wiki is not empty", :js do
before do
create(:wiki_page, wiki: create(:project, namespace: user.namespace).wiki, attrs: { title: "home", content: "Home page" })
create(:wiki_page, wiki: create(:project, :wiki_repo, namespace: user.namespace).wiki, attrs: { title: "home", content: "Home page" })
end
context "in a user namespace" do
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
context "via the `new wiki page` page" do
it "creates a page with a single word" do
......@@ -261,7 +261,7 @@ describe "User creates wiki page" do
end
context "in a group namespace" do
let(:project) { create(:project, namespace: create(:group, :public)) }
let(:project) { create(:project, :wiki_repo, namespace: create(:group, :public)) }
context "via the `new wiki page` page" do
it "creates a page" do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'User deletes wiki page' do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki) }
before do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Projects > Wiki > User views Git access wiki page' do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:project) { create(:project, :wiki_repo, :public) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) }
before do
......
......@@ -14,7 +14,7 @@ describe 'User updates wiki page' do
end
context 'in a user namespace' do
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
it 'redirects back to the home edit page' do
page.within(:css, '.wiki-form .form-actions') do
......@@ -66,7 +66,7 @@ describe 'User updates wiki page' do
end
context 'in a user namespace' do
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
it 'updates a page' do
click_link('Edit')
......@@ -134,7 +134,7 @@ describe 'User updates wiki page' do
end
context 'in a group namespace' do
let(:project) { create(:project, namespace: create(:group, :public)) }
let(:project) { create(:project, :wiki_repo, namespace: create(:group, :public)) }
it 'updates a page' do
click_link('Edit')
......@@ -154,7 +154,7 @@ describe 'User updates wiki page' do
end
context 'when the page is in a subdir' do
let!(:project) { create(:project, namespace: user.namespace) }
let!(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:project_wiki) { create(:project_wiki, project: project, user: project.creator) }
let(:page_name) { 'page_name' }
let(:page_dir) { "foo/bar/#{page_name}" }
......
......@@ -11,6 +11,7 @@ describe 'Projects > Wiki > User views wiki in project page' do
context 'when repository is disabled for project' do
let(:project) do
create(:project,
:wiki_repo,
:repository_disabled,
:merge_requests_disabled,
:builds_disabled)
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'User views a wiki page' do
shared_examples 'wiki page user view' do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) do
create(:wiki_page,
wiki: project.wiki,
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'User searches for wiki pages', :js do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let!(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'test_wiki', content: 'Some Wiki content' }) }
before do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Backup::Repository do
let(:progress) { StringIO.new }
let!(:project) { create(:project) }
let!(:project) { create(:project, :wiki_repo) }
before do
allow(progress).to receive(:puts)
......@@ -102,7 +102,7 @@ describe Backup::Repository do
it 'invalidates the emptiness cache' do
expect(wiki.repository).to receive(:expire_emptiness_caches).once
wiki.empty?
described_class.new.send(:empty_repo?, wiki)
end
context 'wiki repo has content' do
......
require 'spec_helper'
describe Gitlab::DataBuilder::WikiPage do
let(:project) { create(:project, :repository) }
set(:project) { create(:project, :repository, :wiki_repo) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki) }
let(:user) { create(:user) }
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe Gitlab::ImportExport::WikiRepoSaver do
describe 'bundle a wiki Git repo' do
let(:user) { create(:user) }
let!(:project) { create(:project, :public, name: 'searchable_project') }
let!(:project) { create(:project, :public, :wiki_repo, name: 'searchable_project') }
let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" }
let(:shared) { project.import_export_shared }
let(:wiki_bundler) { described_class.new(project: project, shared: shared) }
......
......@@ -175,14 +175,14 @@ describe Gitlab::ProjectSearchResults do
end
describe 'wiki search' do
let(:project) { create(:project, :public) }
let(:project) { create(:project, :public, :wiki_repo) }
let(:wiki) { build(:project_wiki, project: project) }
let!(:wiki_page) { wiki.create_page('Title', 'Content') }
subject(:results) { described_class.new(user, project, 'Content').objects('wiki_blobs') }
context 'when wiki is disabled' do
let(:project) { create(:project, :public, :wiki_disabled) }
let(:project) { create(:project, :public, :wiki_repo, :wiki_disabled) }
it 'hides wiki blobs from members' do
project.add_reporter(user)
......@@ -196,7 +196,7 @@ describe Gitlab::ProjectSearchResults do
end
context 'when wiki is internal' do
let(:project) { create(:project, :public, :wiki_private) }
let(:project) { create(:project, :public, :wiki_repo, :wiki_private) }
it 'finds wiki blobs for guest' do
project.add_guest(user)
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe BlobViewer::Readme do
include FakeBlobHelpers
let(:project) { create(:project, :repository) }
let(:project) { create(:project, :repository, :wiki_repo) }
let(:blob) { fake_blob(path: 'README.md') }
subject { described_class.new(blob) }
......
......@@ -30,7 +30,7 @@ describe MicrosoftTeamsService do
describe "#execute" do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
set(:project) { create(:project, :repository, :wiki_repo) }
before do
allow(chat_service).to receive_messages(
......
require "spec_helper"
describe ProjectWiki do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
let(:repository) { project.repository }
let(:user) { project.owner }
let(:gitlab_shell) { Gitlab::Shell.new }
......@@ -328,6 +328,8 @@ describe ProjectWiki do
end
describe '#create_repo!' do
let(:project) { create(:project) }
it 'creates a repository' do
expect(raw_repository.exists?).to eq(false)
expect(subject.repository).to receive(:after_create)
......@@ -339,6 +341,8 @@ describe ProjectWiki do
end
describe '#ensure_repository' do
let(:project) { create(:project) }
it 'creates the repository if it not exist' do
expect(raw_repository.exists?).to eq(false)
......
require "spec_helper"
describe WikiPage do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
let(:user) { project.owner }
let(:wiki) { ProjectWiki.new(project, user) }
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe API::Search do
set(:user) { create(:user) }
set(:group) { create(:group) }
set(:project) { create(:project, :public, name: 'awesome project', group: group) }
set(:project) { create(:project, :wiki_repo, :public, name: 'awesome project', group: group) }
set(:repo_project) { create(:project, :public, :repository, group: group) }
shared_examples 'response is correct' do |schema:, size: 1|
......
......@@ -143,7 +143,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis" }
context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) }
let(:project) { create(:project, :wiki_repo, :wiki_disabled) }
context 'when user is guest' do
before do
......@@ -175,7 +175,7 @@ describe API::Wikis do
end
context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) }
let(:project) { create(:project, :wiki_repo, :wiki_private) }
context 'when user is guest' do
before do
......@@ -203,7 +203,7 @@ describe API::Wikis do
end
context 'when wiki is available for everyone with access' do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -236,7 +236,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" }
context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) }
let(:project) { create(:project, :wiki_repo, :wiki_disabled) }
context 'when user is guest' do
before do
......@@ -268,7 +268,7 @@ describe API::Wikis do
end
context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) }
let(:project) { create(:project, :wiki_repo, :wiki_private) }
context 'when user is guest' do
before do
......@@ -311,7 +311,7 @@ describe API::Wikis do
end
context 'when wiki is available for everyone with access' do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -360,7 +360,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis" }
context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) }
let(:project) { create(:project, :wiki_disabled, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -390,7 +390,7 @@ describe API::Wikis do
end
context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) }
let(:project) { create(:project, :wiki_private, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -418,7 +418,7 @@ describe API::Wikis do
end
context 'when wiki is available for everyone with access' do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -452,7 +452,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" }
context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) }
let(:project) { create(:project, :wiki_disabled, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -484,7 +484,7 @@ describe API::Wikis do
end
context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) }
let(:project) { create(:project, :wiki_private, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -528,7 +528,7 @@ describe API::Wikis do
end
context 'when wiki is available for everyone with access' do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -572,7 +572,7 @@ describe API::Wikis do
end
context 'when wiki belongs to a group project' do
let(:project) { create(:project, namespace: group) }
let(:project) { create(:project, :wiki_repo, namespace: group) }
before do
put(api(url, user), payload)
......@@ -587,7 +587,7 @@ describe API::Wikis do
let(:url) { "/projects/#{project.id}/wikis/#{page.slug}" }
context 'when wiki is disabled' do
let(:project) { create(:project, :wiki_disabled) }
let(:project) { create(:project, :wiki_disabled, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -619,7 +619,7 @@ describe API::Wikis do
end
context 'when wiki is available only for team members' do
let(:project) { create(:project, :wiki_private) }
let(:project) { create(:project, :wiki_private, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -651,7 +651,7 @@ describe API::Wikis do
end
context 'when wiki is available for everyone with access' do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
context 'when user is guest' do
before do
......@@ -689,7 +689,7 @@ describe API::Wikis do
end
context 'when wiki belongs to a group project' do
let(:project) { create(:project, namespace: group) }
let(:project) { create(:project, :wiki_repo, namespace: group) }
before do
delete(api(url, user))
......
......@@ -170,6 +170,7 @@ describe TestHooks::ProjectService do
end
context 'wiki_page_events' do
let(:project) { create(:project, :wiki_repo) }
let(:trigger) { 'wiki_page_events' }
let(:trigger_key) { :wiki_page_hooks }
......
require 'spec_helper'
describe WikiPages::CreateService do
let(:project) { create(:project) }
let(:project) { create(:project, :wiki_repo) }
let(:user) { create(:user) }
let(:opts) do
......
......@@ -35,7 +35,7 @@ RSpec.shared_examples 'slack or mattermost notifications' do
describe "#execute" do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:project) { create(:project, :repository, :wiki_repo) }
let(:username) { 'slack_username' }
let(:channel) { 'slack_channel' }
let(:issue_service_options) { { title: 'Awesome issue', description: 'please fix' } }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment