Skip to content

fix(docker): preserve valid seeds in crawl batches - #2347

Open
nightcityblade wants to merge 1 commit into
unclecode:developfrom
nightcityblade:fix/issue-2288
Open

nightcityblade wants to merge 1 commit into
unclecode:developfrom
nightcityblade:fix/issue-2288

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

Summary

Fixes #2288.

Mixed /crawl batches now keep destination validation per seed: blocked or unresolvable seeds become opaque failed results, while valid seeds are still crawled. Results and per-URL crawler configs retain their original input order. Single-URL requests keep the existing HTTP 400 behavior.

List of files changed and why

  • deploy/docker/api.py - Partition multi-URL batches into valid seeds and per-seed validation failures, crawl the valid subset, and merge results in request order.
  • tests/test_docker_pdf_crawler_pairing.py - Add regression coverage for one blocked seed alongside one valid seed.

How Has This Been Tested?

  • uv sync --python 3.12 --frozen --dev
  • uv pip install --python .venv/bin/python -r deploy/docker/requirements.txt -r deploy/docker/tests/requirements.txt pytest pytest-asyncio black ruff
  • .venv/bin/python -m pytest deploy/docker/tests/test_security_ssrf_crawl.py tests/test_docker_pdf_crawler_pairing.py -q — 37 passed
  • .venv/bin/ruff check --select E9,F63,F7,F82 deploy/docker/api.py tests/test_docker_pdf_crawler_pairing.py — passed
  • .venv/bin/python -m compileall -q deploy/docker/api.py tests/test_docker_pdf_crawler_pairing.py — passed
  • Manual async handler regression with one blocked and one valid seed — passed; only the valid URL reached arun_many, and both ordered results were returned
  • git diff --check upstream/develop...HEAD — passed

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation — N/A; no public API or configuration changed
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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.

1 participant