Skip to content

Instantly share code, notes, and snippets.

@lightsofapollo
Last active December 24, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightsofapollo/6805164 to your computer and use it in GitHub Desktop.
Save lightsofapollo/6805164 to your computer and use it in GitHub Desktop.

Github Bot States and Workflow

At all times listen for incoming pull requests On the pull request creation (or when editing the pull request)

Planned validators

  • pull request is mergeable and CI has passed.
  • pull request has been reviewed by a suggested reviewer (also serves as authentication)

pre-linked phase

if a bug # is found in the commit name "link" the pull request to bugzilla

Post-link phases

attachment states: [linked, pending, valid, pushed, complete]

checkin-needed event (on linked bugs/attachments)

  • move bug into "pending" state where we process and watch events

invalidation

  • go back to linked state

pending

  • 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

valid

  • 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

pushed

  • notify subscribers
  • TBD: run uplifting steps
  • go to complete step

complete

  • ? maybe this is simply to indicate a bug/branch/pull request operation is complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment