Skip to content

Commit 450cbce

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 450cbce

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
@@ -71,13 +71,20 @@ jobs:
7171

7272
- name: Get version of latest release
7373
id: versions
74+
env:
75+
GH_TOKEN: ${{ github.token }}
7476
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
77+
version=$(gh api repos/${{ github.repository }}/releases/latest --jq .tag_name)
78+
if [ -z "$version" ]; then
79+
echo "ERROR: Failed to get api version from github. This is a CI issue." >>$GITHUB_OUTPUT
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
@@ -78,10 +78,17 @@ jobs:
7878

7979
- name: Get version of latest release
8080
id: versions
81+
env:
82+
GH_TOKEN: ${{ github.token }}
8183
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
84+
version=$(gh api repos/${{ github.repository }}/releases/latest --jq .tag_name)
85+
if [ -z "$version" ]; then
86+
echo "ERROR: Failed to get api version from github. This is a CI issue." >>$GITHUB_OUTPUT
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
@@ -72,10 +72,17 @@ jobs:
7272

7373
- name: Get version of latest release
7474
id: versions
75+
env:
76+
GH_TOKEN: ${{ github.token }}
7577
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
78+
version=$(gh api repos/${{ github.repository }}/releases/latest --jq .tag_name)
79+
if [ -z "$version" ]; then
80+
echo "ERROR: Failed to get api version from github. This is a CI issue." >>$GITHUB_OUTPUT
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)