Publish ebuild uprevs even if the build failed.
Currently we only publish ebuild uprevs if the build succeeded, the completion
stage succeeded and all changes were submitted. In the case where the
CQ submitted some but not all of the changes, or where the tree has chumped
changes, the tree can be left in an inconsistent state. In this case,
sync to a clean tree and uprev any changes that are already in the tree.
BUG=chromium:310671, chromium:309800, chromium:310945, chromium:311334
TEST=--buildbot --debug run with failing stages
Change-Id: I1cfbf5eca872d3dae0176ff891242ff3f2d876b8
Reviewed-on: https://chromium-review.googlesource.com/174543
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 2cbe2af..6bb322a 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -600,17 +600,15 @@
self.sync_stage,
was_build_successful)
self._completion_stage = completion_stage
- completion_stage.Run()
- name = completion_stage.name
- if (self.build_config['pre_cq'] or self.options.pre_cq or
- not results_lib.Results.WasStageSuccessful(name)):
- should_publish_changes = False
- else:
- should_publish_changes = (self.build_config['master'] and
- was_build_successful)
-
- if should_publish_changes:
- self._RunStage(stages.PublishUprevChangesStage)
+ completion_successful = False
+ try:
+ completion_stage.Run()
+ completion_successful = True
+ finally:
+ if not completion_successful:
+ was_build_successful = False
+ if self.build_config['push_overlays']:
+ self._RunStage(stages.PublishUprevChangesStage, was_build_successful)
def RunStages(self):
"""Runs simple builder logic and publishes information to overlays."""