#308 Simplify the manual rebuilds by removing FreshmakerManualRebuildEvent and handler. We call the particular manual rebuild event directly now.
Merged by jkaluza. Opened by jkaluza.
jkaluza/freshmaker rebuild-with-advisory  into  master

Download 308.patch

Currently, the Manual rebuild flow looks like this:

  • User sends POST request with JSON data to Freshmaker Frontend.
  • Frontend checks that the data is valid and sends manual.rebuild UMB message with the data to backend.
  • Frontend returns the data back to client with 200 HTTP code.
  • Backend receives the data using the manual.rebuild message and generates FreshmakerManualRebuildEvent.
  • Backend handles FreshmakerManualRebuildEvent, this handler checks what should be the real work done for manual rebuild and generates another event, for example ErrataRPMsSignedEvent, which is further handled to do the real work.

Issues with current situation:

  • User sending the POST request with data has no way to find out what event is actually generated as result of that POST. He has to query the API and guess which event(s) was/were generated for his manual rebuild request.
  • Whole flow is unnecessary complex - we create FreshmakerHandlerEvent and in its handler create another Event and call its handler.

With this PR, manual rebuild looks like this:

  • User sends POST request with JSON data to Freshmaker Frontend.
  • Frontend checks that the data is valid and generates the models.Event representing the manual rebuild and stores it in the database.
  • Frontend sends data to backend using UMB with Event.msg_id, so backend can find just created event in database.
  • Frontend returns the JSON representation of models.Event back to client, including the Event.id, so client knows what event to check later.
  • Backend receives the data using the manual.rebuild message and generates the particular exact event directly. It does not generate FreshmakerManualRebuildEvent anymore, but for example ManualRebuildWithAdvisory event which is subclass of ErrataAdvisoryRPMsSignedEvent and is directly handled by right handler which does the real work to rebuild images.

Looks good for me.

Pull-Request has been merged by jkaluza

Metadata