Do not generate database entry from the event for Anitya / New Hotness #2440
Labels
area/fedora
Related to Fedora ecosystem
area/rhel-ecosystem
RHEL & CentOS stream
complexity/single-task
Regular task, should be done within days.
gain/high
This brings a lot of value to (not strictly a lot of) users.
impact/high
This issue impacts multiple/lot of users.
kind/technical-debt
The code needs love. Refactoring.
Part of #2106
Currently we generate a database entry from the event:
packit-service/packit_service/worker/events/new_hotness.py
Lines 77 to 83 in ca15dc1
This is a problematic state, cause when we start reacting to Anitya, we can receive multiple versions (not just the latest one as for the Rawhide) from which we then choose one based on to-be implemented rules or version mask defined by the user.
Move this functionality out of the event, as the tight-coupling of
event × DB entry
doesn't make sense in this case.Be careful about the consequences of this action, i.e., database being populated by calling the
_add_*
on the events.Note
Alternative approach could be populating the tag name in DB with a dummy value that would be overwritten in the handler in later stages, instead of creating the database entry later by the handler.
The text was updated successfully, but these errors were encountered: