Reply to thread

Bumping an Add-on version is a boring, tedious and sometimes quite error-prone routine task:

We either have to edit version_id and version_string in addon.json, pass at least option version-id on the commandline or interactively enter it in the console.


version_id is great for automatic processing, but somewhat hard to read (and way too easy to mess up) for humans.

In most cases, version changes are simple and and predictable, so couldn't this process be simplified?


My suggestion is to make a few changes to this command:

  1. Add an new option ---autowith optional values minor and major
    If this option is passed on the commandline, the next version is chosen automatically according to this algorithm:
    If state is stable reset state version to 0 and increase patch version (or minor / major if value is set; remeining version bits are reset to zero if used)
    If state is alpha, beta or rc increase state version, error if that would overflow (eg. state version > 19) or if optional value is set
    Error in all other cases
  2. Add a new option --state with optional values alpha, beta and rc
    If this is passed on the commandline together with --auto, state is alpha, beta or rc and no value is set do not increase patch version but increase state version instead, error if that would overflow (eg. state version > 19)
    If one of the optional values is set increase patch version and set state as specified
    Error in all other cases
  3. Change the code so version id can be infered from version string if only that is given on the commandline

This would IMHO significantly simplify things - in many cases we could just call

  • xf-addon:bump-version --auto --state for hot fixes
  • xf-addon:bump-version --auto for normal maintenance updates
  • xf-addon:bump-version --auto  minor --state beta to start beta for a new minor version or go straight to a new minor version with xf-addon:bump-version --auto minor


Back
Top Bottom