Skip to content

Commit 0ea7b5f

Browse files
committed
Add logging to internal_build.py
1 parent 022a782 commit 0ea7b5f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/internal-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
CI_CLIENT_SECRET: ${{ secrets.CI_CF_ACCESS_CLIENT_SECRET }}
2727
run: |
2828
python3 ./tools/cross/internal_build.py \
29-
${{github.event.pull_request.id}} \
29+
${{github.event.pull_request.number}} \
3030
${{github.event.pull_request.head.sha}} \
31-
$GITHUB_RUN_ATTEMPT \
31+
${{github.run_attempt}} \
3232
"${{github.event.pull_request.head.ref}}" \
3333
$CI_URL \
3434
$CI_CLIENT_ID \

tools/cross/internal_build.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ def parse_args():
3737
resp = requests.post(args.URL, headers=headers, json=payload)
3838
resp.raise_for_status()
3939

40-
workflow_id = resp.json().id
40+
workflow_id = resp.json()["workflow_id"]
4141
except Exception as err:
4242
print(f"Unexpected error {err=}, {type(err)=}")
4343
sys.exit(1)
4444

45+
print("Internal build submitted")
46+
4547
time.sleep(30)
4648

4749
# Poll build status
@@ -53,12 +55,15 @@ def parse_args():
5355
resp = requests.get(args.URL, headers=headers, params={ 'id': workflow_id })
5456
resp.raise_for_status()
5557

56-
status = resp.json().status
58+
status = resp.json()["status"]
5759
if status == "errored":
60+
print("Build failed")
5861
sys.exit(1)
5962
elif status == "complete":
6063
break
6164

65+
print("Waiting for build to finish..")
66+
6267
except Exception as err:
6368
print(f"Unexpected error {err=}, {type(err)=}")
6469
failed_requests = failed_requests + 1

0 commit comments

Comments
 (0)