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.
Currently, the Manual rebuild flow looks like this:
datato Freshmaker Frontend.datais valid and sendsmanual.rebuildUMB message with thedatato backend.databack to client with 200 HTTP code.datausing themanual.rebuildmessage and generatesFreshmakerManualRebuildEvent.FreshmakerManualRebuildEvent, this handler checks what should be the real work done for manual rebuild and generates another event, for exampleErrataRPMsSignedEvent, which is further handled to do the real work.Issues with current situation:
datahas 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.With this PR, manual rebuild looks like this:
datato Freshmaker Frontend.datais valid and generates themodels.Eventrepresenting the manual rebuild and stores it in the database.datato backend using UMB withEvent.msg_id, so backend can find just created event in database.models.Eventback to client, including the Event.id, so client knows what event to check later.datausing themanual.rebuildmessage and generates the particular exact event directly. It does not generateFreshmakerManualRebuildEventanymore, but for exampleManualRebuildWithAdvisoryevent which is subclass ofErrataAdvisoryRPMsSignedEventand is directly handled by right handler which does the real work to rebuild images.