projectsyn / commodore

Commodore provides opinionated tenant-aware management of Kapitan inventories and templates. Commodore uses Kapitan for the heavy lifting of rendering templates and resolving a hierachical configuration structure.
https://syn.tools/commodore/
BSD 3-Clause "New" or "Revised" License
46 stars 8 forks source link

Version Check on Invocation #414

Open tobru opened 2 years ago

tobru commented 2 years ago

Context

I observed that users are many times running an outdated version of Commodore. We should add a check on invocation which checks if the installed version of Commodore is up-to-date. This check should be configurable, so that one can choose that this check shouldn't be done (e.g. --disable-version-check) and it should be non-blocking, should the check not succeed fast enough.

It could compare the version with https://github.com/projectsyn/commodore/releases/latest, this automatically redirects to the latest version (the location header of the response, could be a HEAD).

Alternatives

Users running outdated versions of Commodore.

mhutter commented 2 years ago

Alternative proposal

Instead of connecting to GitHub on each invocation, document the version used to generate the catalog in the catalog itself.

If the current catalog was generated using a more recent version than is currently in use, emmit the warning (or abort or whatever).

Source: I've seen other tools (bundler, yarn) do this to generate their lockfiles.

Edit: Using an outdated version is, in my opinion, not an issue per se. Running an outdated version against a catalog that was compiled using a more recent version on the other hand is.