Commit 002b1ddb authored by machenbach's avatar machenbach Committed by Commit bot

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}
parent 4b830859
......@@ -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):
......
......@@ -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"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment