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

Unified Diff: recipe_engine/autoroll_impl/candidate_algorithm.py

Issue 2829203002: [autoroller] All commits in updates(), only roll interesting ones. (Closed)
Patch Set: windows fix Created 3 years, 8 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 | recipe_engine/autoroll_impl/commit_list.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/autoroll_impl/candidate_algorithm.py
diff --git a/recipe_engine/autoroll_impl/candidate_algorithm.py b/recipe_engine/autoroll_impl/candidate_algorithm.py
index a6aead4bf056486b503c92b1d9f64baded3008b5..847f950826cc3f7d8a54e173f6b6ed95c1b9e9fd 100644
--- a/recipe_engine/autoroll_impl/candidate_algorithm.py
+++ b/recipe_engine/autoroll_impl/candidate_algorithm.py
@@ -31,8 +31,13 @@ def get_commitlists(deps):
def find_best_rev(repos):
"""Returns the project_id of the best repo to roll.
- "Best" is determined by "moves the least amount of commits, globally". There
- are two ways that rolling a repo can move commits:
+ "Best" is determined by "is an interesting commit and moves the least amount
+ of commits, globally".
+
+ "Interesting" means "the commit modifies one or more recipe related files",
+ and is defined by CommitMetadata.roll_candidate.
+
+ There are two ways that rolling a repo can move commits:
1) As dependencies. Rolling repo A that depends on (B, C) will take
a penalty for each commit that B and C need to move in order to be
@@ -77,13 +82,12 @@ def find_best_rev(repos):
for project_id, clist in repos.iteritems():
assert isinstance(clist, CommitList)
- candidate = clist.next
+ candidate, movement_score = clist.next_roll_candidate
if not candidate:
continue
unaccounted_repos = set(repo_set)
- movement_score = 0
# first, determine if rolling this repo will force other repos to move.
for d_pid, dep in candidate.spec.deps.iteritems():
unaccounted_repos.discard(d_pid)
@@ -204,4 +208,5 @@ def get_roll_candidates(context, package_spec):
print('found %d/%d good/bad candidates in %0.2f seconds' % (
len(ret_good), len(ret_bad), time.time()-start))
+ sys.stdout.flush()
return ret_good, ret_bad, repos
« no previous file with comments | « no previous file | recipe_engine/autoroll_impl/commit_list.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698