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

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: Add culprit test. 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') | appengine/findit/crash/culprit.py » ('J')
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 4ecf9fa86f7d94f9430e18b9693edd6e1e77f550..7d9eb557183245226c1ed3db7ef72f486ac8c6dd 100644
--- a/appengine/findit/crash/changelist_classifier.py
+++ b/appengine/findit/crash/changelist_classifier.py
@@ -71,13 +71,24 @@ 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:
+ 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 +202,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') | appengine/findit/crash/culprit.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698