Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31607566
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
mmodell
Feb 10 2020, 11:27 PM
2020-02-10 23:27:43 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
raw.txt
View Options
#!/bin/bash
arc="arc call-conduit --conduit-uri https://phabricator.wikimedia.org/"
BASENAME=$0
BASENAME=$(basename $BASENAME)
if [ "$1" == "" ]
then
echo "$BASENAME: Mark all uris for a given repository as read-only."
echo ""
echo "Usage: $BASENAME repo-name"
exit 1
fi
QUERY="{ \"constraints\": { \"shortNames\" : [ \"$1\" ] }, \"attachments\": { \"uris\": true } } "
#echo $QUERY
JSON=$($arc diffusion.repository.search <<< "$QUERY")
IDS=$(jq -j '[.response.data[].attachments.uris.uris[] | select( .fields.io.raw == "readwrite") | .id] | join(" ")' <<< "$JSON")
URIS=$(jq -r '.response.data[].attachments.uris.uris[] | select( .fields.io.raw == "readwrite") | [.id, .fields.uri.normalized ]|join(": ")' <<< "$JSON")
echo "Found the following writable URIs:"
echo "$URIS"
read -p "Mark these URIs read-only? " -n 1
if [[ $REPLY =~ ^[Yy]$ ]]
then
set -e
for ID in $IDS
do
echo "Marking URI $ID read-only"
$arc diffusion.uri.edit << EOF
{
"transactions": [
{ "type": "io", "value": "read" }
], "objectIdentifier": "$ID"
}
EOF
done
fi
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8314923
Default Alt Text
raw.txt (1 KB)
Attached To
Mode
P10370 make-repo-readonly.sh
Attached
Detach File
Event Timeline
Log In to Comment