Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P2454
Find Phab tasks with projects CC'd
Active
Public
Actions
Authored by
Krenair
on Dec 26 2015, 4:21 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Tags
Phabricator
Referenced Files
F3148856: Find Phab tasks with projects CC'd
Feb 24 2016, 5:27 AM
2016-02-24 05:27:50 (UTC+0)
Subscribers
Luke081515
# By Alex Monk. As of writing, dies around offset 42k due to a server-side timeout.
import
json
,
subprocess
def
getAll
(
arcArgs
,
params
=
{},
limit
=
1000
,
offset
=
0
):
print
(
"Offset "
+
str
(
offset
))
proc
=
subprocess
.
Popen
(
arcArgs
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
resultOut
,
resultErr
=
proc
.
communicate
(
input
=
json
.
dumps
(
dict
(
params
,
limit
=
limit
,
offset
=
offset
)))
dataOut
=
json
.
loads
(
resultOut
.
strip
())[
'response'
]
if
'data'
in
dataOut
:
items
=
dataOut
[
'data'
]
.
values
()
elif
isinstance
(
dataOut
,
dict
):
items
=
dataOut
.
values
()
elif
isinstance
(
dataOut
,
list
):
items
=
dataOut
for
item
in
items
:
yield
item
if
len
(
items
)
==
limit
:
for
item
in
getAll
(
arcArgs
,
params
=
params
,
limit
=
limit
,
offset
=
offset
+
limit
):
yield
item
arcCommand
=
[
'arc'
,
'call-conduit'
,
'--conduit-uri'
,
'https://phabricator.wikimedia.org/'
]
# Security: PHID-PROJ-koo4qqdng27q7r65x3cw
# WMF-NDA: PHID-PROJ-ibxm3v6ithf3jpqpqhl7
# {'projectPHIDs': ['PHID-PROJ-somethingsomethingsomething']}
for
task
in
getAll
(
arcCommand
+
[
'maniphest.query'
],
{},
limit
=
1000
):
for
ccPHID
in
task
[
'ccPHIDs'
]:
if
'PROJ'
in
ccPHID
:
print
(
'https://phabricator.wikimedia.org/T'
+
task
[
'id'
]
+
' - '
+
ccPHID
+
' - '
+
task
[
'title'
])
break
Event Timeline
Krenair
changed the title of this paste from untitled to
Find Phab tasks with projects CC'd
.
Dec 26 2015, 4:21 AM
2015-12-26 04:21:25 (UTC+0)
Krenair
updated the paste's language from
autodetect
to
python
.
Krenair
edited the content of this paste.
(Show Details)
Krenair
added a project:
Phabricator
.
Krenair
mentioned this in
T116030: Increase pbkdf2 parameter strengths (2015/2016)
.
Krenair
added a subscriber:
Luke081515
.
Luke081515
awarded a token.
Dec 26 2015, 6:23 PM
2015-12-26 18:23:11 (UTC+0)
Log In to Comment