From 3511c73995978887a7d77077020a6a1bf62dcb31 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 22 Feb 2023 00:37:12 +0000 Subject: [PATCH 1/2] Add a script for creating diff CLs for ANAPIC It diffs AIDL interface changes between branches and uploads a CL. Test: ./anapic_release_diff.sh goog/tm-dev goog/master android.hardware.cas Bug: none Change-Id: I2bec024d9038829ead459d1ddecddef835e85fc4 --- scripts/anapic_hidl2aidl_review.sh | 8 ++++++++ scripts/anapic_release_diff.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 scripts/anapic_release_diff.sh diff --git a/scripts/anapic_hidl2aidl_review.sh b/scripts/anapic_hidl2aidl_review.sh index 330ae32220..06619129b8 100755 --- a/scripts/anapic_hidl2aidl_review.sh +++ b/scripts/anapic_hidl2aidl_review.sh @@ -1,4 +1,11 @@ #!/bin/bash +# +# Create two CLs for the given HIDL interface to see the diff between the +# hidl2aidl output and the source at the tip-of-tree. +# The first CL contains the hidl2aidl output after removing all existing AIDL +# files. +# The second CL contains all of the changes on top of the raw hidl2aidl output +# that can be used for review. if [[ $# -ne 1 ]]; then echo "Usage: $0 INTERFACE_NAME" @@ -23,5 +30,6 @@ git add -A git commit -am "convert $1" --no-edit git revert HEAD --no-edit git commit --amend --no-edit +git diff HEAD~1 --stat repo upload . --no-verify popd diff --git a/scripts/anapic_release_diff.sh b/scripts/anapic_release_diff.sh new file mode 100755 index 0000000000..ea5214bb21 --- /dev/null +++ b/scripts/anapic_release_diff.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Create a CL that contains the changes between this branch and a newer branch +# for a given AIDL interface. +# Be sure that BRANCH_BASE is the current upstream branch in order to get a CL. + +if [[ $# -ne 3 ]]; then + echo "Usage: $0 BRANCH_BASE BRANCH_NEW PACKAGE_NAME" + echo "- BRANCH_BASE current branch, typically a previous release's dev branch" + echo "- BRANCH_NEW end branch, typically goog/master as the latest branch" + echo "- PACKAGE_NAME this is the AIDL package name" + echo "example of creating the diffs for android.hardware.boot" + echo "$ git checkout tm-dev ; repo start review" + echo "$ ./anapic_release_diff.sh goog/tm-dev goog/master android.hardware.boot" + exit 1 +fi + +# for pathmod +source ${ANDROID_BUILD_TOP}/build/make/envsetup.sh + +set -ex + +INTERFACE_NAME_NO_VER=${3%@*} +pushd $(pathmod $INTERFACE_NAME_NO_VER) +git diff "$1".."$2" android | git apply +git add -A +git commit -am "Android $1 to $2: $3" --no-edit +git diff HEAD~1 --stat +repo upload . --no-verify +popd From fc9a722e9974d86edcb8db79116d023e3154fc1c Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 22 Feb 2023 01:01:52 +0000 Subject: [PATCH 2/2] Update ANAPIC reviews to be easier to manage in gerrit Mark them wip so they sit in their own section of the gerrit dashboard. Add a hashtag to make them easier to keep track of. Test: anapic_review_diff.sh goog/tm-dev goog/master android.hardware.cas Bug: none Change-Id: Id6f4b1a4b0931a9a3bfa4ef10c5f4ada51d11a44 --- scripts/anapic_hidl2aidl_review.sh | 2 +- scripts/anapic_release_diff.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/anapic_hidl2aidl_review.sh b/scripts/anapic_hidl2aidl_review.sh index 06619129b8..ce7216001b 100755 --- a/scripts/anapic_hidl2aidl_review.sh +++ b/scripts/anapic_hidl2aidl_review.sh @@ -31,5 +31,5 @@ git commit -am "convert $1" --no-edit git revert HEAD --no-edit git commit --amend --no-edit git diff HEAD~1 --stat -repo upload . --no-verify +repo upload . --no-verify --wip --hashtag=anapic_release_review popd diff --git a/scripts/anapic_release_diff.sh b/scripts/anapic_release_diff.sh index ea5214bb21..c22d9e5799 100755 --- a/scripts/anapic_release_diff.sh +++ b/scripts/anapic_release_diff.sh @@ -26,5 +26,5 @@ git diff "$1".."$2" android | git apply git add -A git commit -am "Android $1 to $2: $3" --no-edit git diff HEAD~1 --stat -repo upload . --no-verify +repo upload . --no-verify --wip --hashtag=anapic_release_review popd