Skip to content

Commit e933500

Browse files
committed
Fix further CI issues
Occasionally, we can't get the latest version from GitHub, causing intermittent CI errors. The culprit is this URL: `api.github.com/repos/timescale/timescaledb/releases/latest`. I added better reporting in the CI workflows so it is more obvious when this happens, and I also added more retries and error handling to 'wget'. Disable-check: force-changelog-file
1 parent 8e91d95 commit e933500

3 files changed

Lines changed: 35 additions & 11 deletions

File tree

.github/workflows/apt-installcheck.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,19 @@ jobs:
7272
- name: Get version of latest release
7373
id: versions
7474
run: |
75-
version=$(wget -q --tries=6 --waitretry=15 https://api.github.com/repos/timescale/timescaledb/releases/latest -O - | jq -r .tag_name)
76-
echo "version=${version}"
77-
echo "version=${version}" >>$GITHUB_OUTPUT
75+
version=$(wget -q --tries=9 --wait=30 --retry-connrefused --retry-on-http-error=503,403 https://api.github.com/repos/timescale/timescaledb/releases/latest -O - | jq -r .tag_name)
76+
if [ -z "$version" ]; then
77+
echo "ERROR: Failed to get api version from github. This is a CI issue." >>$GITHUB_OUTPUT
78+
echo "See the raw logs for verbose output" >>$GITHUB_OUTPUT
79+
wget -v https://api.github.com/repos/timescale/timescaledb/releases/latest -O -
80+
false
81+
else
82+
echo "version=${version}"
83+
echo "version=${version}" >>$GITHUB_OUTPUT
7884
79-
grep PRETTY_NAME /etc/os-release >> $GITHUB_OUTPUT
80-
echo "arch=$(uname -m)" >> $GITHUB_OUTPUT
85+
grep PRETTY_NAME /etc/os-release >> $GITHUB_OUTPUT
86+
echo "arch=$(uname -m)" >> $GITHUB_OUTPUT
87+
fi
8188
8289
- name: Test Installation
8390
id: installation
@@ -89,6 +96,7 @@ jobs:
8996
installed_version=$(sudo -u postgres psql -X -t \
9097
-c "SELECT extversion FROM pg_extension WHERE extname='timescaledb';" | sed -e 's! !!g')
9198
if [ "${{ steps.versions.outputs.version }}" != "$installed_version" ];then
99+
echo "ERROR: Version mismatch: ${{ steps.versions.outputs.version }} != $installed_version" >>$GITHUB_OUTPUT
92100
false
93101
fi
94102

.github/workflows/apt-packages.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ jobs:
7979
- name: Get version of latest release
8080
id: versions
8181
run: |
82-
version=$(wget -q --tries=6 --waitretry=15 https://api.github.com/repos/timescale/timescaledb/releases/latest -O - | jq -r .tag_name)
83-
echo "version=${version}"
84-
echo "version=${version}" >>$GITHUB_OUTPUT
82+
version=$(wget -q --tries=9 --wait=30 --retry-connrefused --retry-on-http-error=503,403 https://api.github.com/repos/timescale/timescaledb/releases/latest -O - | jq -r .tag_name)
83+
if [ -z "$version" ]; then
84+
echo "ERROR: Failed to get api version from github. This is a CI issue." >>$GITHUB_OUTPUT
85+
echo "See the raw logs for verbose output" >>$GITHUB_OUTPUT
86+
wget -v https://api.github.com/repos/timescale/timescaledb/releases/latest -O -
87+
false
88+
else
89+
echo "version=${version}"
90+
echo "version=${version}" >>$GITHUB_OUTPUT
91+
fi
8592
8693
- name: Test Installation
8794
run: |
@@ -91,6 +98,7 @@ jobs:
9198
installed_version=$(sudo -u postgres psql -X -t \
9299
-c "SELECT extversion FROM pg_extension WHERE extname='timescaledb';" | sed -e 's! !!g')
93100
if [ "${{ steps.versions.outputs.version }}" != "$installed_version" ];then
101+
echo "ERROR: Version mismatch: ${{ steps.versions.outputs.version }} != $installed_version" >>$GITHUB_OUTPUT
94102
false
95103
fi
96104

.github/workflows/rpm-packages.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@ jobs:
7373
- name: Get version of latest release
7474
id: versions
7575
run: |
76-
version=$(wget -q --tries=6 --waitretry=15 https://api.github.com/repos/timescale/timescaledb/releases/latest -O - | jq -r .tag_name)
77-
echo "version=${version}"
78-
echo "version=${version}" >>$GITHUB_OUTPUT
76+
version=$(wget -q --tries=9 --wait=30 --retry-connrefused --retry-on-http-error=503,403 https://api.github.com/repos/timescale/timescaledb/releases/latest -O - | jq -r .tag_name)
77+
if [ -z "$version" ]; then
78+
echo "ERROR: Failed to get api version from github. This is a CI issue." >>$GITHUB_OUTPUT
79+
echo "See the raw logs for verbose output" >>$GITHUB_OUTPUT
80+
wget -v https://api.github.com/repos/timescale/timescaledb/releases/latest -O -
81+
false
82+
else
83+
echo "version=${version}"
84+
echo "version=${version}" >>$GITHUB_OUTPUT
85+
fi
7986
8087
- name: Test Installation
8188
run: |
@@ -86,6 +93,7 @@ jobs:
8693
installed_version=$(sudo -u postgres psql -X -t \
8794
-c "SELECT extversion FROM pg_extension WHERE extname='timescaledb';" | sed -e 's! !!g')
8895
if [ "${{ steps.versions.outputs.version }}" != "$installed_version" ];then
96+
echo "ERROR: Version mismatch: ${{ steps.versions.outputs.version }} != $installed_version" >>$GITHUB_OUTPUT
8997
false
9098
fi
9199

0 commit comments

Comments
 (0)