Skip to content

Ignore private changes and comments #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/scripts/parse_false_positive_comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spdk_repo=$REPO
gerrit_comment=$COMMENT
reported_by=$AUTHOR

gerrit_url=https://review.spdk.io/a/changes
gerrit_url=https://review.spdk.io/changes
gerrit_format_q="o=DETAILED_ACCOUNTS&o=MESSAGES&o=LABELS&o=SKIP_DIFFSTAT"

# Looking for comment thats only content is "false positive: 123", with a leeway for no spaces
Expand Down Expand Up @@ -46,7 +46,15 @@ fi
curl -s -X GET \
--user "$GERRIT_BOT_USER:$GERRIT_BOT_HTTP_PASSWD" \
"$gerrit_url/spdk%2Fspdk~$change_num?$gerrit_format_q" \
| tail -n +2 | jq . | tee change.json
| tee _change.json

if grep "Not found: spdk/spdk~$change_num"; then
echo "Change $change_num not found, exiting."
echo "Either it's a private change or in restricted branch."
exit 0
fi
tail -n +2 _change.json | jq . > change.json
rm -f _change.json

# Do not test any change marked as WIP
ready_for_review="$(jq -r '.has_review_started' change.json)"
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/gerrit-webhook-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ jobs:
set -x

# Get latest info about a change itself
curl -s -X GET "https://review.spdk.io/a/changes/spdk%2Fspdk~${{ env.change_num }}?o=DETAILED_ACCOUNTS&o=LABELS&o=SKIP_DIFFSTAT" \
--user "${{ secrets.GERRIT_BOT_USER }}:${{ secrets.GERRIT_BOT_HTTP_PASSWD }}" \
| tail -n +2 > change.json
curl -s -X GET "https://review.spdk.io/changes/spdk%2Fspdk~${{ env.change_num }}?o=DETAILED_ACCOUNTS&o=LABELS&o=SKIP_DIFFSTAT" > _change.json

if grep "Not found: spdk/spdk~${{ env.change_num }}"; then
echo "Change ${{ env.change_num }} not found, exiting."
echo "Either it's a private change or in restricted branch."
gh run cancel ${{ github.run_id }} -R ${{ github.repository }}
fi
tail -n +2 _change.json > change.json
rm -f _change.json

# Do not test any change marked as WIP
ready_for_review="$(jq -r '.has_review_started' change.json)"
Expand Down