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
This commit is contained in:
@@ -62,6 +62,10 @@ final class DrydockManagementLeaseWorkflow
|
|||||||
$drydock_phid = id(new PhabricatorDrydockApplication())->getPHID();
|
$drydock_phid = id(new PhabricatorDrydockApplication())->getPHID();
|
||||||
$lease->setAuthorizingPHID($drydock_phid);
|
$lease->setAuthorizingPHID($drydock_phid);
|
||||||
|
|
||||||
|
if ($attributes) {
|
||||||
|
$lease->setAttributes($attributes);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This is not hugely scalable, although this is a debugging workflow
|
// 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?
|
// so maybe it's fine. Do we even need `bin/drydock lease` in the long run?
|
||||||
$all_blueprints = id(new DrydockBlueprintQuery())
|
$all_blueprints = id(new DrydockBlueprintQuery())
|
||||||
@@ -76,10 +80,6 @@ final class DrydockManagementLeaseWorkflow
|
|||||||
}
|
}
|
||||||
$lease->setAllowedBlueprintPHIDs($allowed_phids);
|
$lease->setAllowedBlueprintPHIDs($allowed_phids);
|
||||||
|
|
||||||
if ($attributes) {
|
|
||||||
$lease->setAttributes($attributes);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($until) {
|
if ($until) {
|
||||||
$lease->setUntil($until);
|
$lease->setUntil($until);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user