tarantool / docbot

Bot to automate some GitHub things
4 stars 1 forks source link

Don't pass access_token as query parameter #11

Closed Totktonada closed 3 years ago

Totktonada commented 3 years ago

https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/

Totktonada commented 3 years ago

I found two commits without tarantool/doc issues, found corresponding webhook payload and redelivered it. Got the new tarantool/doc issues:

So the fix works.

I want to re-check that all commits has tarantool/doc issues.

Some weird scripting Change directory to tarantool source repository, checkout latest `master` branch. Collect existing doc issues: ```sh $ export GITHUB_TOKEN=$(pass show name_of_the_token) $ cat fetch-doc-issues.sh #!/bin/sh set -eux issues_url='https://api.github.com/repos/tarantool/doc/issues?state=all&per_page=100' page_count=$(curl -fsSI -H "Authorization: token ${GITHUB_TOKEN}" "${issues_url}" | grep '^link:' | sed -e 's/^.*&page=\([0-9]\+\)>; rel="last".*$/\1/') for i in $(seq 1 ${page_count}); do curl -fsS -H "Authorization: token ${GITHUB_TOKEN}" "${issues_url}&page=${i}" > issues-${i}.json done $ ./fetch-doc-issues.sh ``` Extract titles: ```sh $ for i in $(seq 1 1000); do if [ ! -f issues-$i.json ]; then continue; fi; jq -rM '.[] | select(.pull_request == null) | .title' < issues-$i.json; done | sed -e 's/^\[[^]]\+\] //' -e 's/^ \+//' > present-doc-issue-titles.txt ``` Extract titles from commit messages: ```sh $ git log | grep '^ Title:' | sed 's/^ Title: //' > expected-doc-issue-titles.txt ``` For each expected title show whether we have corresponding doc issue: ```sh $ while read line; do m="$(fgrep "$line" present-doc-issue-titles.txt | head -n 1)"; if [ "$m" = "$line" ]; then echo "EXACT: $line"; elif [ -n "$m" ]; then echo "FUZZY MATCH: $line | $m"; else echo "NO MATCH: $line"; fi ; done < expected-doc-issue-titles.txt >expected-doc-issue-titles-marked.txt ``` Now the list is the following (if we'll skip found issues): ```sh $ grep -v ^EXACT: expected-doc-issue-titles-marked.txt ```

The rough list is the following:

Totktonada commented 3 years ago

Processed all missed documentation requests that I found in commit messages.