Skip to content

feat: show update notice#117

Merged
ninoseki merged 3 commits intomainfrom
update-notification
Mar 5, 2026
Merged

feat: show update notice#117
ninoseki merged 3 commits intomainfrom
update-notification

Conversation

@ninoseki
Copy link
Collaborator

@ninoseki ninoseki commented Mar 5, 2026

Show the update notice (see the below) to make it easy to know whether a user is using the latest version or not.

$ urlscan version
urlscan-cli ...
                                                    Update available: 2026.02.25

(in the right corner & via stderr)

This update notification is shown when there is a new version & when a user hit urlscan version and urlscan (the main entry point which shows the usage)

@ninoseki ninoseki requested a review from cdnsyseng March 5, 2026 07:49
@cdnsyseng
Copy link
Contributor

cdnsyseng commented Mar 5, 2026

I have two minor nits here:

  1. The HTTP call to check for an update has a 10 second timeout and (as far as I can see) is synchronous. This means if the user is offline or has connectivity issues (or GitHub is down...), they could wait 10 seconds for urlscan-cli to print anything? I doubt most people have the patience to let something run for 10 seconds with no output. Could we maybe print the usage and then add Checking for updates... ctrl+c to cancel output?
  2. If I run a program without any flags, I don't expect it to phone home and check for updates. I would leave the update check behind urlscan version or urlscan check-update to avoid surprising someone.

@ninoseki
Copy link
Collaborator Author

ninoseki commented Mar 5, 2026

Thanks for the feedback.

  • I set the short timeout (5s) for checking update & make silence when GitHub is unreachable to avoid the long hang up.
  • I removed the notification from the root command.

@ninoseki ninoseki merged commit 9f01b1c into main Mar 5, 2026
5 checks passed
@ninoseki ninoseki deleted the update-notification branch March 5, 2026 10:12
@fw42
Copy link
Contributor

fw42 commented Mar 5, 2026

Nice. I think this is a good compromise for now and we can close #37.

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

Successfully merging this pull request may close these issues.

3 participants