feat: add delete and delete_trace; drop preview language (1.1.0) - #3
Merged
Merged
Conversation
…1.0) Propagates the openapi v2.2 delete endpoints (scanii/openapi#46, superseded by #48) to scanii-python, following the naming locked by scanii-java and the translation pattern shipped in dotnet 7.3.x, go 2.3.0, node 1.5.0, rust 1.4.0 and php 6.4.0. - ScaniiClient.delete(id) -> bool — DELETE /v2.2/files/{id}; removes the processing result only, leaving the trace readable - ScaniiClient.delete_trace(id) -> bool — DELETE /v2.2/files/{id}/trace; removes the trace only, leaving the result readable - bool return mirrors scanii-java and this SDK's existing delete_auth_token - Both raise ScaniiError on 404 (also returned by a repeated delete of the same id) and ScaniiAuthError on 401/403, via the existing _raise_for_status - Version 1.0.1 -> 1.1.0 in pyproject.toml and src/scanii/_version.py (kept in sync per CLAUDE.md §6) Tests: 6 integration tests hard-asserting the split semantics against scanii-cli, plus 9 unit tests covering verb, path, id url-encoding, and the 403/404 error mapping. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…cess_from_url
The v2.2 spec only ever marked GET /files/{id}/trace as preview — the
`location` parameter behind process_from_url was listed as a plain 2.2
feature, so labelling it preview was drift introduced during the v2.2
propagation. The trace endpoint's preview marking is being dropped from the
contract as well (openapi v22.yaml), so neither method carries it now.
Docs only — no behavior, signature or return-type change.
- Removed the preview paragraph from retrieve_trace() and process_from_url()
docstrings and from the ScaniiTraceResult model docstring
- Folded the README's "v2.2 preview methods" section into the file-scanning
table; both methods are now ordinary rows
- Historical CHANGELOG entries left as-is; 1.1.0 records the change
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Two things, in two commits.
1.
delete/delete_trace(549efe9)Propagates the openapi v2.2 delete endpoints (scanii/openapi#46, superseded by #48). The Aug 30 spec change split what was originally a cascading delete — the two resources are independent:
DELETE /v2.2/files/{id}— removes the processing result onlyDELETE /v2.2/files/{id}/trace— removes the trace onlyA customer deleting a result must not assume the findings went with it.
ScaniiClient.delete(id) -> boolScaniiClient.delete_trace(id) -> boolScaniiErroron 404 (which is also what a repeated delete of the same id returns) andScaniiAuthErroron 401/403, via the existing_raise_for_status1.0.1→1.1.0in bothpyproject.tomlandsrc/scanii/_version.py, kept in sync per CLAUDE.md §6boolmirrors scanii-java and matches this SDK's existingdelete_auth_token, so parity and local convention agree.2. Drop the "v2.2 preview" language (
416cf10)Docs only — no behavior, signature or return-type change.
The spec only ever marked
GET /files/{id}/traceas preview;process_from_urlwas listed as a plain 2.2 feature, so labelling it preview was drift from the v2.2 propagation. The trace endpoint's marking is being dropped from the contract too — scanii/openapi#49.retrieve_trace()/process_from_url()docstrings and theScaniiTraceResultmodel docstringThe other 7 SDKs carry the same preview language and need the same sweep — tracked separately.
Tests
6 integration tests against scanii-cli hard-asserting the split (new surface → no self-skip): result deleted while trace survives; trace deleted while result survives; repeated delete raises; unknown id raises for both; empty id raises
ValueError.9 unit tests for what integration can't isolate: HTTP verb, exact path, id url-encoding, and 404/403 error mapping. The 403 case (temporary auth tokens aren't privileged to delete) is covered deterministically here.
Verification
All four CI gates locally on Python 3.14.4 against scanii-cli v1.12.0:
pytest— 86 passed, 0 skipped (confirmed the integration tests genuinely ran rather than self-skipping)mypy src(strict) — clean, 7 source filesruff check— cleanpython -m build— buildsscanii_python-1.1.0Plus a consumer-install smoke test, since CI never installs the artifact the way a customer does (the scanii-go lesson): built the wheel, installed into a clean venv, and ran the split flow from
site-packagesrather than the source tree —delete_trace→ trace gone, result intact;delete→ result gone.