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

Unified Diff: appengine/findit/crash/changelist_classifier.py

Issue 2449853012: [Predator] Fix bug in min_distance after refactor and add back skip added/deleted deps. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 | appengine/findit/crash/culprit.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/changelist_classifier.py
diff --git a/appengine/findit/crash/changelist_classifier.py b/appengine/findit/crash/changelist_classifier.py
index 21950cbe43de67e22b9605f9b35e14fda38b1a5b..8c58ab60599910e925451a576336ebcfc4476cbf 100644
--- a/appengine/findit/crash/changelist_classifier.py
+++ b/appengine/findit/crash/changelist_classifier.py
@@ -71,13 +71,26 @@ class ChangelistClassifier(object):
# doing redundant work creating it.
stack_deps = GetDepsInCrashStack(
report.stacktrace.crash_stack,
- chrome_dependency_fetcher.ChromeDependencyFetcher(self._repository
- ).GetDependency(report.crashed_version, report.platform))
+ chrome_dependency_fetcher.ChromeDependencyFetcher(
+ self._repository).GetDependency(report.crashed_version,
+ report.platform))
# Get dep and file to changelogs, stack_info and blame dicts.
- regression_deps_rolls = chrome_dependency_fetcher.ChromeDependencyFetcher(
+ dep_rolls = chrome_dependency_fetcher.ChromeDependencyFetcher(
self._repository).GetDependencyRollsDict(
last_good_version, first_bad_version, report.platform)
+
+ # Regression of a dep added/deleted (old_revision/new_revision is None) can
+ # not be known for sure and this case rarely happens, so just filter them
+ # out.
+ regression_deps_rolls = {}
+ for dep_path, dep_roll in dep_rolls.iteritems():
+ if not dep_roll.old_revision or not dep_roll.new_revision:
+ logging.info('Skip %s denpendency %s',
+ 'added' if dep_roll.new_revision else 'deleted', dep_path)
+ continue
+ regression_deps_rolls[dep_path] = dep_roll
+
dep_to_file_to_changelogs, ignore_cls = GetChangeLogsForFilesGroupedByDeps(
regression_deps_rolls, stack_deps, self._repository)
dep_to_file_to_stack_infos = GetStackInfosForFilesGroupedByDeps(
@@ -191,6 +204,9 @@ def GetChangeLogsForFilesGroupedByDeps(regression_deps_rolls, stack_deps,
changelogs = repository.GetChangeLogs(dep_roll.old_revision,
dep_roll.new_revision)
+ if not changelogs:
+ continue
+
for changelog in changelogs:
# When someone reverts, we need to skip both the CL doing
# the reverting as well as the CL that got reverted. If
« no previous file with comments | « no previous file | appengine/findit/crash/culprit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698