Page MenuHomePhabricator

Prevent deployment when a sync.flag exists
ClosedPublic

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

Details

Reviewers
thcipriani
dduvall
bd808
demon
Krenair
greg
Group Reviewers
Release-Engineering-Team
Commits
rMSCAb44c2688f356: Prevent deployment when a sync.flag exists
Patch without arc
git checkout -b D36 && curl -L https://phabricator.wikimedia.org/D36?download=true | git apply
Summary

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

Repository
rMSCA Scap
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mmodell updated this revision to Diff 115.Nov 5 2015, 8:45 AM
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.
Restricted Application added a reviewer: Release-Engineering-Team. · View Herald TranscriptNov 5 2015, 8:45 AM

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 accepted this revision.Nov 5 2015, 1:34 PM
Krenair edited edge metadata.
This revision is now accepted and ready to land.Nov 5 2015, 1:34 PM
demon added a subscriber: demon.Nov 5 2015, 6:41 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.