[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:
@@ -5,24 +5,24 @@ import sys
|
||||
from bs4 import BeautifulSoup
|
||||
from common import dates, endoflife, http, releasedata
|
||||
|
||||
"""Fetches EOL dates Atlassian EOL page.
|
||||
"""Fetches EOL dates from Atlassian EOL page.
|
||||
|
||||
The only needed argument is the last part of the product title identifier on the Atlassian EOL page,
|
||||
such as `JiraSoftware` (from `AtlassianSupportEndofLifePolicy-JiraSoftware`).
|
||||
This script takes a single argument which is the product title identifier on the Atlassian EOL page, such as
|
||||
`AtlassianSupportEndofLifePolicy-JiraSoftware`.
|
||||
"""
|
||||
|
||||
METHOD = "atlassian_eol"
|
||||
REGEX = r"(?P<release>\d+(\.\d+)+) \(EOL date: (?P<date>.+)\).*$"
|
||||
REGEX = r"(?P<release>\d+(\.\d+)+) \(EO[SL] date: (?P<date>.+)\).*$"
|
||||
PATTERN = re.compile(REGEX, re.MULTILINE)
|
||||
|
||||
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:
|
||||
response = http.fetch_url('https://confluence.atlassian.com/support/atlassian-support-end-of-life-policy-201851003.html')
|
||||
soup = BeautifulSoup(response.text, features="html5lib")
|
||||
content = http.fetch_javascript_url('https://confluence.atlassian.com/support/atlassian-support-end-of-life-policy-201851003.html')
|
||||
soup = BeautifulSoup(content, features="html5lib")
|
||||
|
||||
for li in soup.select(f"#AtlassianSupportEndofLifePolicy-{config.url}+ul li"):
|
||||
for li in soup.select(f"#{config.url}+ul li"):
|
||||
match = PATTERN.match(li.get_text(strip=True))
|
||||
if not match:
|
||||
logging.warning(f"Failed to parse EOL date from '{li.get_text(strip=True)}'")
|
||||
|
||||
Reference in New Issue
Block a user