Skip to content

Instantly share code, notes, and snippets.

@BrianHicks
Last active February 15, 2022 15:11
Show Gist options
  • Save BrianHicks/13e7be86493e696a80b67787050717e1 to your computer and use it in GitHub Desktop.
Save BrianHicks/13e7be86493e696a80b67787050717e1 to your computer and use it in GitHub Desktop.
Deployment Controller
Deployment Controller
Free
Waiting for Push Event
push event -> Building Push Events
reserve -> Reserved
Building Push Events
Building Only Item
finish build -> Waiting for Push Event
cancel build -> Waiting for Push Event
push event -> Building Item plus Register
reserve -> Has Reservation
Building Item plus Register
finish build -> Building Only Item
cancel build -> Building Only Item
# should override whatever item is enqueued
push event -> Building Item plus Register
reserve -> Has Reservation
Has Reservation
finish build -> Reserved
# would go back to building + register if that's where we were before
release reservation -> Building Only Item
Reserved
release reservation -> Free
Deployments Paused
request deploy -> Deploying Requested Commit
reservation period ended -> Should We Release Reservation?
Deploying Requested Commit
finish -> Deployments Paused
Should We Release Reservation?
Asking Reserver
send Slack message asking if it is OK to release -> Waiting for Response
Waiting for Response
reserver says it is OK -> Free
reserver adds more time -> Reserved
# we don't want reservations to continue indefinitely by default,
# so we only wait a certain amount of time before releasing
# the reservation
we pass our timeout -> Free
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment