At all times listen for incoming pull requests On the pull request creation (or when editing the pull request)
- pull request is mergeable and CI has passed.
- pull request has been reviewed by a suggested reviewer (also serves as authentication)
if a bug # is found in the commit name "link" the pull request to bugzilla
attachment states: [linked, pending, valid, pushed, complete]
- move bug into "pending" state where we process and watch events
- go back to linked state
- being listening for invalidating factors such as
- pull request sha change
- or checkin-needed removal this is best effort
- pull request close
- acquire sha1 for current pull request (we use this like a md5 check)
- run validators
- if validators pass continue to valid state
- if validators fail then run invalidation steps
- go to valid state
- check if sha matches current sha. If it is not the same run invalidation steps
- lock the push queue (we cannot run the next steps concurrently with other steps)
- if tip has changed re-run ci and verify we are still green. If the build has failed invalidate and notify of conflict (unlock).
- ? now that the push queue is locked maybe re-running the validators is a good idea... This will validate that its green AND mergable?
- cherry-pick/push (if this fails should we retry?)
- go to pushed state
- notify subscribers
- TBD: run uplifting steps
- go to complete step
- ? maybe this is simply to indicate a bug/branch/pull request operation is complete.