Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Zach van Rijn
Emily
Commits
a808f56d
Verified
Commit
a808f56d
authored
Oct 18, 2019
by
A. Wilcox
🦊
Browse files
GitLab: Skip pending and running pipeline statuses
parent
c57f7288
Changes
1
Hide whitespace changes
Inline
Side-by-side
emily/inp/gitlab.py
View file @
a808f56d
...
...
@@ -3,6 +3,8 @@ import asyncio
from
emily.core
import
push_event
,
merge_event
,
pipe_event
from
emily.protocols.http
import
http_handle
,
HTTPProtocol
SKIP_PIPE
=
(
'pending'
,
'running'
,)
class
GitLab
:
""" Processes information from GitLab Web Hooks. """
PROTOCOLS
=
(
HTTPProtocol
,)
...
...
@@ -53,6 +55,8 @@ class GitLab:
return
True
elif
json
[
'object_kind'
]
==
'pipeline'
:
if
json
[
'object_attributes'
].
get
(
'status'
,
'pending'
)
in
SKIP_PIPE
:
return
True
pipe_info
=
{}
pipe_info
[
'branch'
]
=
json
[
'object_attributes'
].
get
(
'ref'
,
'Unknown'
)
pipe_info
[
'status'
]
=
json
[
'object_attributes'
].
get
(
'status'
)
...
...
Write
Preview
Supports
Markdown
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