- remove the use of environment variables to get directory paths,
- make use of arguments / argparse instead of environment variables in `update.py` and `report.py`,
- automatically guess the data directory in `latest.py` based on the script's location,
- propagate log level to auto scripts,
- move `list_configs_from_argv` from `endoflife` module to `releasedata` module,
- use `list_products` in `latest.py` to load the product's frontmatters.
Align custom scripts with generic scripts, making them configurable. This has a few advantages:
- script code is more unified,
- no more hard-coded method names in scripts, which is less error prone and make it easier to rename scripts,
- no more hard coded product names in scripts, which is less error prone and make it easier to rename products,
- less hard-coded URLs and regexes in scripts, which makes auto-configuration more expressive / updatable,
Also added method `endoflife.list_configs_from_argv()` so that it is easier to manipulate scripts arguments.
The Red Hat people changed the format of the dates AND the format of the versions from this:
=== RHSA-2024:5808 - {product-title} 4.12.64 bug fix and security update
to this
=== RHSA-2024:0041 - {product-title} {product-version}.0 image release, bug fix, and security update advisory.
But not for all branches, but only for the latest (4.16 and up).
Fixes#378
This way the writing of the JSON file is handled automatically if the update does not fail.
It pave the way to further global improvements, such as a better error handling.
It may not be the best place for that (gha.py would have been better), but it's the shorter / faster way to do it for now.
Moreover it now uses logging for writing the group. The logger format has been updated for this to work. This was done to fix issues on GitHub Action logs, where groups were declared after the logs.
Make the script more readable, mostly by:
- using the Product class,
- a little bit of renaming and documentation,
- removing the use of functions when unnecessary.
The script only get versions 4.x and above, see script comments for more informations.
Note that the code related to git has been extracted to a common script so that it can be reused for the Debian script.