Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891175
HarbormasterBuildStepCoreCustomField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
HarbormasterBuildStepCoreCustomField.php
View Options
<?php
final
class
HarbormasterBuildStepCoreCustomField
extends
HarbormasterBuildStepCustomField
implements
PhabricatorStandardCustomFieldInterface
{
public
function
getStandardCustomFieldNamespace
(
)
{
return
'harbormaster:core'
;
}
public
function
createFields
(
$object
)
{
try
{
$impl
=
$object
->
getStepImplementation
(
)
;
}
catch
(
Exception
$ex
)
{
return
array
(
)
;
}
$specs
=
$impl
->
getFieldSpecifications
(
)
;
if
(
$impl
->
supportsWaitForMessage
(
)
)
{
$specs
[
'builtin.next-steps-header'
]
=
array
(
'type'
=>
'header'
,
'name'
=>
pht
(
'Next Steps'
)
,
)
;
$specs
[
'builtin.wait-for-message'
]
=
array
(
'type'
=>
'select'
,
'name'
=>
pht
(
'When Complete'
)
,
'instructions'
=>
pht
(
'After completing this build step Harbormaster can continue the '
.
'build normally, or it can pause the build and wait for a message. '
.
'If you are using this build step to trigger some work in an '
.
'external system, you may want wait for that system to perform '
.
'the work and report results back.'
.
"\n\n"
.
'If you select **Continue Build Normally**, the build plan will '
.
'proceed once this step finishes.'
.
"\n\n"
.
'If you select **Wait For Message**, the build plan will pause '
.
'indefinitely once this step finishes. To resume the build, an '
.
'external system must call `harbormaster.sendmessage` with the '
.
'build target PHID, and either `"pass"` or `"fail"` to indicate '
.
'the result for this step. After the result is recorded, the build '
.
'plan will resume.'
)
,
'options'
=>
array
(
'continue'
=>
pht
(
'Continue Build Normally'
)
,
'wait'
=>
pht
(
'Wait For Message'
)
,
)
,
)
;
}
return
PhabricatorStandardCustomField
::
buildStandardFields
(
$this
,
$specs
)
;
}
public
function
shouldUseStorage
(
)
{
return
false
;
}
public
function
readValueFromObject
(
PhabricatorCustomFieldInterface
$object
)
{
$key
=
$this
->
getProxy
(
)
->
getRawStandardFieldKey
(
)
;
$this
->
setValueFromStorage
(
$object
->
getDetail
(
$key
)
)
;
}
public
function
applyApplicationTransactionInternalEffects
(
PhabricatorApplicationTransaction
$xaction
)
{
$object
=
$this
->
getObject
(
)
;
$key
=
$this
->
getProxy
(
)
->
getRawStandardFieldKey
(
)
;
$this
->
setValueFromApplicationTransactions
(
$xaction
->
getNewValue
(
)
)
;
$value
=
$this
->
getValueForStorage
(
)
;
$object
->
setDetail
(
$key
,
$value
)
;
}
public
function
getBuildTargetFieldValue
(
)
{
return
$this
->
getProxy
(
)
->
getFieldValue
(
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 14:45 (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125639
Default Alt Text
HarbormasterBuildStepCoreCustomField.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment