Rename ValidationFailedMessage to BuildFailureMessage

ValidationFailedMessage is no longer in validation_pool and is used by
all builders. Rename it to something more meaningful.

BUG=chromium:371004
TEST=`cbuildbot/run_tests`

Change-Id: I238185e7acd23e233276ffff67deb1fc75d50f7f
Reviewed-on: https://chromium-review.googlesource.com/202918
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
diff --git a/cbuildbot/failures_lib.py b/cbuildbot/failures_lib.py
index 94d2137..d3d5e14 100644
--- a/cbuildbot/failures_lib.py
+++ b/cbuildbot/failures_lib.py
@@ -260,12 +260,11 @@
   """Raised if a stage fails due to crash collection services."""
 
 
-# TODO(yjhong): Rename this to BuildFailureMessage.
-class ValidationFailedMessage(object):
+class BuildFailureMessage(object):
   """Message indicating that changes failed to be validated."""
 
   def __init__(self, message, tracebacks, internal, reason):
-    """Create a ValidationFailedMessage object.
+    """Create a BuildFailureMessage object.
 
     Args:
       message: The message to print.
diff --git a/cbuildbot/manifest_version.py b/cbuildbot/manifest_version.py
index 3436fa0..8fba4eb 100644
--- a/cbuildbot/manifest_version.py
+++ b/cbuildbot/manifest_version.py
@@ -320,7 +320,7 @@
     Args:
       status: Status string (should be one of STATUS_FAILED, STATUS_PASSED,
               STATUS_INFLIGHT, or STATUS_MISSING).
-      message: A failures_lib.ValidationFailedMessage object with details
+      message: A failures_lib.BuildFailureMessage object with details
                of builder failure. Or, None.
       dashboard_url: Optional url linking to builder dashboard for this build.
     """
@@ -714,7 +714,7 @@
     Args:
       version: Version number to use. Must be a string.
       status: Status string.
-      message: A failures_lib.ValidationFailedMessage object with details
+      message: A failures_lib.BuildFailureMessage object with details
                of builder failure, or None (default).
       fail_if_exists: If set, fail if the status already exists.
       dashboard_url: Optional url linking to builder dashboard for this build.
@@ -737,7 +737,7 @@
 
     Args:
       success: True for success, False for failure
-      message: A failures_lib.ValidationFailedMessage object with details
+      message: A failures_lib.BuildFailureMessage object with details
                of builder failure, or None (default).
       dashboard_url: Optional url linking to builder dashboard for this build.
     """
diff --git a/cbuildbot/manifest_version_unittest.py b/cbuildbot/manifest_version_unittest.py
index 1c6f2cf..b2495f1 100755
--- a/cbuildbot/manifest_version_unittest.py
+++ b/cbuildbot/manifest_version_unittest.py
@@ -275,7 +275,7 @@
 
   def testUnpickleBuildStatus(self):
     """Tests that _UnpickleBuildStatus returns the correct values."""
-    failed_msg = failures_lib.ValidationFailedMessage(
+    failed_msg = failures_lib.BuildFailureMessage(
         'you failed', ['traceback'], True, 'taco')
     failed_input_status = manifest_version.BuilderStatus(
         manifest_version.BuilderStatus.STATUS_FAILED, failed_msg)
diff --git a/cbuildbot/stages/completion_stages.py b/cbuildbot/stages/completion_stages.py
index a20c1f9..3ca4774 100644
--- a/cbuildbot/stages/completion_stages.py
+++ b/cbuildbot/stages/completion_stages.py
@@ -31,7 +31,7 @@
     dashboard_url: The URL of the build.
 
   Returns:
-    A failures_lib.ValidationFailedMessage object.
+    A failures_lib.BuildFailureMessage object.
   """
   internal = overlays in [constants.PRIVATE_OVERLAYS,
                           constants.BOTH_OVERLAYS]
@@ -48,7 +48,7 @@
   details.append('in %s' % dashboard_url)
   msg = '%s: %s' % (builder_name, ' '.join(details))
 
-  return failures_lib.ValidationFailedMessage(msg, tracebacks, internal,
+  return failures_lib.BuildFailureMessage(msg, tracebacks, internal,
                                               reason)
 
 
@@ -320,7 +320,7 @@
     """Submit partial pool if possible.
 
     Args:
-      messages: A list of ValidationFailedMessage or NoneType objects from
+      messages: A list of BuildFailureMessage or NoneType objects from
         the failed slaves.
 
     Returns:
@@ -372,13 +372,13 @@
       self.CQMasterHandleFailure(failing, inflight, no_stat)
 
   def _GetFailedMessages(self, failing):
-    """Gathers the ValidationFailedMessages from the |failing| builders.
+    """Gathers the BuildFailureMessages from the |failing| builders.
 
     Args:
       failing: Names of the builders that failed.
 
     Returns:
-      A list of ValidationFailedMessage or NoneType objects.
+      A list of BuildFailureMessage or NoneType objects.
     """
     return [self._slave_statuses[x].message for x in failing]
 
@@ -443,7 +443,7 @@
       failing: The names of the failing builders.
 
     Returns:
-      A list of ValidationFailedMessage objects.
+      A list of BuildFailureMessage objects.
     """
     msgs = self._GetFailedMessages(failing)
     # Filter out None messages because we cannot analyze them.
diff --git a/cbuildbot/stages/completion_stages_unittest.py b/cbuildbot/stages/completion_stages_unittest.py
index 10bb617..977315a 100755
--- a/cbuildbot/stages/completion_stages_unittest.py
+++ b/cbuildbot/stages/completion_stages_unittest.py
@@ -214,7 +214,7 @@
 
     failing = {'a'}
     inflight = {}
-    failed_msg = failures_lib.ValidationFailedMessage(
+    failed_msg = failures_lib.BuildFailureMessage(
         'message', [], True, 'reason')
     status = manifest_version.BuilderStatus('failed', failed_msg, 'url')
 
diff --git a/cbuildbot/validation_pool.py b/cbuildbot/validation_pool.py
index 44b98c7..aea8794 100644
--- a/cbuildbot/validation_pool.py
+++ b/cbuildbot/validation_pool.py
@@ -1075,7 +1075,7 @@
     Args:
         changes: A list of cros_patch.GerritPatch instances to consider.
         messages: A list of build failure messages, of type
-                  ValidationFailedMessage.
+                  BuildFailureMessage.
     """
     suspects = set()
     for message in messages:
@@ -1088,7 +1088,7 @@
 
     Args:
         messages: A list of build failure messages, of type
-                  ValidationFailedMessage or of type NoneType.
+                  BuildFailureMessage or of type NoneType.
     """
     # We consider a failed commit queue run to be flaky if only one builder
     # failed, and that failure is flaky.
@@ -1120,7 +1120,7 @@
     """Returns True if all failures are instances of |fail_type|.
 
     Args:
-      messages: A list of ValidationFailedMessage or NoneType objects
+      messages: A list of BuildFailureMessage or NoneType objects
         from the failed slaves.
       fail_type: The exception class to look for.
 
@@ -1136,7 +1136,7 @@
     """Determine if the cause of build failure was lab failure.
 
     Args:
-      messages: A list of ValidationFailedMessage or NoneType objects
+      messages: A list of BuildFailureMessage or NoneType objects
         from the failed slaves.
       no_stat: A list of builders which failed prematurely without reporting
         status.
@@ -1153,7 +1153,7 @@
     """Determine if the cause of build failure was infrastructure failure.
 
     Args:
-      messages: A list of ValidationFailedMessage or NoneType objects
+      messages: A list of BuildFailureMessage or NoneType objects
         from the failed slaves.
       no_stat: A list of builders which failed prematurely without reporting
         status.
@@ -1177,7 +1177,7 @@
     Args:
         changes: A list of cros_patch.GerritPatch instances to consider.
         messages: A list of build failure messages, of type
-          ValidationFailedMessage or of type NoneType.
+          BuildFailureMessage or of type NoneType.
         infra_fail: The build failed purely due to infrastructure failures.
         lab_fail: The build failed purely due to test lab infrastructure
           failures.
@@ -2421,7 +2421,7 @@
     Args:
       change: The change to mark as failed.
       messages: A list of build failure messages from supporting builders.
-          These must be ValidationFailedMessage objects.
+          These must be BuildFailureMessage objects.
       suspects: The list of changes that are suspected of breaking the build.
       sanity: A boolean indicating whether the build was considered sane. If
         not sane, none of the changes will have their CommitReady bit modified.
@@ -2454,7 +2454,7 @@
 
     Args:
       messages: A list of build failure messages from supporting builders.
-          These must be ValidationFailedMessage objects or NoneType objects.
+          These must be BuildFailureMessage objects or NoneType objects.
       changes: A list of cros_patch.GerritPatch instances to mark as failed.
         By default, mark all of the changes as failed.
       sanity: A boolean indicating whether the build was considered sane. If
diff --git a/cbuildbot/validation_pool_unittest.py b/cbuildbot/validation_pool_unittest.py
index 9eec51d..749982f 100755
--- a/cbuildbot/validation_pool_unittest.py
+++ b/cbuildbot/validation_pool_unittest.py
@@ -1164,13 +1164,13 @@
     return failures_lib.PackageBuildFailure(ex, 'bar', [pkg])
 
   def _GetFailedMessage(self, exceptions, stage='Build', internal=False):
-    """Returns a ValidationFailedMessage object."""
+    """Returns a BuildFailureMessage object."""
     tracebacks = []
     for ex in exceptions:
       tracebacks.append(results_lib.RecordedTraceback('Build', 'Build', ex,
                                                       str(ex)))
     reason = 'failure reason string'
-    return failures_lib.ValidationFailedMessage(
+    return failures_lib.BuildFailureMessage(
         'Stage %s failed' % stage, tracebacks, internal, reason)
 
   def _AssertSuspects(self, patches, suspects, pkgs=(), exceptions=(),
@@ -1253,7 +1253,7 @@
     self._AssertSuspects(changes, suspects, lab_fail=False, infra_fail=True)
 
   def _GetMessages(self, lab_fail=0, infra_fail=0, other_fail=0):
-    """Returns a list of ValidationFailedMessage objects."""
+    """Returns a list of BuildFailureMessage objects."""
     messages = []
     messages.extend(
         [self._GetFailedMessage([failures_lib.TestLabFailure()])