Skip to content

rewrite to make beter use of non-transactional state in MRs

The state machine based implementation we were using in these webhooks was being problematic, because the current state was never guaranteed given that multiple updates could be happening in parallel. it was also quite confusing to have to figure out next state from the input data we had.

So lets simplify this...a lot. Weve:

  1. Made the code procedural rather than object based

  2. Removed the passesCI label (not needed since we can just check the ci state on every webhook instance

  3. improve how and when we update the MR so that we don't wind up changing MR state until we are completely reaady to do so at the end of webhook execution. While this doesn't completely solve our race conditions it minimizes them considerably

Acked-by: Neil Horman nhorman@redhat.com

Merge request reports

Loading