Commit d94f8a61 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'descriptive_pages_error' into 'master'

Use clearer error for pages when SHA is outdated

See merge request gitlab-org/gitlab!25659
parents d2b23120 89b19ca4
......@@ -27,7 +27,7 @@ module Projects
@status.run!
raise InvalidStateError, 'missing pages artifacts' unless build.artifacts?
raise InvalidStateError, 'pages are outdated' unless latest?
raise InvalidStateError, 'build SHA is outdated for this ref' unless latest?
# Create temporary directory in which we will extract the artifacts
make_secure_tmp_dir(tmp_path) do |archive_path|
......@@ -36,7 +36,7 @@ module Projects
# Check if we did extract public directory
archive_public_path = File.join(archive_path, PUBLIC_DIR)
raise InvalidStateError, 'pages miss the public folder' unless Dir.exist?(archive_public_path)
raise InvalidStateError, 'pages are outdated' unless latest?
raise InvalidStateError, 'build SHA is outdated for this ref' unless latest?
deploy_page!(archive_public_path)
success
......
---
title: Use clearer error message for pages deploy job when the SHA is outdated
merge_request: 25659
author:
type: other
......@@ -82,6 +82,9 @@ describe Projects::UpdatePagesService do
expect(execute).not_to eq(:success)
expect(project.pages_metadatum).not_to be_deployed
expect(deploy_status).to be_failed
expect(deploy_status.description).to eq('build SHA is outdated for this ref')
end
context 'when using empty file' do
......
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