Skip to content

Commit b331019

Browse files
authored
Merge pull request #2269 from Altinity/fix/antalya-26.6/cached-build-backfill-skipped
Antalya 26.6 - fix report skipped jobs backfill and prs table on tag runs
2 parents dfb0419 + a78aee1 commit b331019

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

‎.github/actions/create_workflow_report/create_workflow_report.py‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ def _find_release_baseline(
280280
branch_ref: str, repo: str, cwd: str | None
281281
) -> tuple[str | None, str | None, str | None]:
282282
"""Return (tag_name, tag_sha, published_date YYYY-MM-DD) for the latest
283-
non-draft release tag that is an ancestor of branch_ref."""
283+
non-draft release tag that is an ancestor of branch_ref.
284+
Version-tag refs skip the matching release so the range is previous→this tag.
285+
"""
284286
if not GITHUB_TOKEN:
285287
return None, None, None
286288
headers = {
@@ -295,6 +297,8 @@ def _find_release_baseline(
295297
raise Exception(
296298
f"GitHub API request failed: {response.status_code} {response.text}"
297299
)
300+
parsed = _parse_release_ref(branch_ref)
301+
skip_current = parsed is not None and parsed[2] is not None
298302
for rel in response.json():
299303
if rel.get("draft"):
300304
continue
@@ -306,6 +310,8 @@ def _find_release_baseline(
306310
continue
307311
if not _git_is_ancestor(tag_sha, branch_ref, cwd):
308312
continue
313+
if skip_current and _git_is_ancestor(branch_ref, tag_sha, cwd):
314+
continue
309315
published_at = rel.get("published_at") or rel.get("created_at") or ""
310316
published_date = published_at[:10] if published_at else None
311317
return tag_name, tag_sha, published_date
@@ -387,11 +393,18 @@ def get_prs_in_release_dataframe(
387393
check=False,
388394
)
389395

396+
parsed = _parse_release_ref(branch_ref)
397+
fetch_ref = (
398+
f"refs/tags/{branch_ref}"
399+
if parsed is not None and parsed[2] is not None
400+
else branch_ref
401+
)
402+
390403
baseline_sha = None
391404
baseline_date = None
392405
for _ in range(DEEPEN_CAP // DEEPEN_STEP):
393406
subprocess.run(
394-
["git", "fetch", f"--deepen={DEEPEN_STEP}", "origin", branch_ref],
407+
["git", "fetch", f"--deepen={DEEPEN_STEP}", "origin", fetch_ref],
395408
cwd=cwd,
396409
capture_output=True,
397410
text=True,
@@ -1116,11 +1129,12 @@ def backfill_skipped_statuses(
11161129

11171130
skipped_jobs = []
11181131
for job in workflow_result["results"]:
1119-
if job["status"] == "skipped" and len(job["links"]) > 0:
1132+
status = job["status"].lower()
1133+
if status == "skipped" and len(job["links"]) > 0:
11201134
skipped_jobs.append(
11211135
{
11221136
"job_name": job["name"],
1123-
"job_status": job["status"],
1137+
"job_status": status,
11241138
"message": job["info"],
11251139
"results_link": job["links"][0],
11261140
}

0 commit comments

Comments
 (0)