Repository navigation
refactor: migrate the deprecated v2 endpoints onto v3 - #181
Merged
Merged
Conversation
revengai 4.72.2 marks 85 operations deprecated, up from 25. Eight of the nine
the plugin called now emit a DeprecationWarning at call time and have a v3
successor; this moves them over.
Every v2 operation returned a BaseResponseX envelope with a .data attribute.
Every v3 operation returns a flat *OutputBody. So each migration is: swap the
method, drop the .data unwrap, remap fields.
ConfigApi.get_config -> ConfigApi.v3_get_config
AnalysesCoreApi.get_analysis_status -> AnalysesCoreApi.v3_get_analysis_operation
AnalysesCoreApi.get_analysis_function_map
-> FunctionsCoreApi.v3_get_analysis_func_maps
AnalysesCoreApi.list_analyses -> AnalysesCoreApi.v3_list_analyses
AnalysesCoreApi.upload_file -> BinariesApi.v3_upload_file
SearchApi.search_binaries -> BinariesApi.v3_search_binaries
SearchApi.search_collections -> CollectionsApi.v3_list_collections
FunctionsAIDecompilationApi.upsert_ai_decompilation_rating
-> ..._api.v3_upsert_ai_decompilation_rating
Notes on the non-obvious ones:
SearchApi is now deprecated in its entirety -- it has zero non-deprecated
operations. Binary search moves to GET /v3/binaries and collection search to
GET /v3/collections; both swap page/page_size for limit/offset.
CollectionListItemBody renames six fields off CollectionSearchResult
(scope, last_updated_at, created_at, owned_by, tags, size).
Analysis status moves to the long-running-operation endpoint
GET /v3/operations/analyses/{analysis_id}, whose CreateMetadata.status carries
the same platform status string v2 returned, so the Complete/Error state
machine is unchanged.
v3_upload_file drops packed_password. That parameter was dead plumbing here:
declared and threaded between _upload_file_req and upload_user_file but never
supplied by any caller. Archive passwords moved to the sandbox side of the
platform (SandboxConfig.archive_password), so it is removed rather than
reimplemented.
Also handle the types_applied AI-decompilation stream event, new in 4.72.2 as
the EventTypesApplied oneOf variant. The hand-rolled SSE parser keys off event
names and had no branch for it, so those events were dropped silently.
AnalysesCoreApi.create_analysis stays on v2: POST /v2/analyses is deprecated
but has no v3 successor in the live v4.73.0 spec. It is now the only deprecated
SDK call left in the plugin. The remaining /v2 calls -- IAMUsersApi.get_me and
the seven ConversationsApi operations -- are not deprecated and have no /v3
paths in the spec.
Co-Authored-By: Claude Opus 5 (1M context) <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.
Stack: #178 → #179 → #180 → this. Merge in order, or retarget as each lands.
Why
4.72.2 marks 85 operations deprecated, up from 25. Eight of the nine the plugin called now emit a
DeprecationWarningat call time and have a v3 successor.Every v2 operation returned a
BaseResponseXenvelope with a.dataattribute; every v3 operation returns a flat*OutputBody. So each migration is: swap the method, drop the.dataunwrap, remap fields.ConfigApi.get_configConfigApi.v3_get_configAnalysesCoreApi.get_analysis_statusAnalysesCoreApi.v3_get_analysis_operationAnalysesCoreApi.get_analysis_function_mapFunctionsCoreApi.v3_get_analysis_func_mapsAnalysesCoreApi.list_analysesAnalysesCoreApi.v3_list_analysesAnalysesCoreApi.upload_fileBinariesApi.v3_upload_fileSearchApi.search_binariesBinariesApi.v3_search_binariesSearchApi.search_collectionsCollectionsApi.v3_list_collectionsFunctionsAIDecompilationApi.upsert_ai_decompilation_rating…v3_upsert_ai_decompilation_ratingThe non-obvious ones
SearchApiis now deprecated in its entirety — zero non-deprecated operations. Binary search moves toGET /v3/binaries, collection search toGET /v3/collections; both swappage/page_sizeforlimit/offset.CollectionListItemBodyrenames six fields offCollectionSearchResult(scope→collection_scope,last_updated_at→updated_at,created_at→creation,owned_by→collection_owner,tags→collection_tags,size→collection_size).Analysis status moves to the long-running-operation endpoint
GET /v3/operations/analyses/{analysis_id}— the docs describe it as "Polls the status of an Analysis-creation operation".CreateMetadata.statuscarries the same platform status string v2 returned (the SDK's field validator pins it toUploaded|Queued|Processing|Complete|Error), so theComplete/Errorstate machine is unchanged rather than redesigned arounddone/error.v3_upload_filedropspacked_password. That parameter was dead plumbing: declared on_upload_file_reqandupload_user_fileand threaded between them, but never supplied — both internal callers omit it and nothing outside the module callsupload_user_file. Archive passwords moved to the sandbox side of the platform (SandboxConfig.archive_password), so it is removed rather than reimplemented. NoteUploadOutputBody.file_typeis a plainstrwhere v2's was theUploadFileTypeenum.New
types_appliedstream event. 4.72.2 addedEventTypesAppliedto theStreamAiDecompilation200ResponseInneroneOf. The hand-rolled SSE parser keys off event names and had no branch for it, so those events were being dropped silently. Enabling the newtype_suggestions/apply_typesparams oncreate_ai_decompilationis a product decision and is deliberately not in this PR.What stays on v2
AnalysesCoreApi.create_analysis—POST /v2/analysesis deprecated but has no v3 successor in the live v4.73.0 spec (verified againstdocs.reveng.ai/openapi.json; noPOST /v3/analysesexists). v2-create + v3-poll is the platform's current flow. After this PR it is the only deprecated SDK call left in the plugin.The other remaining
/v2calls are not deprecated and have no/v3paths in the spec, so they are correctly left alone:IAMUsersApi.get_meand the sevenConversationsApioperations.That audit was done mechanically, not from memory — AST-extracting every method carrying
warnings.warn(..., DeprecationWarning)from the vendored SDK, then grepping plugin source, then cross-checking each hit against the live spec'sdeprecatedflag. Worth noting "is on /v2" and "is deprecated" are not the same predicate: 11 v2 operations carry no deprecation marker at all.Verification
The repo's drift guards (
test_sdk_call_signatures.py,test_endpoint_auth.py, the ninetest_sdk_schemas.pyfiles) all pass with their pins updated to the v3 methods and models. Response-shape tests construct real pydantic models rather thanMagicMocks, so they fail if a field path drifts.🤖 Generated with Claude Code