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
ce88f33d
Commit
ce88f33d
authored
Feb 01, 2021
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds mergedYaml to configResolver
* updates specs
parent
14fed7a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
app/graphql/resolvers/ci/config_resolver.rb
app/graphql/resolvers/ci/config_resolver.rb
+6
-2
changelogs/unreleased/lm-add-merged-yaml.yml
changelogs/unreleased/lm-add-merged-yaml.yml
+5
-0
spec/graphql/resolvers/ci/config_resolver_spec.rb
spec/graphql/resolvers/ci/config_resolver_spec.rb
+2
-1
No files found.
app/graphql/resolvers/ci/config_resolver.rb
View file @
ce88f33d
...
@@ -29,6 +29,12 @@ module Resolvers
...
@@ -29,6 +29,12 @@ module Resolvers
.
new
(
project:
project
,
current_user:
context
[
:current_user
])
.
new
(
project:
project
,
current_user:
context
[
:current_user
])
.
validate
(
content
,
dry_run:
dry_run
)
.
validate
(
content
,
dry_run:
dry_run
)
response
(
result
).
merge
(
merged_yaml:
result
.
merged_yaml
)
end
private
def
response
(
result
)
if
result
.
errors
.
empty?
if
result
.
errors
.
empty?
{
{
status: :valid
,
status: :valid
,
...
@@ -43,8 +49,6 @@ module Resolvers
...
@@ -43,8 +49,6 @@ module Resolvers
end
end
end
end
private
def
make_jobs
(
config_jobs
)
def
make_jobs
(
config_jobs
)
config_jobs
.
map
do
|
job
|
config_jobs
.
map
do
|
job
|
{
{
...
...
changelogs/unreleased/lm-add-merged-yaml.yml
0 → 100644
View file @
ce88f33d
---
title
:
'
GraphQL:
Add
mergedYaml
to
CiConfigResolver
response'
merge_request
:
53081
author
:
type
:
changed
spec/graphql/resolvers/ci/config_resolver_spec.rb
View file @
ce88f33d
...
@@ -36,7 +36,8 @@ RSpec.describe Resolvers::Ci::ConfigResolver do
...
@@ -36,7 +36,8 @@ RSpec.describe Resolvers::Ci::ConfigResolver do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci_includes.yml'
))
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci_includes.yml'
))
end
end
it
'lints the ci config file'
do
it
'lints the ci config file and returns the merged yaml file'
do
expect
(
response
[
:merged_yaml
]).
to
eq
(
content
)
expect
(
response
[
:status
]).
to
eq
(
:valid
)
expect
(
response
[
:status
]).
to
eq
(
:valid
)
expect
(
response
[
:errors
]).
to
be_empty
expect
(
response
[
:errors
]).
to
be_empty
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