From a7bf279fd517bbc914b1116563119c7a7c1a7be2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 12 Feb 2019 15:24:45 -0800 Subject: [PATCH] Don't try to publish build results to bare diffs Summary: See . If you run builds against a diff which is not attached to a revision (this is unusual) we still try to publish to the associated revision. This won't work since there is no associated revision. Since bare diffs don't really have a timeline, just publish nowhere for now. Test Plan: - Created a diff. - Did not attach it to a revision. - Created a build plan with "make http request + wait for response". - Manually ran the build plan against the bare diff. - Used `bin/phd debug task` to run the build and hit a "revision not attached" exception during publishing. - Applied patch. - Ran `bin/phd debug task`, got clean (no-op) publish. - Sent build a failure message with "harbormaster.sendmessage", got a failed build. This isn't a real workflow, but shouldn't fail. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D20156 --- .../harbormaster/DifferentialBuildableEngine.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/harbormaster/DifferentialBuildableEngine.php b/src/applications/differential/harbormaster/DifferentialBuildableEngine.php index 8554f7be25..8565c2dcad 100644 --- a/src/applications/differential/harbormaster/DifferentialBuildableEngine.php +++ b/src/applications/differential/harbormaster/DifferentialBuildableEngine.php @@ -7,7 +7,11 @@ final class DifferentialBuildableEngine $object = $this->getObject(); if ($object instanceof DifferentialDiff) { - return $object->getRevision(); + if ($object->getRevisionID()) { + return $object->getRevision(); + } else { + return null; + } } return $object;