Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F632078
Generate dot graph of ticket dependencies for a project
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
altendky
Jul 17 2015, 8:23 PM
2015-07-17 20:23:07 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Generate dot graph of ticket dependencies for a project
View Options
#!/usr/bin/env php
<?php
require
'/path/to/libphutil/src/__phutil_library_init__.php'
;
# TODO customize or parameterize or... these
$uri
=
'fill_me_in'
;
$certificate
=
'fill_me_in'
;
$username
=
'fill_me_in'
;
$client
=
new
ConduitClient
(
$uri
);
$args
=
new
PhutilArgumentParser
(
$argv
);
$args
->
parse
(
array
(
array
(
'name'
=>
'project'
,
'param'
=>
'projname'
,
'short'
=>
'p'
,
'help'
=>
'The project name to process.'
,
),
));
$project_name
=
$args
->
getArg
(
'project'
);
$params
=
array
(
'certificate'
=>
$certificate
,
'client'
=>
'mytestclient'
,
'clientVersion'
=>
'1.0'
,
'user'
=>
$username
,
'host'
=>
$uri
);
$client
->
callMethodSynchronous
(
'conduit.connect'
,
$params
);
$projects
=
$client
->
callMethodSynchronous
(
'project.query'
,
array
(
'names'
=>
[
$project_name
]));
$project_phid
=
array_keys
(
$projects
[
'data'
])[
0
];
$tasks
=
$client
->
callMethodSynchronous
(
'maniphest.query'
,
array
(
'projectPHIDs'
=>
[
$project_phid
]));
print
(
'dot {{{'
.
PHP_EOL
);
print
(
' digraph {'
.
PHP_EOL
);
foreach
(
$tasks
as
$task
)
{
# print('T' . $task['id'] . ': ' . $task['title'] . PHP_EOL);
print
(
str_replace
(
'-'
,
'_'
,
$task
[
'phid'
])
.
' [label="T'
.
$task
[
'id'
]
.
'" URL="'
.
$uri
.
'T'
.
$task
[
'id'
]
.
'"]'
.
PHP_EOL
);
foreach
(
$task
[
'dependsOnTaskPHIDs'
]
as
$dependsOnPhid
)
{
# print(' ' . $dependsOnPhid . PHP_EOL);
print
(
str_replace
(
'-'
,
'_'
,
$dependsOnPhid
)
.
' -> '
.
str_replace
(
'-'
,
'_'
,
$task
[
'phid'
])
.
PHP_EOL
);
}
}
print
(
' }'
.
PHP_EOL
);
print
(
'}}}'
.
PHP_EOL
);
?>
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/f3/i6/usuqdzoeegynp2js
Default Alt Text
Generate dot graph of ticket dependencies for a project (1 KB)
Attached To
Mode
P1828 Generate dot graph of ticket dependencies for a project
Attached
Detach File
Event Timeline
Log In to Comment