Branch: refs/heads/master
Home: https://github.com/openSUSE/open-build-service
Commit: e8520381ea9d3451b1d25a6a01549c6b57860cff
https://github.com/openSUSE/open-build-service/commit/e8520381ea9d3451b1d25a...
Author: Saray Cabrera Padrón
Date: 2020-03-26 (Thu, 26 Mar 2020)
Changed paths:
M src/api/app/models/notification.rb
Log Message:
-----------
Add scope for notifications without notifiable
Commit: fc70acab118fcbbe2e82388a51c8fd2543e74f66
https://github.com/openSUSE/open-build-service/commit/fc70acab118fcbbe2e8238...
Author: Saray Cabrera Padrón
Date: 2020-03-26 (Thu, 26 Mar 2020)
Changed paths:
M src/api/spec/factories/notification.rb
Log Message:
-----------
Fix typo on event name RequestCreate
Commit: fa4c0889636c4cbbdc0e7708b2b18a31a8662e85
https://github.com/openSUSE/open-build-service/commit/fa4c0889636c4cbbdc0e77...
Author: Saray Cabrera Padrón
Date: 2020-04-02 (Thu, 02 Apr 2020)
Changed paths:
M src/api/app/models/bs_request.rb
M src/api/app/models/comment.rb
M src/api/app/models/package.rb
M src/api/app/models/project.rb
M src/api/app/models/review.rb
Log Message:
-----------
Refactor code related to events creation
Before, when a change in an object triggered an event creation, the method
'create_notification' was called. It calculated the set of parameters needed to
create the event (according to the type) and then created the event.
Now, the same functionality is splitted in two methods: 'event_parameters'
(public) and 'create_event' (private). This way the set of parameters is
accesible from other parts of the code.
Co-authored-by: David Kang
Co-authored-by: Eduardo Navarro
Commit: a8ae0b12cc1f734f82bef16987fd5da38866542d
https://github.com/openSUSE/open-build-service/commit/a8ae0b12cc1f734f82bef1...
Author: Saray Cabrera Padrón
Date: 2020-04-02 (Thu, 02 Apr 2020)
Changed paths:
M src/api/app/models/event/base.rb
M src/api/app/models/event/comment_event.rb
M src/api/app/models/event/request_create.rb
M src/api/app/models/event/request_statechange.rb
M src/api/app/models/event/review_wanted.rb
M src/api/app/models/event_subscription.rb
Log Message:
-----------
Get the parameters for notifications from each model
When creating a notification we use a set of parameters. Some of them
are common (event type, payload, etc.) and some others depend on the
type of event.
Before, we calculated all the possible sets of parameters in a concrete
point of the code by checking the event type. Now, we added a method
called 'parameters_for_notification' to each kind of event so we just
ask them for its set of parameters.
Co-authored-by: David Kang
Co-authored-by: Eduardo Navarro
Commit: 4e434ed3f9c8e5d7a71c94bbaef55a473b83be1f
https://github.com/openSUSE/open-build-service/commit/4e434ed3f9c8e5d7a71c94...
Author: Saray Cabrera Padrón
Date: 2020-04-06 (Mon, 06 Apr 2020)
Changed paths:
M src/api/app/jobs/send_event_emails_job.rb
A src/api/app/services/notification_creator.rb
A src/api/spec/services/notification_creator_spec.rb
Log Message:
-----------
Define NotificationCreator service
The notification creation code used to be inside the SendEventEmailsJob.
The parameters needed to create the notifications were also calculated
there (according to the type of event).
Now, the creation is isolated in the NotificationCreator service, which
keeps the code tidy and makes it accesible from other parts of the code.
The calculation of the parameters has been distributed to the
corresponding models. They all have now a method called
'parameters_for_notification' to do so.
Co-authored-by: David Kang
Co-authored-by: Eduardo Navarro
Commit: 3cd61ddc8104c9771557c7bac69947c4c0d80200
https://github.com/openSUSE/open-build-service/commit/3cd61ddc8104c9771557c7...
Author: Saray Cabrera Padrón
Date: 2020-04-08 (Wed, 08 Apr 2020)
Changed paths:
M src/api/app/models/comment.rb
M src/api/app/models/event/base.rb
M src/api/app/models/event/comment_event.rb
M src/api/app/models/review.rb
Log Message:
-----------
Track date for all the notifiable events
A few event types used to track, in its payload, the date and time when
the event was triggered. The 'when' key was used for this. From now on,
all the notifiable event types track this value.
Now, when a notification is created, its timestaps fields (create_at and
updated_at) are set to the 'when' value. This way, we ensure they have
realistic date and time according to the moment when the event happened
and not when the notification was created (what usually happens some
time later).
Commit: 003535b0c1e4c43f88f1b1c41fcf001711cbf061
https://github.com/openSUSE/open-build-service/commit/003535b0c1e4c43f88f1b1...
Author: Henne Vogelsang
Date: 2020-04-08 (Wed, 08 Apr 2020)
Changed paths:
M src/api/app/jobs/send_event_emails_job.rb
M src/api/app/models/bs_request.rb
M src/api/app/models/comment.rb
M src/api/app/models/event/base.rb
M src/api/app/models/event/comment_event.rb
M src/api/app/models/event/request_create.rb
M src/api/app/models/event/request_statechange.rb
M src/api/app/models/event/review_wanted.rb
M src/api/app/models/event_subscription.rb
M src/api/app/models/notification.rb
M src/api/app/models/package.rb
M src/api/app/models/project.rb
M src/api/app/models/review.rb
A src/api/app/services/notification_creator.rb
M src/api/spec/factories/notification.rb
A src/api/spec/services/notification_creator_spec.rb
Log Message:
-----------
Merge pull request #9307 from saraycp/data_migration_notifications
Refactor notification's creation code
Compare: https://github.com/openSUSE/open-build-service/compare/d43bca2b38a9...003535...