Search/download/rescan/community support#1
Merged
Conversation
|
This seems reasonable at first glance but I think blocks on TODOs from associated consumer PR |
mjkoo
approved these changes
Feb 19, 2019
Contributor
Author
|
Should be ready, holding off merge until consumer changes make it to prod. |
sbneto
added a commit
that referenced
this pull request
May 26, 2026
Bot review + import-surface audit caught real issues across two areas. Bug fix (bot #1): ReportTemplate.upload_logo built a PolyswarmRequest with `data=` carrying a file-like. httpx 0.27 reserves `data=` for Mapping form bodies — a raw byte payload must go through `content=`. Under requests this worked; under httpx it didn't. Read the file into bytes and pass `content=` so the outbound PUT body is non-empty. Import-surface compat (preserving what was importable on develop): - `from polyswarm_api import PolyswarmAPI` is documented (spec 05, AGENTS.md "Caller surface unchanged", canonical aio/api.py docstring) but wasn't actually exposed at the top level — the bot caught this. Added the re-export. - `from polyswarm_api.aio import AsyncPolyswarmRequest, AsyncPolyswarmSession` worked on develop (re-exported through the giant inline `aio/__init__.py`). The slim codegen-era `aio/__init__.py` had dropped them. Restored as explicit re-exports from `aio.core`. - `async_upload_logo` (function + monkey-patch site) had been removed as "dead code" in an earlier round. It's part of the develop import surface (`polyswarm_api.aio.async_upload_logo`, `polyswarm_api.aio.upload.async_upload_logo`). Restored on the canonical async side; the rename map (`async_upload_logo` -> `upload_logo`) generates a sync mirror at `polyswarm_api.upload.upload_logo`. Note: the function is preserved as a public callable but not used internally — the resource-method upload path (ReportTemplate.upload_logo via `_single(...)`) is what `report_template_logo_upload` actually calls. Tests: - `test_async_report_template_logo_upload` exercises the full `report_template_logo_upload` flow against respx, asserts the PUT body is the file bytes and the Content-Type header is set. Would have caught the data=/content= bug at PR time; locks in the fix. Other bot notes addressed in chat (not code): - `_coerce_request` / `_exec` docstrings reference `AsyncPolyswarmRequest` in the generated sync `core.py` — string literals; unasync doesn't rewrite them. The canonical docstring already calls out the sync mirror; tolerable as the bot noted. - `wait_for` / `report_wait_for` test gap — the asyncio->time codegen rule it would exercise is documented as a constraint, and breakage would manifest loudly (e.g. `time.gather`) rather than silently. Not blocking; better tested at the codegen smoke layer if at all. - Major-version bump (3.x -> 4.0) for the develop->master step is noted in the PR description; this PR stays at 3.21.0 per gitflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Getting close enough for a review, still some changes to searching to be made.