Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: scripts/slave/recipe_modules/auto_bisect/bisector.py

Issue 2282563004: Do not exclude the last revision in the range returned by gitiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/auto_bisect/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/auto_bisect/bisector.py
diff --git a/scripts/slave/recipe_modules/auto_bisect/bisector.py b/scripts/slave/recipe_modules/auto_bisect/bisector.py
index 861ebbdc174bef0ecb9c06f02dd3be49413c7f1d..bb6db7f201d7c2c882e2a443b627d3cb9c805e34 100644
--- a/scripts/slave/recipe_modules/auto_bisect/bisector.py
+++ b/scripts/slave/recipe_modules/auto_bisect/bisector.py
@@ -377,23 +377,32 @@ class Bisector(object):
start=good_hash,
end=bad_hash,
depot_name=self.base_depot,
- step_name=step_name)
+ step_name=step_name,
+ exclude_end=True)
self.revisions = [self.good_rev] + revisions + [self.bad_rev]
self._update_revision_list_indexes()
def _revision_range(self, start, end, depot_name, base_revision=None,
- step_name=None):
+ step_name=None, exclude_end=False):
"""Returns a list of RevisionState objects between |start| and |end|.
+ When expanding the initial revision range we want to exclude the last
+ revision, since both good and bad have already been created and tested.
+ When bisecting into a roll on the other hand, we want to include the last
+ revision in the roll, because although the code should be equivalent to
+ the roll, we want to blame the right culprit and not the roll.
+
Args:
start (str): Start commit hash.
end (str): End commit hash.
depot_name (str): Short string name of repo, e.g. chromium or v8.
base_revision (str): Base revision in the downstream repo (e.g. chromium).
step_name (str): Optional step name.
+ exclude_end (bool): Whether to exclude the last revision in the range,
+ i.e. the revision given as end.
Returns:
- A list of RevisionState objects, not including the given start or end.
+ A list of RevisionState objects.
"""
if self.internal_bisect: # pragma: no cover
return self._revision_range_with_gitiles(
@@ -408,7 +417,10 @@ class Bisector(object):
self.surface_result('BAD_REV')
raise
revisions = []
- for commit_hash, _ in step_result.stdout:
+ revision_hashes = step_result.stdout
+ if exclude_end:
+ revision_hashes = revision_hashes[:-1]
+ for commit_hash, _ in revision_hashes:
revisions.append(self.revision_class(
bisector=self,
commit_hash=commit_hash,
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/auto_bisect/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698