@@ -57,10 +57,9 @@ async def run(self):
57
57
)
58
58
59
59
def is_coverage_task (self , task ):
60
- name = task ["task" ]["metadata" ]["name" ]
61
- return name .startswith ("build-" ) and "ccov" in name .split ("/" )[0 ].split ("-" )
60
+ return "ccov" in task ["task" ]["metadata" ]["name" ].split ("/" )[0 ].split ("-" )
62
61
63
- async def get_build_task_in_group (self , group_id ):
62
+ async def get_coverage_task_in_group (self , group_id ):
64
63
if group_id in self .triggered_groups :
65
64
logger .info (
66
65
"Received duplicated groupResolved notification" , group = group_id
@@ -118,11 +117,11 @@ async def parse(self, body):
118
117
)
119
118
return None
120
119
121
- build_task = await self .get_build_task_in_group (taskGroupId )
122
- if build_task is None :
120
+ coverage_task = await self .get_coverage_task_in_group (taskGroupId )
121
+ if coverage_task is None :
123
122
return None
124
123
125
- repository = build_task ["task" ]["payload" ]["env" ]["GECKO_HEAD_REPOSITORY" ]
124
+ repository = coverage_task ["task" ]["payload" ]["env" ]["GECKO_HEAD_REPOSITORY" ]
126
125
127
126
if repository not in [
128
127
"https://hg.mozilla.org/mozilla-central" ,
@@ -134,19 +133,16 @@ async def parse(self, body):
134
133
)
135
134
return None
136
135
136
+ revision = coverage_task ["task" ]["payload" ]["env" ]["GECKO_HEAD_REV" ]
137
+
137
138
logger .info (
138
139
"Received groupResolved notification for coverage builds" ,
139
140
repository = repository ,
140
- revision = build_task [ "task" ][ "payload" ][ "env" ][ "GECKO_HEAD_REV" ] ,
141
+ revision = revision ,
141
142
group = taskGroupId ,
142
143
)
143
144
144
- return [
145
- {
146
- "REPOSITORY" : repository ,
147
- "REVISION" : build_task ["task" ]["payload" ]["env" ]["GECKO_HEAD_REV" ],
148
- }
149
- ]
145
+ return [{"REPOSITORY" : repository , "REVISION" : revision }]
150
146
151
147
152
148
class Events (object ):
0 commit comments