Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112980
ArcanistBuildRef.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
ArcanistBuildRef.php
View Options
<?php
final
class
ArcanistBuildRef
extends
ArcanistRef
{
const
HARDPOINT_BUILDPLANREF
=
'ref.build.buildplanRef'
;
private
$parameters
;
protected
function
newHardpoints
()
{
return
array
(
$this
->
newHardpoint
(
self
::
HARDPOINT_BUILDPLANREF
),
);
}
public
function
getRefDisplayName
()
{
return
pht
(
'Build %d'
,
$this
->
getID
());
}
public
static
function
newFromConduit
(
array
$parameters
)
{
$ref
=
new
self
();
$ref
->
parameters
=
$parameters
;
return
$ref
;
}
public
function
getID
()
{
return
idx
(
$this
->
parameters
,
'id'
);
}
public
function
getPHID
()
{
return
idx
(
$this
->
parameters
,
'phid'
);
}
public
function
getName
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'name'
));
}
protected
function
buildRefView
(
ArcanistRefView
$view
)
{
$view
->
setObjectName
(
$this
->
getRefDisplayName
())
->
setTitle
(
$this
->
getName
());
}
public
function
getBuildPlanRef
()
{
return
$this
->
getHardpoint
(
self
::
HARDPOINT_BUILDPLANREF
);
}
public
function
getBuildablePHID
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'buildablePHID'
));
}
public
function
getBuildPlanPHID
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'buildPlanPHID'
));
}
public
function
getStatus
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'buildStatus'
,
'value'
));
}
public
function
getStatusName
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'buildStatus'
,
'name'
));
}
public
function
getStatusANSIColor
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'buildStatus'
,
'color.ansi'
));
}
public
function
isComplete
()
{
switch
(
$this
->
getStatus
())
{
case
'passed'
:
case
'failed'
:
case
'aborted'
:
case
'error'
:
case
'deadlocked'
:
return
true
;
default
:
return
false
;
}
}
public
function
isPassed
()
{
return
(
$this
->
getStatus
()
===
'passed'
);
}
public
function
getStatusSortVector
()
{
$status
=
$this
->
getStatus
();
// For now, just sort passed builds first.
if
(
$this
->
isPassed
())
{
$status_class
=
1
;
}
else
{
$status_class
=
2
;
}
return
id
(
new
PhutilSortVector
())
->
addInt
(
$status_class
)
->
addString
(
$status
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 4, 08:27 (5 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
797922
Default Alt Text
ArcanistBuildRef.php (2 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment