8000 #557: Reject crawler results below MIN_CRAWLER_VERSION with 426 by blueheron786 · Pull Request #573 · mwmbl/mwmbl · GitHub
[go: up one dir, main page]

Skip to content

#557: Reject crawler results below MIN_CRAWLER_VERSION with 426 - #573

Merged
daoudclarke merged 3 commits into
mwmbl:mainfrom
blueheron786:min-crawler-version-426
Oct 31, 2026
Merged

daoudclarke merged 3 commits into
mwmbl:mainfrom
blueheron786:min-crawler-version-426

Conversation

@blueheron786
Copy link
Copy Markdown
Collaborator

Part of #557.

Step 3 of the issue's suggested order. The version-spread dashboard (#558 + mwmbl/front-end#99) and tagged crawler releases (crawler-v1.0.0/1.0.1) are merged, so the server can now tell old crawlers to upgrade.

What

  • New MIN_CRAWLER_VERSION setting (settings_common.py), default "0.0.0" so every crawler passes until an admin raises it once the dashboard shows the fleet has moved.
  • POST /api/v1/crawler/results returns 426 Upgrade Required when the submitted crawler_version is below the minimum (versions compared as numeric tuples via a new parse_release_version in mwmbl/crawler/version.py; a missing or malformed version counts as 0.0.0). Applies to dry runs too. 426 added to the route's response schema and docs.
  • The crawler (mwmbl/crawl.py) treats 426 specially: logs the server's message and waits UPGRADE_REQUIRED_WAIT_SECONDS (1h) instead of raise_for_status(), so it waits for an external updater rather than crash-looping; all other error statuses still raise.
  • CRAWLER_VERSION raised to 1.0.2 (this changes what the crawler runs; release_check passes).

How it was verified

  • make check passes; python -m mwmbl.crawler.release_check origin/main reports the version was raised.
  • Full suite: 1707 passed, 10 skipped.
  • New tests in test/test_crawler_min_version.py cover the 426 (below/at/above minimum, numeric vs string comparison, missing/malformed version, dry run, invalid setting) and test/test_crawl_functional.py covers the crawler waiting on 426 while still raising on other error statuses.

Next steps after this: Docker auto-update timer on the stable tag + book docs, then optionally extracting a pure-Python mwmbl-crawler package.

Part of #557. The version-spread dashboard (#558) and tagged crawler
releases are merged, so the server can now tell old crawlers to upgrade:
POST /api/v1/crawler/results returns 426 Upgrade Required when the
submitted crawler_version is below the new MIN_CRAWLER_VERSION setting
(default 0.0.0, which accepts every crawler, including ones too old to
report a version). The crawler waits out an hour on a 426 instead of
crash-looping, giving an external updater time to replace the process.

CRAWLER_VERSION is raised to 1.0.2 because this changes what the
crawler runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@daoudclarke
Copy link
Copy Markdown
Contributor

Looks good - can you fix the conflicts and I'll merge ❤️

@daoudclarke
daoudclarke merged commit 159bf9a into mwmbl:main Oct 31, 2026
4 checks passed
@blueheron786
blueheron786 deleted the min-crawler-version-426 branch October 31, 2026 17:17
@blueheron786
blueheron786 restored the min-crawler-version-426 branch November 1, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0