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

Unified Diff: appengine/findit/model/flake/flake_analysis_request.py

Issue 2510223003: [Findit] Fixing analysis mismatch in check flake (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
Index: appengine/findit/model/flake/flake_analysis_request.py
diff --git a/appengine/findit/model/flake/flake_analysis_request.py b/appengine/findit/model/flake/flake_analysis_request.py
index d5958842772deda5086cbfc3d3596da464512636..874aec237de316bc62431af6eaddbd51ad608f2b 100644
--- a/appengine/findit/model/flake/flake_analysis_request.py
+++ b/appengine/findit/model/flake/flake_analysis_request.py
@@ -138,3 +138,30 @@ class FlakeAnalysisRequest(VersionedModel):
def on_cq(self):
"""Returns True if the flake is on Commit Queue."""
return any(step.on_cq for step in self.build_steps)
+
+ def _GetNormalizedConfigurationNames(self, master_name, builder_name):
+ for build_step in self.build_steps:
+ if ((build_step.master_name == master_name and
+ build_step.builder_name == builder_name) or
+ (build_step.wf_master_name == master_name and
+ build_step.wf_builder_name == builder_name)):
+ return build_step.wf_master_name, build_step.wf_builder_name
+ return None, None
+
+ def FindMatchingAnalysisForConfiguration(self, master_name, builder_name):
+ # Returns the analysis that corresponds to the requested master and builder.
+ normalized_master_name, normalized_builder_name = (
+ self._GetNormalizedConfigurationNames(master_name, builder_name))
+
+ if not normalized_master_name or not normalized_builder_name:
+ return None
+
+ for analysis_key in self.analyses:
+ analysis_master_name, analysis_builder_name = (
+ MasterFlakeAnalysis.GetBuildConfigurationFromKey(analysis_key))
+
+ if (analysis_master_name == normalized_master_name and
+ analysis_builder_name == normalized_builder_name):
+ return analysis_key.get()
+
+ return None
« no previous file with comments | « appengine/findit/handlers/flake/test/check_flake_test.py ('k') | appengine/findit/model/flake/master_flake_analysis.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698