From 2994753d23334f08b9a3daa5b14baaebaaba220e Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 13 Feb 2018 09:32:30 -0800 Subject: [PATCH] Don't let `bin/drydock lease --attributes` overwrite blueprints Summary: Depends on D19076. Ref T13073. Blueprints are stored as an attribute and `setAttributes()` overwrites all attributes. This is sorta junk but make it less obviously broken, at least. Test Plan: Ran `bin/drydock lease --type working-copy --attributes x=y` without instantly getting a fatal about "no blueprint PHIDs". Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13073 Differential Revision: https://secure.phabricator.com/D19077 --- .../drydock/management/DrydockManagementLeaseWorkflow.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php index 3a27fe9045..8c3f682042 100644 --- a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php @@ -62,6 +62,10 @@ final class DrydockManagementLeaseWorkflow $drydock_phid = id(new PhabricatorDrydockApplication())->getPHID(); $lease->setAuthorizingPHID($drydock_phid); + if ($attributes) { + $lease->setAttributes($attributes); + } + // TODO: This is not hugely scalable, although this is a debugging workflow // so maybe it's fine. Do we even need `bin/drydock lease` in the long run? $all_blueprints = id(new DrydockBlueprintQuery()) @@ -76,10 +80,6 @@ final class DrydockManagementLeaseWorkflow } $lease->setAllowedBlueprintPHIDs($allowed_phids); - if ($attributes) { - $lease->setAttributes($attributes); - } - if ($until) { $lease->setUntil($until); }