Page MenuHomePhabricator

[harbormaster/core] Allow build variables to be optional by prefixing them with '?'
AbandonedPublic

Authored by hach-que on Jul 18 2015, 4:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 3:24 AM
Unknown Object (File)
Fri, Apr 19, 2:22 AM
Unknown Object (File)
Fri, Apr 19, 2:22 AM
Unknown Object (File)
Fri, Apr 19, 2:22 AM
Unknown Object (File)
Thu, Apr 11, 10:46 AM
Unknown Object (File)
Thu, Apr 11, 3:42 AM
Unknown Object (File)
Wed, Apr 10, 6:08 PM
Unknown Object (File)
Wed, Apr 3, 7:34 AM

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Maniphest Tasks
T1049: Implement Harbormaster
Summary

Ref T1049. When a build variable is prefixed with a question mark, it does not have to be present when the variables are merged in. If the build variable is missing or an empty string, then it is omitted from the merged result entirely (it does not even cause quotes to be added). This is important when you an optional parameter you want to pass to a command, but when the variable is empty you don't want the command to recognise an argument at all.

Test Plan

Disabled storage for unit tests and ran arc unit. I can't run unit tests locally because setting up the unit test databases on my computer takes like 20 minutes and I have no idea why.

Diff Detail

Repository
rP Phabricator
Branch
hachque-reconstructed
Lint
Lint Passed
Unit
Tests Skipped
Build Status
Buildable 7788
Build 8608: [Placeholder Plan] Wait for 30 Seconds
Build 8607: arc lint + arc unit

Event Timeline

hach-que retitled this revision from to [harbormaster/core] Allow build variables to be optional by prefixing them with '?'.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.

@epriestley I think this might be relevant for upstream? I can't remember whether parametrized build plans are exposed to users yet.

This hasn't had any feedback from upstream, so I'm going to abandon it.