Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
16d7106f
Commit
16d7106f
authored
Dec 23, 2020
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change failure message of missing job needs
It was not clear before, now we decided to make it self-explanatory
parent
b9037bae
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
8 deletions
+16
-8
changelogs/unreleased/23531-change-needs-failure-message.yml
changelogs/unreleased/23531-change-needs-failure-message.yml
+5
-0
lib/gitlab/ci/pipeline/seed/build.rb
lib/gitlab/ci/pipeline/seed/build.rb
+1
-1
spec/lib/gitlab/ci/lint_spec.rb
spec/lib/gitlab/ci/lint_spec.rb
+1
-1
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
+1
-1
spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb
spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb
+2
-1
spec/services/ci/create_pipeline_service/dry_run_spec.rb
spec/services/ci/create_pipeline_service/dry_run_spec.rb
+1
-1
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+5
-3
No files found.
changelogs/unreleased/23531-change-needs-failure-message.yml
0 → 100644
View file @
16d7106f
---
title
:
Change failure message of missing job needs
merge_request
:
50492
author
:
type
:
other
lib/gitlab/ci/pipeline/seed/build.rb
View file @
16d7106f
...
@@ -134,7 +134,7 @@ module Gitlab
...
@@ -134,7 +134,7 @@ module Gitlab
stage
.
seeds_names
.
include?
(
need
[
:name
])
stage
.
seeds_names
.
include?
(
need
[
:name
])
end
end
"
#{
name
}
: needs '
#{
need
[
:name
]
}
'
"
unless
result
"
'
#{
name
}
' job needs '
#{
need
[
:name
]
}
' job, but it was not added to the pipeline
"
unless
result
end
.
compact
end
.
compact
end
end
...
...
spec/lib/gitlab/ci/lint_spec.rb
View file @
16d7106f
...
@@ -247,7 +247,7 @@ RSpec.describe Gitlab::Ci::Lint do
...
@@ -247,7 +247,7 @@ RSpec.describe Gitlab::Ci::Lint do
include_context
'advanced validations'
do
include_context
'advanced validations'
do
it
'runs advanced logical validations'
do
it
'runs advanced logical validations'
do
expect
(
subject
).
not_to
be_valid
expect
(
subject
).
not_to
be_valid
expect
(
subject
.
errors
).
to
eq
([
"
test: needs 'build'
"
])
expect
(
subject
.
errors
).
to
eq
([
"
'test' job needs 'build' job, but it was not added to the pipeline
"
])
end
end
end
end
...
...
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
View file @
16d7106f
...
@@ -966,7 +966,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
...
@@ -966,7 +966,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
it
"returns an error"
do
it
"returns an error"
do
expect
(
subject
.
errors
).
to
contain_exactly
(
expect
(
subject
.
errors
).
to
contain_exactly
(
"
rspec: needs 'build'
"
)
"
'rspec' job needs 'build' job, but it was not added to the pipeline
"
)
end
end
end
end
...
...
spec/lib/gitlab/ci/pipeline/seed/pipeline_spec.rb
View file @
16d7106f
...
@@ -62,7 +62,8 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Pipeline do
...
@@ -62,7 +62,8 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Pipeline do
needs_attributes:
[{
name:
'non-existent'
,
artifacts:
true
}]
needs_attributes:
[{
name:
'non-existent'
,
artifacts:
true
}]
}
}
expect
(
seed
.
errors
).
to
contain_exactly
(
"invalid_job: needs 'non-existent'"
)
expect
(
seed
.
errors
).
to
contain_exactly
(
"'invalid_job' job needs 'non-existent' job, but it was not added to the pipeline"
)
end
end
end
end
end
end
...
...
spec/services/ci/create_pipeline_service/dry_run_spec.rb
View file @
16d7106f
...
@@ -108,7 +108,7 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -108,7 +108,7 @@ RSpec.describe Ci::CreatePipelineService do
it_behaves_like
'returns a non persisted pipeline'
it_behaves_like
'returns a non persisted pipeline'
it
'returns a pipeline with errors'
,
:aggregate_failures
do
it
'returns a pipeline with errors'
,
:aggregate_failures
do
error_message
=
"
test: needs 'build'
"
error_message
=
"
'test' job needs 'build' job, but it was not added to the pipeline
"
expect
(
subject
.
error_messages
.
map
(
&
:content
)).
to
eq
([
error_message
])
expect
(
subject
.
error_messages
.
map
(
&
:content
)).
to
eq
([
error_message
])
expect
(
subject
.
errors
).
not_to
be_empty
expect
(
subject
.
errors
).
not_to
be_empty
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
16d7106f
...
@@ -1705,9 +1705,11 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -1705,9 +1705,11 @@ RSpec.describe Ci::CreatePipelineService do
shared_examples
'has errors'
do
shared_examples
'has errors'
do
it
'contains the expected errors'
do
it
'contains the expected errors'
do
expect
(
pipeline
.
builds
).
to
be_empty
expect
(
pipeline
.
builds
).
to
be_empty
expect
(
pipeline
.
yaml_errors
).
to
eq
(
"test_a: needs 'build_a'"
)
expect
(
pipeline
.
error_messages
.
map
(
&
:content
)).
to
contain_exactly
(
"test_a: needs 'build_a'"
)
error_message
=
"'test_a' job needs 'build_a' job, but it was not added to the pipeline"
expect
(
pipeline
.
errors
[
:base
]).
to
contain_exactly
(
"test_a: needs 'build_a'"
)
expect
(
pipeline
.
yaml_errors
).
to
eq
(
error_message
)
expect
(
pipeline
.
error_messages
.
map
(
&
:content
)).
to
contain_exactly
(
error_message
)
expect
(
pipeline
.
errors
[
:base
]).
to
contain_exactly
(
error_message
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment