Commit Graph

51 Commits

Author SHA1 Message Date
Marc Wrobel
1221872660 Support exclusions in auto configurations (#282)
Support a new regex_exclude option to describe versions that must be excluded from the list of retrieved versions.

This will be useful for products such as KDE Plasma, for which beta releases are designated by the use of minor or patch version >= 80.
2024-01-20 18:27:57 +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
d01d8ed04b Simplify product listing (#275)
Small refactoring to simplify product listing by reusing ProductFrontmatter.
2024-01-07 16:50:27 +01:00
Marc Wrobel
74678a75c3 Update release-data JSON file format (#274)
This makes the format open for extension, such as adding release cycle level data (such as EOL dates).

Version data is still accessible by the version's name. While this repeats the version name, it's also much more convenient for users of those data.

A few other things have also been updated in the process:

- verbosity of the diff has been increased in update.py to make workflow summaries more readable,
- dates without timezone are now set to UTC by default (this was already supposed, so no impact expected here).
2024-01-02 11:42:10 +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
7a97c87b3b Refactor latest.py and update.py (#270)
- create new gha.py module,
- improve GitHub workflow commands (GITHUB_OUTPUT, GITHUB_STEP_SUMMARY) interactions,
- improve logging,
- split update.py into smaller functions.
2023-12-31 00:45:30 +01:00
Marc Wrobel
47e29992ae Enable flake8-use-pathlib linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth.
2023-12-30 14:29:24 +01:00
Marc Wrobel
7458563fec Enable flake8-simplify linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-simplify-sim.
2023-12-30 14:29:24 +01:00
Marc Wrobel
801859d78a Enable flake8-return linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-raise-rse.
2023-12-30 14:29:24 +01:00
Marc Wrobel
298ad1a754 Enable flake8-errmsg linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-errmsg-em.
2023-12-30 14:29:24 +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
1bb97fe2b4 Enable flake8-commas linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-commas-com.
2023-12-30 14:29:24 +01:00
Marc Wrobel
b32cb09494 Fix a few Intellij IDEA warnings 2023-12-30 14:29:24 +01:00
Marc Wrobel
f49e3dff15 Enable flake8-annotations linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-annotations-ann.
2023-12-30 14:29:24 +01:00
Marc Wrobel
0e8fe135e4 Enable flake8-bugbear linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-bugbear-b.
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
c9aca50729 Drop regexes lib (#258)
This was needed until #227 as the Ruby script did not support multiple regexes.

Now that all regexes has been split / simplified in https://github.com/endoflife-date/endoflife.date/pull/4317 and https://github.com/endoflife-date/endoflife.date/pull/4383 the regexes lib is not needed anymore.
2023-12-26 17:33:05 +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
6453bca256 Remove unused write_releases method
This method is unused now that all scripts are using the Product class.
2023-12-15 14:19:30 +01:00
Marc Wrobel
dfb113d589 [git] Refactor script (#227)
Make the script more readable, mostly by:

- using the Product and AutoConfig classes,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.

Note that this also changed the module used for regexes in endoflife.py. The regex module is now used because the Python re module does not support identically named groups (as used in the mariadb product). The regex module being backwards-compatible with the standard re module, this should not be an issue.
2023-12-10 22:07:35 +01:00
Marc Wrobel
9e0f4a437a [github_releases] Refactor script (#226)
Make the script more readable, mostly by:

- using the Product and AutoConfig classes,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.
2023-12-10 21:47:49 +01:00
Marc Wrobel
c27c64a754 [eks] Refactor script (#224)
Make the script more readable, mostly by:

- changing slightly the logic,
- using the Product and AutoConfig classes,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.

Disabled web.archive.org has also been re-enabled because HTTP retry mechanism has been improved and should handle timeouts a lot better.
2023-12-10 19:26:10 +01:00
Marc Wrobel
724dfc4808 [distrowatch] Refactor script (#222)
Make the script more readable, mostly by:

- using the Product and AutoConfig classes,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.
2023-12-10 18:39:35 +01:00
Marc Wrobel
0836c270ea [cgit] Refactor script (#216)
Make the script more readable, mostly by:

- using the endoflife.Product class,
- introducing the endoflife.AutoConfig class to make it easier to manage such configuration,
- removing the unnecessary use of functions,
- a little bit of renaming.
2023-12-10 16:26:47 +01:00
Marc Wrobel
758b204ada [artifactory] Refactor script (#214)
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 14:14:03 +01:00
Marc Wrobel
b122ed40fe [apple] Refactor script (#213)
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 13:44:59 +01:00
Marc Wrobel
6bdb657417 Add endoflife.Product class (#210)
This will be used in future PR to simplify existing script and lay fundation for tracking more than versions.
2023-12-09 23:30:33 +01:00
Marc Wrobel
d1191aefb4 Improve date support (#208)
This will be useful in future PRs:

- add a few more supported formats,
- cleanup string so that we don't have to deal with some special characters in formats.
2023-12-09 23:28:24 +01:00
Marc Wrobel
d80504aea8 Add some basic logging (#209)
Add some basic logging when using common.git or common.http.
2023-12-09 23:19:18 +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
750faaa64f Use a default regex when possible (#205) 2023-12-01 21:36:44 +01:00
Nemo
d7b0de3e17 [coldfusion] Add automation (#172)
Co-authored-by: Marc Wrobel <marc.wrobel@gmail.com>
2023-11-26 21:38:23 +01:00
Hugo van Kemenade
8870ab5e28 Lint on GitHub Actions (#196)
- Lint with pre-commit on GitHub Actions,
- Add some handy pre-hooks,
- Configure Ruff lint rules (https://github.com/astral-sh/ruff).

---------

Co-authored-by: Marc Wrobel <marc.wrobel@gmail.com>
2023-11-26 21:08:12 +01:00
Marc Wrobel
0d17306872 Simplify date parsing (#195)
Create common functions parse_date, parse_month_year_date and parse_datetime.

Those functions support trying multiple formats, and come with default formats lists that support most of the date format encountered so far.

Notable change: year-month dates are now set to the end of month (impacted couchbase-server and ibm-aix).
2023-11-26 21:01:35 +01:00
Marc Wrobel
1e65a048b0 Improve retry mechanism (#194) (#194)
When a ChunkedEncodingError occurs, request and response are not set and there is no way to get the URL that causes the error.
With this change all URLs are retried. The max_retries parameter is decreased each time so that we do not get stuck in an infinite loop.

I also considered to also wait before retrying, but for now I don't see any benefit to it.

Relates to #188.
2023-11-26 19:00:32 +01:00
Marc Wrobel
90658a356d Try to fix fetch_urls when ChunkedEncodingError occurs (#188) 2023-11-26 15:31:12 +01:00
Marc Wrobel
7b90c02f62 Try to fix fetch_urls when ChunkedEncodingError occurs (#188) 2023-11-26 13:58:27 +01:00
Hugo van Kemenade
1022d8f816 Fix some lint warnings (#189)
Remove unused imports or variable, and apply suggestions from https://adamj.eu/tech/2019/09/12/how-i-import-pythons-datetime-module/.
2023-11-26 13:25:04 +01:00
Marc Wrobel
f59390815c Try to fix fetch_urls when ChunkedEncodingError occurs (#188)
Intermittent ChunkedEncodingErrors occurs while fetching URLs. This change try to fix it by retrying.
According to https://stackoverflow.com/a/44511691/374236, most servers transmit all data, but that's not what was observed.

For future reference the traceback was:

```
  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/runner/work/release-data/release-data/src/firefox.py", line 36, in <module>
      for response in endoflife.fetch_urls(urls):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/runner/work/release-data/release-data/src/common/endoflife.py", line 55, in fetch_urls
      return [future.result() for future in as_completed(futures)]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/runner/work/release-data/release-data/src/common/endoflife.py", line 55, in <listcomp>
      return [future.result() for future in as_completed(futures)]
              ^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/concurrent/futures/_base.py", line 449, in result
      return self.__get_result()
             ^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
      raise self._exception
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/concurrent/futures/thread.py", line 58, in run
      result = self.fn(*self.args, **self.kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
      resp = self.send(prep, **send_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/requests/sessions.py", line 747, in send
      r.content
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/requests/models.py", line 899, in content
      self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/requests/models.py", line 818, in generate
      raise ChunkedEncodingError(e)
  requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
```
2023-11-26 13:23:17 +01:00
Marc Wrobel
ca689dc373 Support parallel URL fetching via endoflife.fetch_urls (#184)
Move the parallel URL fetching from firefox.py to endoflife.py to make available parallel URL fetching for all scripts.

Also a a fix found on https://stackoverflow.com/a/44511691/374236 to avoid ChunkedEncodingError.
2023-11-26 11:34:18 +01:00
Marc Wrobel
f0324372d9 Use request instead of urllib for HTTP requests
It's simpler to use, and provides better retry capabilities.
2023-11-25 00:08:47 +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
Marc Wrobel
600e77e212 Sort versions by date then version for all products (#179) 2023-11-15 22:30:31 +01:00
Marc Wrobel
701c2899d5 [git] Migrate git method from Ruby to Python (#178)
The main reason for doing this is to have some common code between scripts, so that it is easier to change the JSON schema globally and normalize a few things (such as release order).

The Ruby code was kept as is so we can quickly roll back if necessary.
2023-11-12 20:33:29 +01:00
Marc Wrobel
94e04f3b4f Increase the default timeout value
Recently links to web.archive.org were added for various products. Such links are very long to load. This increases the default timeout value so that such links do not make the update fail.
2023-09-11 23:00:51 +02:00
Marc Wrobel
4aa7047fe1 Increase default retry count and timeout for python scripts
Frequent 'update data' workflow failures were observed lately, some due to timeout while fetching URLs.
2023-08-01 22:46:56 +02:00
Daniel
897d514e7f Add red-hat-openshift script (#119)
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.
2023-07-15 18:26:11 +02:00
Marc Wrobel
6ba7828f96 Refactor product releases writing
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.
2023-06-11 12:45:59 +02:00
Marc Wrobel
a16d9090d3 Refactor HTTP URL fetching 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).
2023-06-11 12:45:59 +02:00