Files
endoflife-date-release-data/src/coldfusion.py
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

38 lines
2.1 KiB
Python

import re
from bs4 import BeautifulSoup
from common import dates, endoflife, http, releasedata
"""Fetches versions from Adobe ColdFusion release notes on helpx.adobe.com.
x.y.0 release dates are unfortunately not available in the release notes and have to updated them manually each time a
new minor version is released.
"""
VERSION_AND_DATE_PATTERN = re.compile(r"Release Date[,|:]? (.*?)\).*?Build Number: (.*?)$",
re.DOTALL | re.MULTILINE | re.IGNORECASE)
# .0 release dates are not available in the release notes.
FIXED_VERSIONS = {
"10.0.0": dates.date(2012, 5, 15), # https://en.wikipedia.org/wiki/Adobe_ColdFusion#Adobe_ColdFusion_10
"11.0.0": dates.date(2014, 4, 29), # https://en.wikipedia.org/wiki/Adobe_ColdFusion#Adobe_ColdFusion_11
"2016.0.0": dates.date(2016, 2, 16), # https://en.wikipedia.org/wiki/Adobe_ColdFusion#Adobe_ColdFusion_(2016_Release)
"2018.0.0": dates.date(2018, 7, 12), # https://coldfusion.adobe.com/2018/07/new-coldfusion-release-adds-performance-monitoring-toolset-for-measuring-monitoring-and-managing-high-performing-web-apps/
"2021.0.0": dates.date(2020, 11, 11), # https://community.adobe.com/t5/coldfusion-discussions/introducing-adobe-coldfusion-2021-release/m-p/11585468
"2023.0.0": dates.date(2022, 5, 16), # https://coldfusion.adobe.com/2023/05/coldfusion2023-release/
}
for config in endoflife.list_configs_from_argv():
with releasedata.ProductData(config.product) as product_data:
changelog = http.fetch_url(config.url)
changelog_soup = BeautifulSoup(changelog.text, features="html5lib")
for p in changelog_soup.findAll("div", class_="text"):
version_and_date_str = p.get_text().strip().replace('\xa0', ' ')
for (date_str, version_str) in VERSION_AND_DATE_PATTERN.findall(version_and_date_str):
date = dates.parse_date(date_str)
version = version_str.strip().replace(",", ".") # 11,0,0,289974 -> 11.0.0.289974
product_data.declare_version(version, date)
product_data.declare_versions(FIXED_VERSIONS)