Skip to content

Move email notification from the listener to the agents - #6708

Open
evgenyrp wants to merge 5 commits into
mozilla:masterfrom
evgenyrp:email-action-6664
Open

Move email notification from the listener to the agents#6708
evgenyrp wants to merge 5 commits into
mozilla:masterfrom
evgenyrp:email-action-6664

Conversation

@evgenyrp

Copy link
Copy Markdown
Contributor
  • add a new action to runtime
  • update CI agents
  • tested them locally with sending emails and those look unchanged
  • remove now unneeded notificaitons and polling from the listener (1st step before migrating to Treeherder)

fixes #6664
fixes #6269

@evgenyrp
evgenyrp requested a review from a team as a code owner August 24, 2026 22:18
Comment thread docs/hackbot/actions.md
Comment on lines +58 to +62
model-facing tool, since who receives mail is the agent code's decision. Its recipient
policy is apply-side — `NOTIFICATION_TEAM_EMAIL` is copied on every email and used as
`Reply-To`, and `NOTIFICATION_OVERRIDE_EMAIL` redirects everything to one address so a
development deployment cannot mail real developers. Sending needs `SENDGRID_API_KEY` and
`NOTIFICATION_SENDER` on hackbot-api.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is agent-specific details, not helpful here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not find these changes necessary

Comment on lines +106 to +110
try:
response = sendgrid.SendGridAPIClient(api_key=api_key).send(message=message)
except Exception as exc:
log.exception("Failed to email run %s to %s", ctx.run_id, recipients)
return ActionResult.failed(str(exc))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be coughed up by applier anyway:

try:
return await handler.apply(params, ctx)
except Exception as exc:
log.exception(
"Handler for %s raised while applying run %s", action_type, run.run_id
)
return ActionResult.failed(str(exc))

diff before the run ends (a notification quoting it). ``add --intent-to-add``
only touches the index, so the working tree and any later collect are unaffected.
"""
_git(repo, "add", "--all", "--intent-to-add")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary?

Comment on lines +157 to +160
def source_base(self) -> str | None:
"""The commit the agent started editing from, or None if not recorded."""
return self._source_base

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of exposing this, we could use pending_patch() from within the HackbotContext.

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.

Migrate email notification from the pulse listener to a runtime action Add support for email notifications

2 participants