Repository navigation
fix(version check): propagate error and use github token - #19298
Conversation
There was a problem hiding this comment.
Review overview
🟡 Changes recommended
Returning lookup errors instead of current: true is the right fix. The token handling has problems, though: it is cached for the whole process, an empty GITHUB_TOKEN hides GH_TOKEN, and a rejected token gives an error whose hint points at rate limiting.
Findings: 1
Open (9)
The token is cached for the life of the process A rejected token turns a working check into an error with the wrong hint An emptyGITHUB_TOKENstopsGH_TOKENfrom being used update-informer now adds little beyond the version compareghchecksGH_TOKENbeforeGITHUB_TOKEN Thevprefix strip is redundant TheNuShellNightly::NAMEchange has no effect.get::<D>(url)is repeated in both match arms No tests for token selection or error propagation
Notes from my clanker, checked on 5a8b2ab. I built the branch and ran version check with no token, a bad GITHUB_TOKEN, a bad token followed by hide-env, no token followed by a bad one, and an empty GITHUB_TOKEN with a bad GH_TOKEN. The results are quoted in the threads.
|
At the end I dropped |
|
wow, this is quite an overhaul. thanks for all the effort. i'm fine with losing a dep. |



Description
User-facing changes (Release notes)
Previously, the
version checkcommand would say you are on the latest release if the lookup failed, now, lookup errors will result in an error on the command too. Also, if a github token is available on the environment (GITHUB_TOKENorGH_TOKEN) it will be used for the request to bypass the unauthenticated 60-requests-per-hour github api rate limit.