Repository navigation
Conversation
[Medium impact] Changes how the live-check test script reports Cloudflare blocks. Fix response-to-step tracking before merging so a timed-out search cannot hide a real plugin failure. FindingsSummaryThe checker now observes Cloudflare responses during plugin requests and changes affected failed steps to
Reviews (1) · Last reviewed commit: "no-mistakes(document): Document Cloudfla..." · Reviewed by Greptile |
| const res = await originalFetch(...args); | ||
| const step = currentStep; |
There was a problem hiding this comment.
installChallengeDetector reads currentStep after the request finishes. If searchNovels times out, its request keeps running while the checker starts parseNovel. A late Cloudflare response from that search then marks parseNovel as blocked, hiding a real failure there as INCONCLUSIVE.
Capture the step before awaiting the request, and add a test for a late response crossing steps.
| const res = await originalFetch(...args); | |
| const step = currentStep; | |
| const step = currentStep; | |
| const res = await originalFetch(...args); |
| @@ -0,0 +1,97 @@ | |||
| // Run with: node --test scripts/live-check-plugin.test.mjs | |||
There was a problem hiding this comment.
No package script or workflow runs scripts/live-check-plugin.test.mjs. The live-check workflow also skips execution when only checker files change, so these six tests cannot catch regressions automatically.
Add a CI step that runs these local-server tests when the checker or its tests change.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Intent
Open a small separate upstream PR so the shared Plugin Live Check reports "couldn't test (Cloudflare)" (INCONCLUSIVE) instead of "failed" when page loads are blocked by Cloudflare. Royal Road PR #2665 stays as is with its Cloudflare explanation; once this checker fix merges, its check stops failing, as does every other Cloudflare-blocked source's.
Context: on GitHub's runners Cloudflare blocks every royalroad.com HTML page (home, search, listings, novel pages, chapters), with any request style. The checker marks it FAIL rather than INCONCLUSIVE because its root reachability probe (HEAD of the site root, passes on any status < 400) gets through while the real page loads do not. fetchApi (src/lib/fetch.ts) returns the Response for any status and never throws, so a Cloudflare challenge page (served as 403 or 200) parses to zero novels and the checker scores FAIL "Returned no novels"; the existing 403/Cloudflare classification applies only to thrown errors and to the root probe. Failing run: https://github.com/lnreader/lnreader-plugins/actions/runs/38055684264.
What Changed
scripts/live-check-plugin.jsnow wraps the globalfetchduring each step to spot Cloudflare challenge responses (cf-mitigated: challenge, or a 403/503 carryingcf-*headers) on the plugin's own page loads. A step that would otherwiseFAILafter such a response is reclassified asINCONCLUSIVEwith a "Blocked by Cloudflare" detail. Passing steps and failures with no observed challenge are unchanged.describeCloudflareChallenge,installChallengeDetectorandcheckPlugin, and only runsmain()when executed directly, so it can be imported by tests.scripts/live-check-plugin.test.mjs, which covers the new detection and reclassification logic. Updated theINCONCLUSIVEdescription indocs/testing.mdto mention challenge pages served for a plugin's page loads.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change is confined to the live-check script and only downgrades FAIL to INCONCLUSIVE when a Cloudflare challenge response was seen during that step; its tests run the real checker against a local server.
Testing
The 6 node tests in
scripts/live-check-plugin.test.mjspass. They run the realcheckPluginagainst local HTTP servers that serve a challenge as 403 or 200, a 403 with Cloudflare headers, an empty result, a plain 403 and a passing page. I also ran the checker as a CLI against a local server that returns a Cloudflare challenge on its list page while the root probe succeeds. The report showed INCONCLUSIVE ("Blocked by Cloudflare…"), "no hard failures" and exit code 0. I did not test against the real royalroad.com. The worktree stayed clean.Evidence: CLI report for a challenged plugin
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm ci --ignore-scriptsnode --test scripts/live-check-plugin.test.mjsnode scripts/live-check-plugin.js <plugin>against a local server that returns a Cloudflare challenge on its list page✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.