Skip to content

Commit 2b9088b

Browse files
committed
fix: [#459] increase crates.io index wait timeouts in publish workflow
- Bump all intermediate 'Wait for ... to Be Indexed' loops from 5-6×15s to 10×20s (~3 min each) to handle slow crates.io indexing days - Change final 'Verify SDK Is Available on crates.io' from hard exit 1 to warning + exit 0 after 30×20s (~10 min): cargo publish itself is the authoritative failure signal; this step is a best-effort availability check
1 parent 2e834f7 commit 2b9088b

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

.github/workflows/publish-crate.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ jobs:
127127
- name: Wait for torrust-tracker-deployer-types to Be Indexed
128128
run: |
129129
release_version="${{ steps.release.outputs.version }}"
130-
for attempt in 1 2 3 4 5 6; do
130+
for attempt in $(seq 1 10); do
131131
status=$(curl -s -o /tmp/crate-check.json -w "%{http_code}" "https://crates.io/api/v1/crates/${{ env.DEPLOYER_TYPES_CRATE }}/$release_version")
132132
if [[ "$status" == "200" ]]; then
133133
echo "${{ env.DEPLOYER_TYPES_CRATE }} $release_version is indexed on crates.io"
134134
break
135135
fi
136-
echo "Waiting for crates.io index (attempt $attempt/6)..."
137-
sleep 15
136+
echo "Waiting for crates.io index (attempt $attempt/10)..."
137+
sleep 20
138138
done
139139
140140
- name: Dry Run Publish torrust-tracker-deployer-dependency-installer
@@ -150,14 +150,14 @@ jobs:
150150
- name: Wait for torrust-tracker-deployer-dependency-installer to Be Indexed
151151
run: |
152152
release_version="${{ steps.release.outputs.version }}"
153-
for attempt in 1 2 3 4 5; do
153+
for attempt in $(seq 1 10); do
154154
status=$(curl -s -o /tmp/crate-check.json -w "%{http_code}" "https://crates.io/api/v1/crates/${{ env.DEPENDENCY_INSTALLER_CRATE }}/$release_version")
155155
if [[ "$status" == "200" ]]; then
156156
echo "${{ env.DEPENDENCY_INSTALLER_CRATE }} $release_version is indexed on crates.io"
157157
break
158158
fi
159-
echo "Waiting for crates.io index update (attempt $attempt/5)..."
160-
sleep 15
159+
echo "Waiting for crates.io index update (attempt $attempt/10)..."
160+
sleep 20
161161
done
162162
163163
- name: Dry Run Publish torrust-tracker-deployer
@@ -173,14 +173,14 @@ jobs:
173173
- name: Wait for torrust-tracker-deployer to Be Indexed
174174
run: |
175175
release_version="${{ steps.release.outputs.version }}"
176-
for attempt in 1 2 3 4 5; do
176+
for attempt in $(seq 1 10); do
177177
status=$(curl -s -o /tmp/crate-check.json -w "%{http_code}" "https://crates.io/api/v1/crates/${{ env.MAIN_CRATE }}/$release_version")
178178
if [[ "$status" == "200" ]]; then
179179
echo "${{ env.MAIN_CRATE }} $release_version is indexed on crates.io"
180180
break
181181
fi
182-
echo "Waiting for crates.io index update (attempt $attempt/5)..."
183-
sleep 15
182+
echo "Waiting for crates.io index update (attempt $attempt/10)..."
183+
sleep 20
184184
done
185185
186186
- name: Dry Run Publish torrust-tracker-deployer-sdk
@@ -196,18 +196,22 @@ jobs:
196196
- name: Verify SDK Is Available on crates.io
197197
run: |
198198
release_version="${{ steps.release.outputs.version }}"
199-
for attempt in $(seq 1 18); do
199+
for attempt in $(seq 1 30); do
200200
status=$(curl -s -o /tmp/crate-publish-check.json -w "%{http_code}" "https://crates.io/api/v1/crates/${{ env.SDK_CRATE }}/$release_version")
201201
if [[ "$status" == "200" ]]; then
202202
echo "SDK crate is available on crates.io"
203203
exit 0
204204
fi
205-
echo "Waiting for crates.io index update (attempt $attempt/18)..."
205+
echo "Waiting for crates.io index update (attempt $attempt/30)..."
206206
sleep 20
207207
done
208208
209-
echo "SDK crate was published but not visible yet. Check crates.io manually." >&2
210-
exit 1
209+
# crates.io indexing can be slow under load. The cargo publish step above
210+
# already returned zero — the crate is published. This check is best-effort.
211+
echo "SDK crate not yet visible after 10 minutes — verify manually:" >&2
212+
echo " https://crates.io/crates/${{ env.SDK_CRATE }}/$release_version" >&2
213+
echo "This is expected on slow crates.io days; it does not mean the publish failed."
214+
exit 0
211215
212216
- name: Verify docs.rs Build for SDK
213217
run: |

0 commit comments

Comments
 (0)