Commit e98deaaa authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg
Browse files

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 e0b28adb6bc0
......@@ -2,7 +2,7 @@
factory :project_wiki do
skip_create
project
association :project, :wiki_repo
user { project.creator }
initialize_with { new(project, user) }
end
......
......@@ -193,6 +193,13 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 "#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 @@
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 @@
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) }
......
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