[red-hat-jboss-eap] Automation version retrieval (#414)

red-hat-jboss-eap-7.py retrieves all the 7.x versions based on https://access.redhat.com/articles/2332721.

red-hat-jboss-eap-8.py retrieves only the last 8.x version based on https://maven.repository.redhat.com/ga/org/jboss/eap/channels/eap-8.0/maven-metadata.xml (the version date is approximated using the lastUpdated tag).

---------

Co-authored-by: Denis Fuenzalida 🐙 <defuenza@microsoft.com>
Co-authored-by: Marc Wrobel <marc.wrobel@gmail.com>
This commit is contained in:
Denis Fuenzalida
2025-05-02 08:31:12 -07:00
committed by GitHub
parent 2453b431e3
commit 54ef082add
3 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import logging
from bs4 import BeautifulSoup
from common import dates, http, releasedata
"""Fetches RedHat JBoss EAP version data for JBoss 7"""
with releasedata.ProductData("red-hat-jboss-eap") as product_data:
response = http.fetch_url("https://access.redhat.com/articles/2332721")
soup = BeautifulSoup(response.text, features="html5lib")
for h4 in soup.find_all("h4"):
title = h4.get_text(strip=True)
if not title.startswith("7."):
continue
release = title[:3]
version_table = h4.find_next("table")
if not version_table:
logging.warning(f"Version table not found for {title}")
continue
for (i, row) in enumerate(version_table.find_all("tr")):
if i == 0: # Skip the first row (header)
continue
columns = row.find_all("td")
# Get the version name without the content of the <sup> tag, if present
name_str = ''.join([content for content in columns[0].contents if isinstance(content, str)]).strip()
date_str = columns[1].text.strip()
if date_str == "TBD": # Placeholder for a future release
continue
name = name_str.replace("GA", "Update 0").replace("Update ", release + ".")
date = dates.parse_date(date_str)
product_data.declare_version(name, date)