Skip to content

Commit 1aa8304

Browse files
committed
add github run id to workflow report path
1 parent b203f3f commit 1aa8304

File tree

12 files changed

+20
-18
lines changed

12 files changed

+20
-18
lines changed

.github/actions/create_workflow_report/create_workflow_report.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,10 @@ def get_pr_info_from_number(pr_number: str) -> dict:
122122
return response.json()
123123

124124

125-
def get_run_details(run_url: str) -> dict:
125+
def get_run_details(run_id: str) -> dict:
126126
"""
127127
Fetch run details for a given run URL.
128128
"""
129-
run_id = run_url.split("/")[-1]
130-
131129
headers = {
132130
"Authorization": f"token {GITHUB_TOKEN}",
133131
"Accept": "application/vnd.github.v3+json",
@@ -732,7 +730,9 @@ def create_workflow_report(
732730
if not all([host, user, password, GITHUB_TOKEN]):
733731
raise Exception("Required environment variables are not set")
734732

735-
run_details = get_run_details(actions_run_url)
733+
run_id = actions_run_url.split("/")[-1]
734+
735+
run_details = get_run_details(run_id)
736736
branch_name = run_details.get("head_branch", "unknown branch")
737737
if pr_number is None or commit_sha is None:
738738
if pr_number is None:
@@ -821,7 +821,7 @@ def create_workflow_report(
821821
"s3_bucket": S3_BUCKET,
822822
"pr_info_html": pr_info_html,
823823
"pr_number": pr_number,
824-
"workflow_id": actions_run_url.split("/")[-1],
824+
"workflow_id": run_id,
825825
"commit_sha": commit_sha,
826826
"base_sha": "" if pr_number == 0 else pr_info.get("base", {}).get("sha"),
827827
"date": f"{datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')} UTC",
@@ -875,9 +875,11 @@ def create_workflow_report(
875875
exit(0)
876876

877877
if pr_number == 0:
878-
report_destination_key = f"REFs/{branch_name}/{commit_sha}/{report_name}"
878+
report_destination_key = f"REFs/{branch_name}/{commit_sha}"
879879
else:
880-
report_destination_key = f"PRs/{pr_number}/{commit_sha}/{report_name}"
880+
report_destination_key = f"PRs/{pr_number}/{commit_sha}"
881+
882+
report_destination_key += f"/{run_id}/{report_name}"
881883

882884
# Upload the report to S3
883885
s3_client = boto3.client("s3", endpoint_url=os.getenv("S3_URL"))

.github/workflows/backport_branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
else
6969
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
7070
fi
71-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
71+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
7272
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
7373
7474
- name: Prepare env script

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
else
6868
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
6969
fi
70-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
70+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
7171
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
7272
7373
- name: Prepare env script

.github/workflows/merge_queue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
else
5757
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
5858
fi
59-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
59+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
6060
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
6161
6262
- name: Prepare env script

.github/workflows/nightly_fuzzers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
else
4545
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
4646
fi
47-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
47+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
4848
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
4949
5050
- name: Prepare env script

.github/workflows/nightly_jepsen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
else
4545
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
4646
fi
47-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
47+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
4848
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
4949
5050
- name: Prepare env script

.github/workflows/nightly_statistics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
else
4545
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
4646
fi
47-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
47+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
4848
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
4949
5050
- name: Prepare env script

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
else
6969
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
7070
fi
71-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
71+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
7272
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
7373
7474
- name: Prepare env script

.github/workflows/release_branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
else
6868
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
6969
fi
70-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
70+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
7171
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
7272
7373
- name: Prepare env script

.github/workflows/release_builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
else
5656
PREFIX="PRs/$PR_NUMBER/$COMMIT_SHA"
5757
fi
58-
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/ci_run_report.html
58+
REPORT_LINK=https://s3.amazonaws.com/altinity-build-artifacts/$PREFIX/$GITHUB_RUN_ID/ci_run_report.html
5959
echo "Workflow Run Report: [View Report]($REPORT_LINK)" >> $GITHUB_STEP_SUMMARY
6060
6161
- name: Prepare env script

0 commit comments

Comments
 (0)