Skip to content

fix(version check): propagate error and use github token - #19298

Merged
fdncred merged 4 commits into
nushell:mainfrom
Tyarel8:version-check-rate-limit
Oct 20, 2026
Merged

fdncred merged 4 commits into
nushell:mainfrom
Tyarel8:version-check-rate-limit

Conversation

@Tyarel8

@Tyarel8 Tyarel8 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Description

User-facing changes (Release notes)

Previously, the version check command 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_TOKEN or GH_TOKEN) it will be used for the request to bypass the unauthenticated 60-requests-per-hour github api rate limit.

@fdncred fdncred left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 3 Medium severity · 5 Low severity

Open (9)

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.

@Tyarel8

Tyarel8 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

At the end I dropped update-informer package since it's only used here and isn't very flexible; at this point I think it's easier to just do it "manually" with nushells http helpers.

@fdncred fdncred added notes:fixes Noted in "Bug fixes" section notes:ready Indicates Ready for Release notes labels Oct 20, 2026
@fdncred

fdncred commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

wow, this is quite an overhaul. thanks for all the effort. i'm fine with losing a dep.

@fdncred
fdncred merged commit 3246964 into nushell:main Oct 20, 2026
12 checks passed
@github-actions github-actions Bot added this to the v0.117.0 milestone Oct 20, 2026
@Tyarel8
Tyarel8 deleted the version-check-rate-limit branch October 20, 2026 11:55
@zimbatm zimbatm mentioned this pull request Oct 21, 2026
4 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:fixes Noted in "Bug fixes" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants