Skip to content

Commit 13d616a

Browse files
dependabot-preview[bot]La0
authored andcommitted
build(deps): Bump libmozevent from 1.0.5 to 1.0.11 in /events (#314)
* build(deps): Bump libmozevent from 1.0.5 to 1.0.11 in /events Bumps [libmozevent](https://github.com/mozilla/libmozdata) from 1.0.5 to 1.0.11. - [Release notes](https://github.com/mozilla/libmozdata/releases) - [Commits](https://github.com/mozilla/libmozdata/commits) Signed-off-by: dependabot-preview[bot] <[email protected]> * events: Upgrade libmozevent usage * Fix unit tests
1 parent 2cd8240 commit 13d616a

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# -*- coding: utf-8 -*-
22

3+
from taskcluster.helper import TaskclusterConfig
4+
5+
taskcluster_config = TaskclusterConfig("https://firefox-ci-tc.services.mozilla.com")
6+
37
QUEUE_MONITORING = "monitoring"
48
QUEUE_PULSE = "pulse"

events/code_coverage_events/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import os
44

55
import structlog
6-
from libmozevent import taskcluster_config
76

7+
from code_coverage_events import taskcluster_config
88
from code_coverage_events.workflow import Events
99
from code_coverage_tools.log import init_logger
1010

@@ -31,7 +31,7 @@ def main():
3131
taskcluster_config.auth(args.taskcluster_client_id, args.taskcluster_access_token)
3232
taskcluster_config.load_secrets(
3333
args.taskcluster_secret,
34-
"events",
34+
prefixes=["common", "events"],
3535
required=("pulse_user", "pulse_password", "hook_id", "hook_group_id"),
3636
existing=dict(admins=["[email protected]", "[email protected]"]),
3737
)

events/code_coverage_events/workflow.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import requests
66
import structlog
7-
from libmozevent import taskcluster_config
87
from libmozevent.bus import MessageBus
98
from libmozevent.monitoring import Monitoring
109
from libmozevent.pulse import PulseListener
@@ -13,6 +12,7 @@
1312

1413
from code_coverage_events import QUEUE_MONITORING
1514
from code_coverage_events import QUEUE_PULSE
15+
from code_coverage_events import taskcluster_config
1616

1717
logger = structlog.get_logger(__name__)
1818

@@ -41,7 +41,7 @@ async def run(self):
4141
payload = await self.bus.receive(QUEUE_PULSE)
4242

4343
# Parse the payload to extract a new task's environment
44-
envs = await self.parse(payload)
44+
envs = await self.parse(payload["body"])
4545
if envs is None:
4646
continue
4747

@@ -169,15 +169,20 @@ def __init__(self):
169169

170170
# Setup monitoring for newly created tasks
171171
self.monitoring = Monitoring(
172-
QUEUE_MONITORING, taskcluster_config.secrets["admins"], 7 * 3600
172+
taskcluster_config,
173+
QUEUE_MONITORING,
174+
taskcluster_config.secrets["admins"],
175+
7 * 3600,
173176
)
174177
self.monitoring.register(self.bus)
175178

176179
# Create pulse listener for code coverage
177180
self.pulse = PulseListener(
178-
QUEUE_PULSE,
179-
"exchange/taskcluster-queue/v1/task-group-resolved",
180-
"#",
181+
{
182+
QUEUE_PULSE: [
183+
("exchange/taskcluster-queue/v1/task-group-resolved", ["#"])
184+
]
185+
},
181186
taskcluster_config.secrets["pulse_user"],
182187
taskcluster_config.secrets["pulse_password"],
183188
)

events/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
-e ../tools #egg=code-coverage-tools
2-
libmozevent==1.0.5
2+
libmozevent==1.0.11

events/tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
import pytest
77
import responses
8-
from libmozevent import taskcluster_config
8+
9+
from code_coverage_events import taskcluster_config
910

1011

1112
@pytest.fixture

0 commit comments

Comments
 (0)