chore: sync Rust client with Apify OpenAPI spec v2-2026-07-23T070817Z - #19
Closed
Pijukatel wants to merge 11 commits into
Closed
chore: sync Rust client with Apify OpenAPI spec v2-2026-07-23T070817Z#19Pijukatel wants to merge 11 commits into
Pijukatel wants to merge 11 commits into
Conversation
Spec delta (apify-docs #2785, #2789, #2790, #2794) is a functional no-op: new 402/404/408/409 error responses on already-covered endpoints (handled generically), a new ErrorType enum value (error_type is Option<String>, not a Rust enum), relaxed nullability on two untyped/flattened fields, and a doc-only API-reference sidebar regroup. Also removes the duplicated "official, but experimental, AI-generated and AI-maintained" disclosure from docs/README.md, per the updated documentation requirement that it be stated once, in the top-level README.
Collaborator
Author
|
CI status: the The Generated by Claude Code |
…s, tests) - Remove the duplicated AI-disclosure notice from src/lib.rs (README is now the single source), and trim the CHANGELOG to only actual changes. - Bring RequestQueueClient::batch_add_requests to JS-reference parity: add batch_add_requests_with_options + BatchAddRequestsOptions (byte-size slicing, bounded parallelism, unprocessed-request retry with backoff). Additive; the existing signature is unchanged. Bump to 0.7.0 (minor). - DRY the hand-rolled HttpRequest call sites (task/run/user/dataset/ request_queue/key_value_store) onto new clients::base helpers (put_send, put_action[_raw], update_resource_with_params, delete_resource_with_params, delete_item, post_raw[_with_extra_header], get_raw_required), fixing two timeout inconsistencies (update_request/delete_request) surfaced along the way. Verified delete_record/delete_request/delete_request_lock's not-found behavior against the JS reference (already consistent). - Replace remaining magic header/content-type/pagination-header string literals with named constants. - Add missing integration test coverage: client.user(id), BuildClient abort/delete, run-scoped storage metadata reads, task webhooks/last_run, request-queue update/batch flows, and RunClient abort/reboot/resurrect/ metamorph (via a shared slow-Actor fixture). - Fill documentation gaps: runnable create() examples for tasks/schedules/ webhooks (now wired into the doctest suite), a new tasks_schedules_webhooks example, update(fields) coverage in the storages example, and an explanation of the rustdoc `#`-hidden-line convention for GitHub readers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AxYQgZ4DUdcTDHG1QF8BMj
…hangelog) - Cargo.toml description no longer repeats the AI-disclosure wording (README is the single source per the dedup rule). - Document batch_add_requests_with_options/BatchAddRequestsOptions in docs/storages.md (table row, behavior section, runnable example); add the missing tasks_schedules_webhooks row to docs/README.md's examples table. - CHANGELOG: flag batch_add_requests's Err->unprocessedRequests behavior change explicitly, record this PR's doc/example additions, and trim process/out-of-scope prose from the historical 0.4.6/0.6.0 entries. - Add hermetic MockBackend tests for RunClient::charge and UserClient::update_limits (idempotency-key shape, body, HTTP method), a live Run CRUD-flow test (update/set_status_message/delete/get-None), and a hermetic test for the standalone ApifyClient::log(id) accessor. - Finish the base.rs DRY sweep: default_build now uses get_resource_required; GET/HEAD (get_resource_required, get_raw_required, head_exists) and create_resource/get_or_create_named/delete_with_body now all route through the existing method-generic send_with_body instead of hand-building HttpRequest; drop the single-caller delete_resource_with_params and inline it into delete_resource. - Name the request_queue.rs jitter modulus constant and migrate set_record_json to the existing CONTENT_TYPE_JSON_UTF8 constant. - Add a docs/README.md hidden-line-convention pointer to every doc page that uses the convention. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AxYQgZ4DUdcTDHG1QF8BMj
Round-3 review finding: only 4 of ~15 RequestQueueClient methods had been aligned to the reference's SMALL/MEDIUM timeouts, leaving the rest on the 360s default where apify-client-js's request_queue.ts uses 5s/30s. - get, update, delete, list_head, add_request, get_request, batch_delete_requests -> SMALL_REQUEST_TIMEOUT (5s). - list_and_lock_head, the requests/batch POST (batch_add_requests' per-chunk call), list_requests, unlock_requests -> MEDIUM_REQUEST_TIMEOUT (30s). - base.rs: extended the existing default/"_with_timeout" helper pattern (get_resource_required, get_resource, delete_resource, post_action) so the many other correctly-defaulted callers are unaffected; delete_item now routes through send_with_body for full DRY. - Added hermetic regression tests (tests/unit_http.rs) asserting the exact timeout the mock backend receives for every corrected method. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AxYQgZ4DUdcTDHG1QF8BMj
Address every MUST-FIX/SHOULD-FIX (self-contradictory error-handling example, undocumented actor-version/env-var clients and RQ locking/with_client_key, CI path-filter gap, TaskClient API narrowing to TaskStartOptions/TaskCallOptions, last_run/is_terminal DRY, dead RunClient::new parameter, standalone log() live test) and fix-or-justify every NIT from the independent 6-reviewer pass.
…ings - RunClient::charge's doc comment incorrectly claimed JS's _params() always includes instance base params, charge included. In apify-client-js, charge() builds its AxiosRequestConfig manually with no params key, so it is the one method that does NOT go through _params(). Reworded to state this is a divergence from JS (harmless, documented rather than suppressed). - cargo doc --no-deps emitted 12 warnings: private_intra_doc_links on links to private consts/fns in request_queue.rs and actor_env_var_collection.rs (downgraded to plain code spans), and a broken LogOptions/LogOptions::raw link in run.rs (qualified via the crate::LogOptions re-export). Verified zero warnings afterward.
…ctor/task call parity)
- Corrected docs/storages.md's with_client_key scope claim: clientKey is sent on
request-level/locking methods only, not on get/update/delete.
- Added ActorCallOptions (Omit<ActorStartOptions, waitForFinish>) so ActorClient::call
can no longer silently block server-side via wait_for_finish, mirroring the
TaskCallOptions narrowing.
- Added hermetic unit_http.rs coverage for TaskStartOptions::apply/From<TaskCallOptions>
and the new ActorCallOptions parity.
- Fixed the request-lock doc example: commented prolong/delete-lock lines now sit inside
the loop where id is in scope, and missing/non-string ids are skipped instead of
producing delete_request("").
Round-6 review caught that get_request used base_params() (which includes clientKey) while the JS reference's getRequest builds its params from bare _params(), the one request-level method that omits the clientKey merge every sibling method does. Switch get_request to QueryParams::new(), correct the with_client_key docs to list it alongside get/update/delete, and add a regression test.
Adds live test coverage for ActorClient::webhooks(), ActorClient::default_build(), and KeyValueStoreClient::create_keys_public_url(); removes a real cross-test env-var race in tests/config.rs by splitting make_client into an env-free core, and justifies why the ACTOR_RUN_ID mutation in tests/actor_run.rs is safe; corrects three doc comments that overstated JS reference-client parity; adds per-field types to the StoreListOptions/ListKeysOptions docs tables; and drops the stray "and Python" from the crate-level rustdoc.
…on PR #19 Adds RunClient::get_with_options/BuildClient::get_with_options for waitForFinish; adds get_or_create_with_options/schema to the dataset and key-value-store collection clients for JS parity; fixes a test-name-collision bug where unique_name's random suffix could be truncated away entirely for long prefixes; adds the missing nonzero-test CI guard to the Test examples step; changes validate_input/ validate_input_for_build to return bool; stops ActorVersionCollectionClient::list from sending spec-undocumented query params; maps WebhookClient::test and LogClient::stream/RunClient::get_streamed_log 404s to None; changes UserClient::limits/monthly_usage* to return Option for JS parity; extracts named SplitMix64 constants; fills in missing doc field types and semantics; tightens several doc comments for accuracy; and replaces a tautological test assertion with a load-bearing one.
…ests, style, comments, CI) Documents the round-9 additions (get_with_options/*GetOptions, get_or_create_with_options/*GetOrCreateOptions) and fixes the start/call turbofish notation; strengthens ~14 decorative list-GET assertions and fixes a real flaky `items.len() <= total` race under concurrent test-suite load by comparing against `limit` instead; adds coverage for run-scoped storage PUT/DELETE and de-duplicates webhook_definition(); names magic constants, trims the CHANGELOG to one-liners per change, and fixes/justifies the remaining staff-correctness NITs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AxYQgZ4DUdcTDHG1QF8BMj
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.
Syncs the client to Apify OpenAPI spec
v2-2026-07-23T070817Z(apify-docs #2785, #2789, #2790, #2794 since the client's baseline #2763) and brings a number of behaviours to parity with the JavaScript reference client. Crate0.6.1→0.7.0(minor: additive API plus documented behaviour changes on an unreleased 0.x crate).Spec sync
Version-only delta relative to the previous sync: new
402/404/408/409error responses on already-covered endpoints (handled generically byApiError), a newErrorTypeenum value (error_typeisOption<String>, not a Rust enum), relaxed nullability captured by theextraflatten catch-alls, and a doc-only API-reference sidebar regroup.API_SPEC_VERSIONbumped accordingly.Reference-parity and correctness
RequestQueueClient::batch_add_requests_with_options(+BatchAddRequestsOptions): unprocessed-request retry with backoff, bounded parallelism, and payload byte-size slicing, matching the JS reference.SMALL/MEDIUMvalues across the request-queue client.RunClient::get_with_options/BuildClient::get_with_optionsexpose the spec'swaitForFinishquery parameter (also viaactor.last_run()/task.last_run()).TaskClient::start/callnarrowed (TaskStartOptions/TaskCallOptions) so the task-run endpoint no longer receives the unsupportedforcePermissionLevel;ActorClient::callnarrowed to dropwaitForFinishfrom the client-poll path — both matching the JSOmit<…>typing.Nonehandling aligned with the reference forWebhookClient::test,LogClient::stream,UserClient::limits/monthly_usage;validate_inputnow returnsbool.get_or_create_with_optionsexposes theschemaconvenience for datasets/key-value stores.Quality
cargo docwarning-clean.Test plan
cargo build --all-targets,cargo fmt --all -- --check,cargo clippy --all-targets -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --no-deps(clean)cargo test --doc,cargo test --test examples(live), and the fullcargo test --all-targetssuite withAPIFY_TOKEN— all pass