@@ -69,34 +69,65 @@ jobs:
6969 - name : Install python requirements
7070 run : python -m pip install -r tools/packaging_automation/requirements.txt
7171
72- - name : " Debug: run packaging image the same way (capture logs) "
72+ - name : Debug: download and inspect GitHub tarball (host)
7373 run : |
74- mkdir -p container_logs
75- docker run --rm \
76- -v "$(pwd)/packages":/packages \
77- -v "$(pwd)/packaging":/buildfiles:ro \
78- -e GITHUB_TOKEN \
79- -e PACKAGE_ENCRYPTION_KEY="${PACKAGING_SECRET_KEY}" \
80- -e UNENCRYPTED_PACKAGE="" \
81- -e CONTAINER_BUILD_RUN_ENABLED=true \
82- -e MSRUSTUP_PAT \
83- -e CRATES_IO_MIRROR_FEED_TOKEN \
84- -e INSTALL_RUST \
85- -e CI \
86- -e PACKAGING_PASSPHRASE \
87- citus/packaging-test:debian-trixie-all nightly \
88- > container_logs/container.stdout 2> container_logs/container.stderr || true
89- echo "---- container.stderr (first 200 lines) ----"
90- sed -n '1,200p' container_logs/container.stderr || true
91- echo "---- container.stdout (first 200 lines) ----"
92- sed -n '1,200p' container_logs/container.stdout || true
93-
94- - name : " Debug: Verify packaging dir contains expected inputs"
95- run : |
96- echo "Searching for key packaging files:"
97- find packaging -maxdepth 4 -type f \( -name 'pkgvars' -o -name 'postgres-matrix.yml' -o -name 'supported-postgres' \) -print || true
98- echo "Packaging directory structure:"
99- ls -la packaging/ || true
74+ set -euo pipefail
75+
76+ # read pkgvars from the cloned packaging repo (this is where hubproj/nightlyref come from)
77+ echo "---- packaging/pkgvars ----"
78+ sed -n '1,120p' packaging/pkgvars
79+
80+ # load variables from pkgvars (same as container does)
81+ set -a
82+ source packaging/pkgvars
83+ set +a
84+
85+ pkgname="${deb_pkgname:-${pkgname}}"
86+ hubproj="${hubproj:-${pkgname}}"
87+ nightlyref="${nightlyref:-master}"
88+ repopath="citusdata/${hubproj}"
89+
90+ echo "DEBUG pkgname=$pkgname hubproj=$hubproj nightlyref=$nightlyref"
91+ echo "DEBUG repopath=$repopath nightlyref=$nightlyref"
92+
93+ echo "DEBUG GitHub API status for repo:"
94+ curl -s -o /dev/null -w "%{http_code}\n" \
95+ -H "Authorization: token ${GH_TOKEN}" \
96+ "https://api.github.com/repos/${repopath}"
97+
98+ # resolve gitsha the same way as fetch_and_build_deb
99+ gitsha=$(curl -sfH "Authorization: token ${GH_TOKEN}" \
100+ -H "Accept: application/vnd.github.v3.sha" \
101+ "https://api.github.com/repos/${repopath}/commits/${nightlyref}")
102+ echo "DEBUG gitsha=$gitsha"
103+
104+ # download tarball and inspect it
105+ curl -sfL -H "Authorization: token ${GH_TOKEN}" \
106+ "https://api.github.com/repos/${repopath}/tarball/${gitsha}" \
107+ -o /tmp/src.tgz
108+
109+ echo "DEBUG tarball file:"
110+ ls -lh /tmp/src.tgz
111+
112+ echo "DEBUG does tarball contain .gitmodules?"
113+ tar -tzf /tmp/src.tgz | grep -E '/\.gitmodules$' || echo "No .gitmodules found in tarball"
114+
115+ echo "DEBUG top-level listing (first 80 entries):"
116+ tar -tzf /tmp/src.tgz | sed -n '1,80p'
117+
118+ # if it exists, print the .gitmodules content from inside the tarball
119+ gm_path=$(tar -tzf /tmp/src.tgz | grep -E '/\.gitmodules$' | head -n 1 || true)
120+ if [ -n "${gm_path}" ]; then
121+ echo "DEBUG .gitmodules path in tarball: $gm_path"
122+ tar -xOzf /tmp/src.tgz "$gm_path" | sed -n '1,120p'
123+ fi
124+
125+ - uses : actions/upload-artifact@v4
126+ if : always()
127+ continue-on-error : true
128+ with :
129+ name : github-tarball
130+ path : /tmp/src.tgz
100131
101132 - name : Build packages
102133 run : |
0 commit comments