Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3148856
Find Phab tasks with projects CC'd
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Krenair
Dec 26 2015, 4:21 AM
2015-12-26 04:21:25 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Find Phab tasks with projects CC'd
View Options
# 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
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3157288
Default Alt Text
Find Phab tasks with projects CC'd (1 KB)
Attached To
Mode
P2454 Find Phab tasks with projects CC'd
Attached
Detach File
Event Timeline
Log In to Comment