Skip to content

Commit e6c9e07

Browse files
fix get release date
1 parent 5ad270b commit e6c9e07

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

monitor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ def fetch_release_date(release):
3636
if "Created:" in p_ele:
3737
start_date = p_ele.split(" ")[1]+" "+p_ele.split(" ")[2]
3838
break
39+
else:
40+
prefix, number = release.rsplit(".", 1)
41+
prev_version = prefix + "." + str(int(number) - 1)
42+
changelog_url = f"https://ppc64le.ocp.releases.ci.openshift.org/changelog?from={prev_version}&to={release}"
43+
changelog_resp = requests.get(changelog_url, verify=False, timeout=15)
44+
if changelog_resp.status_code == 200:
45+
lines = changelog_resp.text.splitlines()
46+
for line in lines:
47+
if "Created:" in line:
48+
start_date = line.split(" ")[1]+" "+line.split(" ")[2]
49+
return start_date
50+
3951
return start_date
4052
else:
4153
print(f"Failed to get the release page. {response.text}")

0 commit comments

Comments
 (0)