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
c57f7288
Verified
Commit
c57f7288
authored
Oct 18, 2019
by
A. Wilcox
🦊
Browse files
Fix GitLab pipeline stuff
parent
99f2535e
Changes
3
Hide whitespace changes
Inline
Side-by-side
emily/core.py
View file @
c57f7288
...
...
@@ -43,6 +43,19 @@ Details are:
issue_open_event
=
Signal
((
'issue'
,
'open'
))
issue_comment_event
=
Signal
((
'issue'
,
'comment'
))
issue_close_event
=
Signal
((
'issue'
,
'close'
))
pipe_event
=
Signal
((
'source'
,
'pipeline'
))
"""A pipeline has changed status.
Caller is project name (group if available, otherwise 'default').
Details are:
* Pipeline ID #
* Source branch
* Status
* URL
"""
def
register_in
(
plugin
):
...
...
emily/inp/gitlab.py
View file @
c57f7288
...
...
@@ -56,7 +56,11 @@ class GitLab:
pipe_info
=
{}
pipe_info
[
'branch'
]
=
json
[
'object_attributes'
].
get
(
'ref'
,
'Unknown'
)
pipe_info
[
'status'
]
=
json
[
'object_attributes'
].
get
(
'status'
)
pipe_info
[
'id'
]
=
json
[
'object_attributes'
].
get
(
'id'
)
pipe_info
[
'id'
]
=
str
(
json
[
'object_attributes'
].
get
(
'id'
))
pipe_info
[
'url'
]
=
json
[
'project'
].
get
(
'web_url'
)
if
pipe_info
[
'url'
]:
pipe_info
[
'url'
]
=
pipe_info
[
'url'
]
+
'/pipelines/'
pipe_info
[
'url'
]
=
pipe_info
[
'url'
]
+
pipe_info
[
'id'
]
project
=
request
.
match_info
.
get
(
'grp'
,
'default'
)
+
'/'
+
\
request
.
match_info
.
get
(
'project'
)
...
...
emily/out/irc.py
View file @
c57f7288
...
...
@@ -6,7 +6,7 @@ from PyIRC.signal import event
from
PyIRC.util.version
import
VERSIONSTR
from
emily
import
config
from
emily.core
import
push_event
,
merge_event
from
emily.core
import
push_event
,
merge_event
,
pipe_event
class
IRCNetwork
(
IRCProtocol
):
...
...
@@ -38,7 +38,7 @@ class IRC:
def
__init__
(
self
,
loop
):
push_event
.
add
(
self
.
push
)
merge_event
.
add
(
self
.
merge
)
pipe_event
.
add
(
self
.
pipe
)
pipe_event
.
add
(
self
.
pipe
)
myconf
=
config
[
'irc'
]
self
.
networks
=
[
network
.
strip
()
...
...
@@ -135,8 +135,8 @@ class IRC:
channels
=
set
(
self
.
projects
[
project
]
+
self
.
projects
[
project
.
split
(
'/'
,
1
)[
0
]
+
'/*'
]
+
self
.
projects
[
'*/*'
])
msg
=
'
\x02
{}
\x02
: Pipeline #{} for branch
\x02
{}
\x02
status: {}'
msg
=
msg
.
format
(
project
,
pipe
[
'id'
],
pipe
[
'branch'
],
pipe
[
'status'
])
msg
=
'
\x02
{}
\x02
: Pipeline #{} for branch
\x02
{}
\x02
status:
{} -
{}'
msg
=
msg
.
format
(
project
,
pipe
[
'id'
],
pipe
[
'branch'
],
pipe
[
'status'
]
,
pipe
[
'url'
]
)
for
channel
in
channels
:
network
,
irc_chan
=
channel
.
split
(
':'
,
1
)
...
...
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