As part of Refactor registry notifications system (&8628 - closed) we want to simplify the way event notifications are being sent. The current notifications system relies on the existing filesystem wrappers and that abstraction masks how and when the notifications are sent.
Proposal
The idea here is to make it explicit on how we add an event so that it can be sent.
In the first iteration, we will simply define and attach a "bridge" between the existing notification system and the handlers, so that we can make an explicit call to the notification system.
The bridge will hold a notifications.Sink and will be responsible for calling the Write method so that the event is sent properly.
Following this approach will ensure we use the existing sinks, so the retrying mechanism will stay in place. However, we will also need to start breaking the relationship that exists with the current type bridge struct so that notifications are not sent more than once.
Implementation
Define a QueueBridge type that can write events using a Sink
Attach the QueueBridge to the handlers.
Remove the need for type bridge struct slowly - that is - 1 MR per expected event would probably be best, depends on the amount of changes needed.
Jaime Martinezchanged title from chore(handlers): attach a notification queue to the App handlers to feat(handlers): attach a notification queue to the App handlers
changed title from chore(handlers): attach a notification queue to the App handlers to feat(handlers): attach a notification queue to the App handlers
as stated in #764 (comment 1134064502), I already started making sure the changes needed for this issue will be done in #764, so I'm working on both issues at the same time
Jaime Martinezchanged title from feat(handlers): attach a notification queue to the App handlers to feat(handlers): send notification events explicitly in the handlers
changed title from feat(handlers): attach a notification queue to the App handlers to feat(handlers): send notification events explicitly in the handlers
Jaime Martinezchanged the descriptionCompare with previous version
changed the description
Jaime Martinezchanged title from feat(handlers): send notification events explicitly in the handlers to refactor(handlers): send notification events explicitly in the handlers
changed title from feat(handlers): send notification events explicitly in the handlers to refactor(handlers): send notification events explicitly in the handlers
Version v3.60.0 contains the changes to manifest pushed and manifest deleted events. However, it took some time to make it to pre/gstg so I could not verify the changes earlier.
Manifest pushed and manifest deleted events were verified on staging! Here are the rails logs and the registry logs
Blob operations are currently ignored as well as we ignore the media type. Enabling this would create a lot more traffic to the events endpoint and it's something we are discussing with infrastructure. I'll make the changes for these, but there is no way to verify them on our environments, only locally.