Make the auto-pusher recover easier.

The auto-push script is only used in an automated fashion
on bots. It doesn't need to check for a clean git
environment as it has a special workdir checkout.

If the release creation fails for whatever reason (e.g.
a master restart happens in the middle), the workdir
checkout might be left dirty. Any new attempt of the auto
pusher then bails out.

After this change it will call the create_release script
in any case which tidies up the workspace on startup.

TBR=tandrii@chromium.org
NOTRY=true
TEST=./script_test.py

Review URL: https://codereview.chromium.org/960773007

Cr-Commit-Position: refs/heads/master@{#26928}
This commit is contained in:
machenbach 2015-02-27 14:23:25 -08:00 committed by Commit bot
parent 4b830859b7
commit 002b1ddb0e
2 changed files with 2 additions and 6 deletions

View File

@ -41,8 +41,8 @@ class Preparation(Step):
MESSAGE = "Preparation."
def RunStep(self):
self.InitialEnvironmentChecks(self.default_cwd)
self.CommonPrepare()
# Fetch unfetched revisions.
self.vc.Fetch()
class FetchCandidate(Step):

View File

@ -1072,11 +1072,7 @@ TBR=g_name@chromium.org,reviewer@chromium.org"""
auto_push.AutoPush, LastReleaseBailout, AUTO_PUSH_ARGS))
def testAutoPush(self):
TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
self.Expect([
Cmd("git status -s -uno", ""),
Cmd("git status -s -b -uno", "## some_branch\n"),
Cmd("git fetch", ""),
Cmd("git fetch origin +refs/heads/roll:refs/heads/roll", ""),
Cmd("git show-ref -s refs/heads/roll", "abc123\n"),