Skip to content

Commit 1e9bc75

Browse files
committed
refactor: enhance error handling in build_package function and add repository access testing in CI workflow
1 parent 835b38f commit 1e9bc75

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/build-citus-community-nightlies.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ jobs:
4242
app-id: ${{ vars.GH_APP_ID }}
4343
private-key: ${{ secrets.GH_APP_KEY }}
4444
owner: ${{ github.repository_owner }}
45+
repositories: citus,packaging,tools
46+
47+
- name: Debug - Test token access to repos
48+
env:
49+
GH_TOKEN: ${{ steps.app.outputs.token }}
50+
run: |
51+
echo "Testing token access to repositories..."
52+
for repo in citus packaging tools; do
53+
echo "Testing access to citusdata/$repo..."
54+
if gh api repos/citusdata/$repo --jq '.full_name' 2>/dev/null; then
55+
echo "✓ Access to citusdata/$repo OK"
56+
else
57+
echo "✗ No access to citusdata/$repo"
58+
fi
59+
done
60+
echo "Token scopes:"
61+
curl -sS -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/rate_limit | head -20
4562
4663
- name: Checkout repository
4764
uses: actions/checkout@v3

packaging_automation/citus_package.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,10 @@ def build_package(
360360
if output.stdout:
361361
print("Output:" + output.stdout)
362362
if output.returncode != 0:
363-
raise ValueError(output.stderr)
363+
error_msg = f"Docker command failed with return code {output.returncode}\n"
364+
error_msg += f"STDOUT:\n{output.stdout}\n" if output.stdout else "STDOUT: (empty)\n"
365+
error_msg += f"STDERR:\n{output.stderr}\n" if output.stderr else "STDERR: (empty)\n"
366+
raise ValueError(error_msg)
364367

365368
if input_output_parameters.output_validation:
366369
validate_output(

0 commit comments

Comments
 (0)