[atlassian] Improve scripts

Replace jira and confluence script by a single atlassian-versions script

Also update the atlassian_eol so that:

- Pages are now fetched using Javascript,
- The regex also accept EOS in additional to EOL,
- The full identifier is now required as a parameter (this will make it easier if the name changes again).
This commit is contained in:
Marc Wrobel
2025-03-24 09:45:26 +01:00
parent b2c37b0643
commit 8f411b9479
4 changed files with 31 additions and 37 deletions

24
src/atlassian_versions.py Normal file
View File

@@ -0,0 +1,24 @@
import sys
from bs4 import BeautifulSoup
from common import dates, endoflife, http, releasedata
"""Fetches versions from Atlassian download-archives pages.
This script takes a single argument which is the url of the product's download-archives URL, such as
`https://www.atlassian.com/software/confluence/download-archives`.
"""
METHOD = "atlassian_versions"
p_filter = sys.argv[1] if len(sys.argv) > 1 else None
m_filter = sys.argv[2] if len(sys.argv) > 2 else None
for config in endoflife.list_configs(p_filter, METHOD, m_filter):
with releasedata.ProductData(config.product) as product_data:
content = http.fetch_javascript_url(config.url, wait_until='networkidle')
soup = BeautifulSoup(content, 'html5lib')
for version_block in soup.select('.versions-list'):
version = version_block.select_one('a.product-versions').attrs['data-version']
date = dates.parse_date(version_block.select_one('.release-date').text)
product_data.declare_version(version, date)