- 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.
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 classes,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.
Create a common function to write resulting JSON files to the releases directory.
It makes this task simpler to read and maintain, while making it modifiable at a central point in the future.
One example of such modification could be the sorting of the versions in a uniform way for all the scripts.
This creates a common function to fetch HTTP URLs, with enhanced capabilities (retry, use of a known User-Agent).
It makes scripts that need those capabilities simpler, while improving other scripts.
This commit also fixes some scripts that did not log properly (cos.py, eks.py, haproxy.py, palo-alto-networks.py, rhel.py, ros.py, unrealircd.py).
- Get cycles URL by parsing https://www.haproxy.org/download/:
- This way the script does not have to be updated each time a new minor version is released.
- The old algorithm was missing some versions (such as 1.6.x).
- Use a GitHub actions log group to wrap the script logs.
- Display version like the other scripts.