Skip to content
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

reviewdog is unstable #684

Open
tyru opened this issue Jul 23, 2019 · 3 comments
Open

reviewdog is unstable #684

tyru opened this issue Jul 23, 2019 · 3 comments

Comments

@tyru
Copy link
Member

tyru commented Jul 23, 2019

#638 (comment)
#683

等で

# Run reviewdog.
reviewdog -reporter=github-pr-check
reviewdog: status=401: The access token not provided. Get token from https://reviewdog.app/gh/vim-jp/vital.vim
The command "if [[ "${RUN_LINT}" == "true" ]] ; then bash scripts/run-lint-on-ci.sh ; fi" exited with 1.

とエラーがが出てます。
https://travis-ci.org/vim-jp/vital.vim/jobs/562415122

#610 で token 再生成した辺りから自分が手順間違えてたとかもありそう…

cc: @haya14busa

@tyru
Copy link
Member Author

tyru commented Aug 31, 2019

#638 (comment)

droneio はもう使ってないので全く関係ないです。 401 Bad credentials がでるのは謎です。
正確に言うとreviewdogのトークンではなく後ろで取得したGitHub API token がなぜかGitHub APIから401にランダムに弾かれてるのでreviewdogトークンを再生成しても意味はありません。

@haya14busa
Copy link
Member

GitHub Token 問題 ( #638)

reviewdog -reporter=github-pr-check
2019/07/22 12:58:58 [vimlint] reported: https://github.com/vim-jp/vital.vim/runs/174319121
2019/07/22 12:58:58 [vint] reported: https://github.com/vim-jp/vital.vim/runs/174319123
2019/07/22 12:58:58 [misspell] reported: https://github.com/vim-jp/vital.vim/runs/174319124
reviewdog: status=400: POST https://api.github.com/repos/vim-jp/vital.vim/check-runs: 401 Bad credentials []

Using an expired token produces a status code of 401 - Unauthorized, and requires creating a new installation token
-- https://developer.github.com/v3/apps/#create-a-new-installation-token

一つ今あり得るなぁと思ってるのが token が expire すると401を返すらしいので使っているライブラリ、または自分の使い方の問題で refresh token が正しく発行されてない可能性があるかと思ってます。ただパッと読んでる現状だとバグは見つけられてません。
最近ライブラリにメンテナがついたっぽくてちょくちょく変わってるのでアップデートするだけで勝手に直るかもしれない(希望的観測すぎる)

https://github.com/bradleyfalzon/ghinstallation/blob/49ae7c59d7434042f18f65355ef9bc6ebefd7738/transport.go#L111-L116

reviewdog token 問題 (#683)

reviewdog -reporter=github-pr-check
reviewdog: status=401: The access token not provided. Get token from https://reviewdog.app/gh/vim-jp/vital.vim

これはエラー通り REVIEWDOG_TOKEN がありません。
https://github.com/reviewdog/reviewdog#reporter-github-checks--reportergithub-pr-check
Travis CI からのリクエストだとなくても動くという codecov を真似たハックがあるんですが IP Address みてやってる推奨されないようなやり方なのでworkerによってはまれに判定をすり抜けてるっぽいと推察してます。

REVIEWDOG_TOKEN を明示的に渡せば解決しますが、travis のencryptionだとforkからのp-rからではtravisの仕様で使えません。REVIEWDOG_TOKEN token をtravisのencryption使わずべた書きするという方法や、circle ci を使うとforkからのp-rでもsecret environment variableを有効化するオプションがあります。

[蛇足] また今現在reviewdog側で開発している GitHub Actions から発行されるGitHub APIトークンから直接GitHubのCheck APIを呼ぶという方法があるのですが、これは fork からの p-rでは一律write権限がないので使えません。forkからのp-rの場合はGitHub Actionsのログにべた書きするというフォールバックはできますが vital.vim 的には基本forkからのp-rな気がするのであんまり嬉しくないかもです。

@tyru
Copy link
Member Author

tyru commented Sep 13, 2019

期待age

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants