Commit f96e2260 authored by machenbach's avatar machenbach Committed by Commit bot

Fix progress check in auto-roller.

Using a git range check for checking progress is wrong when
the last rolled revision and the revision candidate are on
different branches. The range A..B will always show the
commits from the merge-base of A and B until B.

Better compare the tags of the last rolled revision and the
candidate. The candidate's version must be strictly greater
than what's in chromium.

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

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

Cr-Commit-Position: refs/heads/master@{#27021}
parent ce45b00e
...@@ -56,6 +56,8 @@ class DetectLastRoll(Step): ...@@ -56,6 +56,8 @@ class DetectLastRoll(Step):
# The revision rolled last. # The revision rolled last.
self["last_roll"] = vars['v8_revision'] self["last_roll"] = vars['v8_revision']
last_version = self.GetVersionTag(self["last_roll"])
assert last_version, "The last rolled v8 revision is not tagged."
# There must be some progress between the last roll and the new candidate # There must be some progress between the last roll and the new candidate
# revision (i.e. we don't go backwards). The revisions are ordered newest # revision (i.e. we don't go backwards). The revisions are ordered newest
...@@ -63,9 +65,10 @@ class DetectLastRoll(Step): ...@@ -63,9 +65,10 @@ class DetectLastRoll(Step):
# compared to the last roll, i.e. if the newest release is a cherry-pick # compared to the last roll, i.e. if the newest release is a cherry-pick
# on a release branch. Then we look further. # on a release branch. Then we look further.
for revision in revisions: for revision in revisions:
commits = self.GitLog( version = self.GetVersionTag(revision)
format="%H", git_hash="%s..%s" % (self["last_roll"], revision)) assert version, "Internal error. All recent releases should have a tag"
if commits:
if SortingKey(last_version) < SortingKey(version):
self["roll"] = revision self["roll"] = revision
break break
else: else:
......
...@@ -1115,8 +1115,9 @@ deps = { ...@@ -1115,8 +1115,9 @@ deps = {
Cmd("git describe --tags bad_tag", ""), Cmd("git describe --tags bad_tag", ""),
Cmd("git describe --tags hash_234", "3.22.4"), Cmd("git describe --tags hash_234", "3.22.4"),
Cmd("git describe --tags hash_123", "3.22.3"), Cmd("git describe --tags hash_123", "3.22.3"),
Cmd("git log --format=%H abcd123455..hash_234", ""), Cmd("git describe --tags abcd123455", "3.22.4"),
Cmd("git log --format=%H abcd123455..hash_123", ""), Cmd("git describe --tags hash_234", "3.22.4"),
Cmd("git describe --tags hash_123", "3.22.3"),
]) ])
result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
...@@ -1137,7 +1138,8 @@ deps = { ...@@ -1137,7 +1138,8 @@ deps = {
Cmd("git describe --tags bad_tag", ""), Cmd("git describe --tags bad_tag", ""),
Cmd("git describe --tags hash_234", "3.22.4"), Cmd("git describe --tags hash_234", "3.22.4"),
Cmd("git describe --tags hash_123", "3.22.3"), Cmd("git describe --tags hash_123", "3.22.3"),
Cmd("git log --format=%H abcd123455..hash_234", "hash1\nhash2\n"), Cmd("git describe --tags abcd123455", "3.22.3.1"),
Cmd("git describe --tags hash_234", "3.22.4"),
]) ])
result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
......
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