Skip to content

feat: add delete and delete_trace; drop preview language (1.1.0) - #3

Merged
rferreira merged 2 commits into
mainfrom
add-delete-methods
Aug 31, 2026
Merged

rferreira merged 2 commits into
mainfrom
add-delete-methods

Conversation

@rferreira

@rferreira rferreira commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

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 only
  • DELETE /v2.2/files/{id}/trace — removes the trace only

A customer deleting a result must not assume the findings went with it.

  • ScaniiClient.delete(id) -> bool
  • ScaniiClient.delete_trace(id) -> bool
  • Both raise ScaniiError on 404 (which is also what a repeated delete of the same id returns) and ScaniiAuthError on 401/403, via the existing _raise_for_status
  • Version 1.0.11.1.0 in both pyproject.toml and src/scanii/_version.py, kept in sync per CLAUDE.md §6

bool mirrors scanii-java and matches this SDK's existing delete_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}/trace as preview; process_from_url was 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.

  • Removed the preview paragraph from retrieve_trace() / process_from_url() docstrings and the ScaniiTraceResult model docstring
  • Folded the README's "v2.2 preview methods" section into the file-scanning table; both are now ordinary rows
  • Historical CHANGELOG entries left intact as a record of what shipped; 1.1.0 notes the change

The 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:

  • pytest86 passed, 0 skipped (confirmed the integration tests genuinely ran rather than self-skipping)
  • mypy src (strict) — clean, 7 source files
  • ruff check — clean
  • python -m build — builds scanii_python-1.1.0

Plus 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-packages rather than the source tree — delete_trace → trace gone, result intact; delete → result gone.

rferreira and others added 2 commits August 31, 2026 13:22
…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>
@rferreira rferreira changed the title feat: add delete and delete_trace for split result/trace deletion (1.1.0) feat: add delete and delete_trace; drop preview language (1.1.0) Aug 31, 2026
@rferreira
rferreira merged commit 3f4104e into main Aug 31, 2026
6 checks passed
@rferreira
rferreira deleted the add-delete-methods branch August 31, 2026 18:10
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