Skip to content

Commit 49e0ced

Browse files
authored
ci(check-links): do not fail-fast when receiving http 429 errors (#875)
Workaround for HTTP 429 errors returned by GitHub. Run the check several times if needed until it passes. As it uses the cache from the first run, fewer requests are sent to GH, so the subsequent runs may not have errors. Tests show that all errors are gone after 3 run (sometimes, some remains in the 2nd run). Run at most 5 times to give more chance to succeed. Also update the configuration to ignore other sites that introduced new protection rules which now reject htmltest with errors HTTP 403.
1 parent d554255 commit 49e0ced

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/workflows/check-links.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,31 @@ jobs:
5151
curl https://htmltest.wjdp.uk | bash -s -- -b scripts/htmltest v0.17.0
5252
echo "Installation done"
5353
./scripts/htmltest/htmltest --version
54+
55+
# Retry the link check multiple times to reduce false positives from temporary network issues.
56+
# Each retry uses cache from previous runs to minimize external requests and speed up subsequent checks.
57+
# Mitigates HTTP 429 (rate limit) errors from GitHub by reusing cached results and retrying until success.
5458
- name: Check links
55-
working-directory: scripts/htmltest
56-
run: |
57-
./htmltest -c ./htmltest_bonita-documentation-site.yml ../../build/site
59+
id: check_links
60+
uses: nick-fields/retry@v3
61+
with:
62+
timeout_minutes: 15 # the first analysis takes around 7 minutes
63+
max_attempts: 5
64+
# use a workaround as there is no working directory input in the retry action, see https://github.com/nick-fields/retry/issues/89
65+
command: |
66+
cd scripts/htmltest
67+
./htmltest -c ./htmltest_bonita-documentation-site.yml ../../build/site
68+
5869
- name: Upload links analysis
5970
if: always()
6071
uses: actions/upload-artifact@v4
6172
with:
62-
name: check-links-analysis-${{github.sha}}
73+
name: check-links-analysis-${{ github.sha }}
6374
path: scripts/htmltest/config
6475

76+
6577
# This step is commented out because we don't want to send notifications to Slack for now, we can uncomment it later, when all errors will be fixed.
66-
# For now, we will monitor the workflow resultt each week manually.
78+
# For now, we will monitor the workflow result each week manually.
6779
# - name: Send message to Slack channel
6880
# if: failure() && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.slack-notifications == 'true') )
6981
# uses: bonitasoft/notify-slack-action@v1
@@ -77,4 +89,3 @@ jobs:
7789
# - Add a :sweat_drops: when it’s done (and eventually a :party_parrot:)
7890
# Run the logs of the GitHub workflow run or download the check links analysis to find the pages including the broken links.
7991
# Then, create a Pull Request in the related content repository to fix the broken links (do the fix on the oldest version including the problem).
80-

scripts/htmltest/htmltest_bonita-documentation-site.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ IgnoreDirs:
1010
- bonita/.*/dependencies
1111

1212
IgnoreURLs:
13+
# canonical URLs, we don't want to check them
14+
- "documentation.bonitasoft.com"
1315
# Links used to demonstrate the target url in various examples
1416
- "bonita.server.url.to.change"
1517
- "idp.saml.binding.url.to.change"
@@ -41,6 +43,10 @@ IgnoreURLs:
4143
# Twitter requires authentication
4244
- "twitter.com/bonitasoft"
4345
- "x.com/bonitasoft"
46+
# 403 errors due to Cloudflare protections, see https://github.com/orgs/community/discussions/174098
47+
- "npmjs.com"
48+
# 403 errors, probably due to Cloudflare protections
49+
- "swapi.py4e.com"
4450

4551

4652
# Simulate a user agent of a real browser, because some sites block requests with the default user agent set by htmltest.

0 commit comments

Comments
 (0)