I wonder if it would help to think about the messaging we want to give to the user?
Take the current situation where we have only one supported branch, 4.1, with the latest being 4.1.4 (which will be recommended).
User is running 4.1.1, but less than 4.1.4.
Say we have YAML like (adapted from Victor's to not use lists):
versions:
suricata:
recommended: "4.1.4"
"4.1": "4.1.4"
We can look at versions["suricata"]["4.1"]. If it is defined, and the value (here: 4.1.4) differs from the current version, we display:
Warning: Suricata version 4.1.1 is outdated. Please upgrade to 4.1.4.
If the user was running "4.0.5", the lookup in the versions would have been undefined. We can use this as an EOL, or we could add `"4.0": EOL` to the YAML. Either way the output would be something like:
Warning: Suricata version 4.0.5 is EOL. Please upgrade to $RECOMMENDED.
When we release 5.0, which may also happen close to a 4.1.5 release, the index will be updated to be like:
versions:
suricata:
recommended: "5.0.0"
"5.0": "5.0.0"
"4.1": "4.1.5"
Here the 4.1 user will be notified that 4.1.5 is available. We might want to add logic to display something like:
Warning: Suricata version 4.1.1 is outdated. Please upgrade to 4.1.4 or $RECOMMENDED_VERSION.
I'm not positive we can get this kind of logic with your proposed YAML. I also don't think we need to exhaustively list every version in the YAML.
Regarding development versions, where "dev" is in the version, it might be easiest to just skip the version check for now in that case. I think we could still do something useful here, but focus on the non-dev versions first. Additionally if the Suricata version is greater than the recommended version, then don't output anything as well.