Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event emails should include associated task messages #5566

Closed
hjoliver opened this issue Jun 2, 2023 · 2 comments · Fixed by #5769
Closed

event emails should include associated task messages #5566

hjoliver opened this issue Jun 2, 2023 · 2 comments · Fixed by #5769
Assignees
Labels
could be better Not exactly a bug, but not ideal.
Milestone

Comments

@hjoliver
Copy link
Member

hjoliver commented Jun 2, 2023

REF: https://cylc.discourse.group/t/sending-custom-emails-from-cylc-workflow/665

[scheduling]
   [[graph]]
      R1 = "foo"
[runtime]
   [[foo]]
       script = """
          ON_THE_FLY=$(date)
          cylc message WARNING:"My birthday is ${ON_THE_FLY}."
       """
       [[[events]]]
           mail events = warning

Running this results in an email to the user, for the warning event, but it does not include the associated task message.

The only way to get custom content into the email seems to be [scheduler][mail]footer which allows templating of workflow-level variables (so not task-level %(message)s etc.

Fixing this is probably complicated by event-batching for emails.

@hjoliver hjoliver added the could be better Not exactly a bug, but not ideal. label Jun 2, 2023
@hjoliver hjoliver added this to the cylc-8.2.0 milestone Jun 2, 2023
@oliver-sanders oliver-sanders modified the milestones: cylc-8.2.0, cylc-8.2.1 Jul 11, 2023
@oliver-sanders
Copy link
Member

The message is not present in the id_key which means this missing context would need to be added. This is a right pain due to the number of functions which use this key with tuple unpacking, so would be broken by any change to its format.

I think this id_key logic should get straightened out either way, suggest using a named tuple to carry the context info and passing the Tokens object to avoid repeated ID formatting, then adding the message into the named tuple. This should be an 8.3.0 change as the risk of breakages is quite high.

@oliver-sanders oliver-sanders modified the milestones: cylc-8.2.1, cylc-8.3.0 Aug 2, 2023
@oliver-sanders oliver-sanders self-assigned this Aug 3, 2023
@oliver-sanders
Copy link
Member

Assigning myself as I've been having a poke around the id_key problem.

oliver-sanders added a commit to oliver-sanders/cylc-flow that referenced this issue Oct 12, 2023
* Closes cylc#5566
* Note, the event message is not stored in the database, so when events
  are restored from the DB on restart, the event message will default to
  the event name.
oliver-sanders added a commit to oliver-sanders/cylc-flow that referenced this issue Oct 13, 2023
* Closes cylc#5566
* Note, the event message is not stored in the database, so when events
  are restored from the DB on restart, the event message will default to
  the event name.
oliver-sanders added a commit to oliver-sanders/cylc-flow that referenced this issue Oct 16, 2023
* Closes cylc#5566
* Note, the event message is not stored in the database, so when events
  are restored from the DB on restart, the event message will default to
  the event name.
oliver-sanders added a commit to oliver-sanders/cylc-flow that referenced this issue Jan 2, 2024
* Closes cylc#5566
* Note, the event message is not stored in the database, so when events
  are restored from the DB on restart, the event message will default to
  the event name.
oliver-sanders added a commit to oliver-sanders/cylc-flow that referenced this issue Jan 3, 2024
* Closes cylc#5566
* Note, the event message is not stored in the database, so when events
  are restored from the DB on restart, the event message will default to
  the event name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could be better Not exactly a bug, but not ideal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants