Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13711258
D6017.id19927.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6017.id19927.diff
View Options
diff --git a/contrib/source-control-tools/land-patch.sh b/contrib/source-control-tools/land-patch.sh
--- a/contrib/source-control-tools/land-patch.sh
+++ b/contrib/source-control-tools/land-patch.sh
@@ -65,6 +65,30 @@
fi
set -x
+if [ -n "${REVISION}" ]; then
+ # Temporarily stop verbose logging to prevent leaking CONDUIT_TOKEN
+ set +x
+ # Fetch the revision and check its review status
+ REVIEW_STATUS=$(curl "https://reviews.bitcoinabc.org/api/differential.revision.search" \
+ -d "api.token=${CONDUIT_TOKEN}" \
+ -d "constraints[ids][0]=${REVISION:1}" |\
+ jq '.result.data[].fields.status.value') || {
+ echo "Error: Failed to fetch review status of revision '${REVISION}'"
+ echo "The 'status' fields may be missing or malformed."
+ exit 30
+ }
+ set -x
+
+ # We only trust code that has been accepted
+ if [ "${REVIEW_STATUS}" != "\"accepted\"" ]; then
+ echo "Error: Revision '${REVISION}' has not been accepted"
+ exit 31
+ fi
+fi
+
+# IMPORTANT NOTE: The patch is trusted past this point. It was either reviewed
+# and accepted or it was auto-generated.
+
TOPLEVEL=$(git rev-parse --show-toplevel)
DEVTOOLS_DIR="${TOPLEVEL}"/contrib/devtools
BUILD_DIR="${TOPLEVEL}"/build
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 11:13 (11 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5573376
Default Alt Text
D6017.id19927.diff (1 KB)
Attached To
D6017: [land-bot] Only operate on trusted patches
Event Timeline
Log In to Comment