Page MenuHomePhabricator

Prevent deployment when a sync.flag exists

Authored by mmodell on Nov 5 2015, 8:45 AM.


Group Reviewers
rMSCAb44c2688f356: Prevent deployment when a sync.flag exists
Patch without arc
git checkout -b D36 && curl -L | git apply

sync.flag is a persistent lock file that prevents scap from
syncing to the cluster. The sync.flag is created by a deployer
when the staging directory is in a bad state.

When a deployer is about to make modifications to the staging
directory they can create a file named sync.flag to alert other
deployers that it is not currently safe to sync to the cluster.
Scap will enforce the sync.flag by mentioning it's existence as
well as the username of the file's owner. The file must be removed
before any deployments can continue.

Test Plan

touch /srv/mediawiki-staging/sync.flag && scap

Diff Detail

rMSCA Scap
Lint Not Applicable
Tests Not Applicable

Event Timeline

mmodell retitled this revision from to Prevent deployment when a sync.flag exists.
mmodell updated this object.
mmodell edited the test plan for this revision. (Show Details)
mmodell added reviewers: bd808, Krenair, thcipriani, dduvall, greg.

My motivation for writing this is as follows:

Tonight @Krenair noticed that the 1.27.0-wmf.5 branch is in a bad state but he wasn't able to figure out the proper solution. After scratching my head for a while, I'm not sure what went wrong either, and the people who might know are not around. It would be nice to have a sync.flag feature in situations like this so that we can prevent others from accidentally syncing the mess.

Krenair edited edge metadata.
This revision is now accepted and ready to land.Nov 5 2015, 1:34 PM

So I like the idea, but I'd like to see some documentation so people are aware they can do this. Also, maybe the contents of the file could be a message appended to the error so you can at least tell someone why you've taken the action.

demon requested changes to this revision.Nov 5 2015, 6:41 PM
demon added a reviewer: demon.
This revision now requires changes to proceed.Nov 5 2015, 6:41 PM
This revision was automatically updated to reflect the committed changes.

@demon:already merged. But I did document it :)

I agree that it would be cool to show the contents of the file, I'll follow up with another diff.