Commit Graph

23 Commits

Author SHA1 Message Date
Marc Wrobel
c78d1fe2b5 Refactor scripts arguments handling (#456)
- 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.
2025-06-28 19:05:07 +02:00
Marc Wrobel
312ce078bb Improve HTTP handling in scripts (#449)
Provide some helper methods to hide the complexity of parsing HTML, JSON, YAML, XML or Markdown.
2025-06-28 12:26:10 +02:00
Marc Wrobel
f404274310 Align custom scripts with generic scripts (#445)
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.
2025-06-07 17:25:05 +02:00
Marc Wrobel
352f59e907 [aws-lambda] Fix script
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html has been updated, adapting the script to make it work with those changes.
2024-12-07 17:40:51 +01:00
Marc Wrobel
2a5a786217 [aws-lambda] Update script following documentation change (#381) 2024-09-24 13:52:56 +02:00
Marc Wrobel
812565e977 Rename support fields to align with eol fields (#338)
Companion PR of https://github.com/endoflife-date/endoflife.date/pull/4931.
2024-04-02 21:41:18 +02:00
Marc Wrobel
1fdefa9e03 [aws-lambda] Don't fail anymore on unknown tables (#330) 2024-03-09 00:01:06 +01:00
Marc Wrobel
ca0e376397 [aws-lambda] Fix nodejs4.3-edge block function update date (#306)
There is a mistake in the data: block function update date cannot be before the deprecation date.
2024-02-15 21:27:39 +01:00
Marc Wrobel
b6f14c8d61 Support release-level data (#297)
Support retrieving and updating generic release-level data, such as support and eol dates. The JSON format has been changed accordingly to add a new top-level `releases` key.

The `aws-lambda.py` script has been updated to make use of this new feature.
2024-02-11 16:57:59 +01:00
Marc Wrobel
a0ba2d687e Improve scripts execution orchestration (#299)
Until now products could declare multiple auto-update methods, but they all had to be of the same kind.
For example if you used the git auto-update method, you could not use an additional github_releases or custom auto-update method.
This is an issue as it prevents us to extend the auto-update process, for example by having a product using the 'git' auto-update method to retrieve all the versions, and a custom script to retrieve support and EOL dates.

This improve the scripts execution orchestration to be able to support auto configurations using a mix of methods, meaning:

- multiple kind of methods, such as git and github_release,
- or multiple custom methods.

A side-effect of those changes is that now a failure in a generic script does not cancel the update of subsequent products.

Another side-effect, unwanted this time, is that now custom scripts managing multiple products, such as apple.py, are now executed multiple times instead of once.
2024-02-11 15:28:26 +01:00
Marc Wrobel
dc3f4e0653 [firefox][unity] Add support for cumulative updates and use it in a few scripts (#295)
Generic support for cumulative updates has been added to speed up execution time of some scripts that were very long (in comparison with the vast majority of products), usually because they were involving a lot of HTTP requests.

This feature was developed particularily for the firefox.py and unity.py scripts, which was often very long to execute (a minute or moreaccording to GHA summaries). Those scripts has been updated to make use of this new feature.
2024-02-04 18:05:18 +01:00
Marc Wrobel
56cc29b49d Make releasedata.Product usable in 'with' expression (#294)
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.
2024-02-04 14:48:05 +01:00
Marc Wrobel
42165ea287 Preserve all version fields (#286)
Up to now extra version fields were ignored: only name and date fields were accepted. This changes that by retaining the full JSON data when reading the file, making it possible in the future to support custom fields.

This also fixes a bug with versions having released on the same date: they was not ordered as expected (reverse order).
2024-01-28 23:46:41 +01:00
Marc Wrobel
b339c81ead Split endoflife.date and releasedata models in separate files (#276)
This makes the code easier to read.
2024-01-07 20:22:46 +01:00
Marc Wrobel
f6a8349c46 Centralize GitHub Workflow groups declaration (#272)
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.
2023-12-31 17:00:11 +01:00
Marc Wrobel
798c298c59 Enable flake8-datetimez linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz.
2023-12-30 14:29:24 +01:00
Marc Wrobel
6002cbdb26 Enable isort linting rules (#267)
See https://docs.astral.sh/ruff/rules/#isort-i.
2023-12-30 14:29:24 +01:00
Marc Wrobel
1add3a71d1 Minor refactoring (#262)
- Move frontmatter-related operation from Product to ProductFrontmatter. This makes more senses, as we are manipulating different files / kind of data.
- Use Product directly to load old versions.
2023-12-26 17:33:45 +01:00
Marc Wrobel
a6eebd1dc1 [aws-lambda] Improve script (#259)
- make the script more resilient to changes in the page by using column names,
- use the product release releaseDate as the date, else the date the version was first found, else the current date (previously the date the version was first found was not used),
- move some code to the Product class.
2023-12-18 00:02:38 +01:00
Marc Wrobel
aa7975d7f1 [aws-lambda] Refactor script (#215)
Make the script more readable, mostly by:

- using the endoflife.Product class,
- removing the unnecessary use of functions,
- a little bit of renaming.
2023-12-10 16:09:15 +01:00
Marc Wrobel
7cf62c2355 Refactor HTTP common code (#207)
- move to common/http.py,
- make fetch_url return a Response.
2023-12-02 22:52:12 +01:00
Marc Wrobel
6023ccc257 [aws-lambda] Fix script
Returning a default date far in the future makes the latest.py script fail.
2023-11-24 22:26:32 +01:00
Marc Wrobel
2e83befe93 [aws-lambda] Add automation (#166)
The purpose of this new script is to be alerted of new runtimes, while not making updates to the original product file (because release dates cannot be fetched from AWS documentation).
2023-11-23 22:02:51 +01:00