Skip to content

Add pulse listener service for build repair agent#6246

Open
evgenyrp wants to merge 4 commits into
mozilla:masterfrom
evgenyrp:hackbot_pulse_listener
Open

Add pulse listener service for build repair agent#6246
evgenyrp wants to merge 4 commits into
mozilla:masterfrom
evgenyrp:hackbot_pulse_listener

Conversation

@evgenyrp

@evgenyrp evgenyrp commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

A simple Pulse queue listener that triggers the Hackbot API Build Repair Agent

Job deduplication by revision is done in a memory cache with TTL, which should be sufficient for now if we run just one instance. A more robust deduplication will be done in #6279

Logs from testing locally (it created 4 successful build repair jobs):

 ✔ Image hackbot-pulse-listener-hackbot-pulse-listener       Built                                                                                                                                                                                                                                                                                                      4.4s
 ✔ Container hackbot-pulse-listener-hackbot-pulse-listener-1 Recreated                                                                                                                                                                                                                                                                                                  0.2s
Attaching to hackbot-pulse-listener-1
hackbot-pulse-listener-1  | INFO:__main__:Listening for build failures on exchange/taskcluster-queue/v1/task-failed; watched repos: ['autoland', 'try']
hackbot-pulse-listener-1  | INFO:kombu.mixins:Connected to amqp://build-repair-bot:**@pulse.mozilla.org:5671//
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: GET https://lando.moz.tools/api/hg2git/firefox/193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c "HTTP/1.1 200 OK"
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: POST https://hackbot-api-1016592520788.us-central1.run.app/agents/build-repair/runs "HTTP/1.1 201 Created"
hackbot-pulse-listener-1  | INFO:app.consumer:Triggered build-repair run 6f0da789-659a-4fc7-a538-1487b7921aac for autoland@193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c (git 696745f74f4494c9f0f5132198f5f6bd832ef403)
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: GET https://lando.moz.tools/api/hg2git/firefox/5fb63687f8d9f87ef085cfa1a54c9d4133750533 "HTTP/1.1 200 OK"
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: POST https://hackbot-api-1016592520788.us-central1.run.app/agents/build-repair/runs "HTTP/1.1 201 Created"
hackbot-pulse-listener-1  | INFO:app.consumer:Triggered build-repair run e4fd1ea4-5aa9-4b9f-a511-a6ba341cc9c9 for autoland@5fb63687f8d9f87ef085cfa1a54c9d4133750533 (git 97bc7e3aa0c8e08a9154cd320d033e0d176f84bb)
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: GET https://lando.moz.tools/api/hg2git/firefox/240ebcfdd513b8312a019416aab401a3be3ec82f "HTTP/1.1 200 OK"
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: POST https://hackbot-api-1016592520788.us-central1.run.app/agents/build-repair/runs "HTTP/1.1 201 Created"
hackbot-pulse-listener-1  | INFO:app.consumer:Triggered build-repair run 365379bc-00fe-4fb3-9acb-a68f247f40ba for autoland@240ebcfdd513b8312a019416aab401a3be3ec82f (git 1d4c4df03124a14c496e97f55f3aa618ebcbe49c)
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: GET https://lando.moz.tools/api/hg2git/firefox/ed978698b2622b731b9a638d4c1acec4b00c6d77 "HTTP/1.1 200 OK"
hackbot-pulse-listener-1  | INFO:httpx:HTTP Request: POST https://hackbot-api-1016592520788.us-central1.run.app/agents/build-repair/runs "HTTP/1.1 201 Created"
hackbot-pulse-listener-1  | INFO:app.consumer:Triggered build-repair run d85d67eb-cc5a-49dc-ac72-484e9ca2398d for autoland@ed978698b2622b731b9a638d4c1acec4b00c6d77 (git 2c5fe8a807f97d7cb5686f4efdd3f1d185fbe680)
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision ed978698b2622b731b9a638d4c1acec4b00c6d77 already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 5fb63687f8d9f87ef085cfa1a54c9d4133750533 already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 240ebcfdd513b8312a019416aab401a3be3ec82f already processed; skipping
hackbot-pulse-listener-1  | INFO:app.consumer:Revision 193667c8ffaa7cb05d5f0491f5c4ee1d59c8a72c already processed; skipping

evgenyrp and others added 2 commits June 30, 2026 14:13
Notification about run outcomes is out of scope for the listener (mozilla#6261);
it will live in the API or a separate service. Drop the SendGrid email
sender, the run-polling worker, the get_run API client, and the
ThreadPoolExecutor that fed them, along with their settings and deploy
config.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@evgenyrp evgenyrp changed the title [WIP] Initial implementation of pulse listener Add pulse listener service for build repair agent Jul 2, 2026
@evgenyrp evgenyrp marked this pull request as ready for review July 2, 2026 18:08
@evgenyrp evgenyrp requested a review from suhaibmujahid July 2, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant