Is your feature request related to a problem? Please describe.
Depending on the way Kosmorro has been installed, we can easily be using an out of date version without being aware of it. It is especially a problem when the currently installed version has a bug that has already been fixed in a later version.
Describe the solution you'd like
When we run the kosmorro command, print a text into standard error output (stderr) to notify the user if a new version is available.
This can be done by calling the API endpoint at https://kosmorro.space/api/SoftwareApplications/cli.json and checking the softwareVersion value.
Describe alternatives you've considered
Check the last version regularly on the official website. Or just forget to check it.
Additional context
Kosmorro must always be usable offline. If the website is not available or if no connection is available when it is invoked, then the program should continue to run normally, without any warning nor error message.
Calls to the API endpoint is a simple GET request without any argument. It does not have to provide any tracking information.
The check is enabled by default, but in order to prevent users using packages managers (like APT, AUR, etc) to get unwanted notification, or for users who just prefer to check if new version is available by themselves, we should be able to deactivate it at both build (with poetry build) and execution times with an environment variable (KOSMORRO_DISABLE_VERSION_CHECK?). We might want the API endpoint to be configured directly through en environment variable too.
The API usually responds in less than 10 ms. For safety, the response timeout can be set to 20 ms.
Is your feature request related to a problem? Please describe. Depending on the way Kosmorro has been installed, we can easily be using an out of date version without being aware of it. It is especially a problem when the currently installed version has a bug that has already been fixed in a later version.
Describe the solution you'd like When we run the
kosmorro
command, print a text into standard error output (stderr
) to notify the user if a new version is available. This can be done by calling the API endpoint at https://kosmorro.space/api/SoftwareApplications/cli.json and checking thesoftwareVersion
value.Describe alternatives you've considered Check the last version regularly on the official website. Or just forget to check it.
Additional context
GET
request without any argument. It does not have to provide any tracking information.poetry build
) and execution times with an environment variable (KOSMORRO_DISABLE_VERSION_CHECK
?). We might want the API endpoint to be configured directly through en environment variable too.