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
e87d58b5
Commit
e87d58b5
authored
Mar 02, 2021
by
Laura Montemayor
Committed by
lauraMon
Mar 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update descriptions and correct variable
parent
c6c58538
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/graphql/resolvers/project_pipeline_resolver.rb
app/graphql/resolvers/project_pipeline_resolver.rb
+5
-5
changelogs/unreleased/lm-add-short-sha-and-path-to-pipeline.yml
...logs/unreleased/lm-add-short-sha-and-path-to-pipeline.yml
+1
-1
No files found.
app/graphql/resolvers/project_pipeline_resolver.rb
View file @
e87d58b5
...
...
@@ -8,15 +8,15 @@ module Resolvers
argument
:iid
,
GraphQL
::
ID_TYPE
,
required:
false
,
description:
'IID of the Pipeline
, e.g.
, "1".'
description:
'IID of the Pipeline
. For example
, "1".'
argument
:sha
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'SHA of the Pipeline
, e.g.
, "dyd0f15ay83993f5ab66k927w28673882x99100b".'
description:
'SHA of the Pipeline
. For example
, "dyd0f15ay83993f5ab66k927w28673882x99100b".'
def
ready?
(
iid:
nil
,
sha:
nil
)
unless
iid
.
present?
^
sha
.
present?
raise
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'Provide
either an iid or sha
'
raise
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'Provide
one of an IID or SHA
'
end
super
...
...
@@ -25,13 +25,13 @@ module Resolvers
def
resolve
(
iid:
nil
,
sha:
nil
)
if
iid
BatchLoader
::
GraphQL
.
for
(
iid
).
batch
(
key:
project
)
do
|
iids
,
loader
,
args
|
finder
=
::
Ci
::
PipelinesFinder
.
new
(
project
,
c
ontext
[
:current_user
]
,
iids:
iids
)
finder
=
::
Ci
::
PipelinesFinder
.
new
(
project
,
c
urrent_user
,
iids:
iids
)
finder
.
execute
.
each
{
|
pipeline
|
loader
.
call
(
pipeline
.
iid
.
to_s
,
pipeline
)
}
end
else
BatchLoader
::
GraphQL
.
for
(
sha
).
batch
(
key:
project
)
do
|
shas
,
loader
,
args
|
finder
=
::
Ci
::
PipelinesFinder
.
new
(
project
,
c
ontext
[
:current_user
],
shas:
sha
)
finder
=
::
Ci
::
PipelinesFinder
.
new
(
project
,
c
urrent_user
,
shas:
shas
)
finder
.
execute
.
each
{
|
pipeline
|
loader
.
call
(
pipeline
.
sha
.
to_s
,
pipeline
)
}
end
...
...
changelogs/unreleased/lm-add-short-sha-and-path-to-pipeline.yml
View file @
e87d58b5
---
title
:
Updates ProjectPipelineResolver to use
sha or iid
title
:
Updates ProjectPipelineResolver to use
SHA as well as IID
merge_request
:
54471
author
:
type
:
changed
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