Skip to content

Commit

Permalink
Append advisory name to message id
Browse files Browse the repository at this point in the history
Before b76bd0a, freshmaker appends the advisory name to message id when
event is triggered by advisory shipped message, it's still useful for
us to know whether an event was triggered by E2E testing advisories
(which type is RHBA) without opening Errata tool, so adding it back.
  • Loading branch information
qixiang committed Sep 20, 2023
1 parent 964ff56 commit a549cda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions freshmaker/parsers/errata/state_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def parse(self, topic, msg):
# advisory has been changed to a different state other than the one
# in message, so we override advisory state with the state in message
advisory.state = new_state
# Append advisory name to message id, this makes it easier to check which
# type of advisory triggered the event without opening Errata tool.
msg_id = f"{msg_id}.{str(advisory.name)}"

# If advisory created by BOTAS and it's shipped,
# then return BotasErrataShippedEvent event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_event_from_state_change_message(self):
}
event = self.consumer.get_abstracted_msg(msg)
self.assertIsInstance(event, FlatpakModuleAdvisoryReadyEvent)
self.assertEqual("fake-msg-id", event.msg_id)
self.assertEqual("fake-msg-id.RHSA-123", event.msg_id)
self.assertEqual(self.handler.can_handle(event), True)

def test_event_state_updated_when_no_auto_rebuild_images(self):
Expand Down

0 comments on commit a549cda

Please sign in to comment.