Skip to content

chore: sync Rust client with Apify OpenAPI spec v2-2026-07-23T070817Z - #19

Closed
Pijukatel wants to merge 11 commits into
masterfrom
claude/rust-spec-sync-2026-07-23
Closed

chore: sync Rust client with Apify OpenAPI spec v2-2026-07-23T070817Z#19
Pijukatel wants to merge 11 commits into
masterfrom
claude/rust-spec-sync-2026-07-23

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

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. Crate 0.6.10.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/409 error responses on already-covered endpoints (handled generically by ApiError), a new ErrorType enum value (error_type is Option<String>, not a Rust enum), relaxed nullability captured by the extra flatten catch-alls, and a doc-only API-reference sidebar regroup. API_SPEC_VERSION bumped 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.
  • Per-method request timeouts aligned to the JS SMALL/MEDIUM values across the request-queue client.
  • RunClient::get_with_options/BuildClient::get_with_options expose the spec's waitForFinish query parameter (also via actor.last_run()/task.last_run()).
  • TaskClient::start/call narrowed (TaskStartOptions/TaskCallOptions) so the task-run endpoint no longer receives the unsupported forcePermissionLevel; ActorClient::call narrowed to drop waitForFinish from the client-poll path — both matching the JS Omit<…> typing.
  • 404-to-None handling aligned with the reference for WebhookClient::test, LogClient::stream, UserClient::limits/monthly_usage; validate_input now returns bool.
  • get_or_create_with_options exposes the schema convenience for datasets/key-value stores.

Quality

  • Removed the duplicated "official, but experimental, AI-generated and AI-maintained" disclosure so it appears once, in the top-level README only.
  • DRY refactor of the HTTP helper layer; magic literals replaced with named constants; cargo doc warning-clean.
  • Documentation for every resource client (including the new option types) with runnable examples; integration + hermetic tests expanded; CI path filters and zero-test guards hardened.

Test plan

  • cargo build --all-targets, cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps (clean)
  • cargo test --doc, cargo test --test examples (live), and the full cargo test --all-targets suite with APIFY_TOKEN — all pass

CI note: the apify-pr-toolkit check is red only on the ZenHub/GitHub-Projects estimate gate (needs a maintainer to set an estimate); the test check passes.

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.
@github-actions github-actions Bot added this to the 145th sprint - Tooling team milestone Jul 25, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Jul 25, 2026
@Pijukatel Pijukatel added the adhoc Ad-hoc unplanned task added during the sprint. label Jul 25, 2026 — with Claude

Copy link
Copy Markdown
Collaborator Author

CI status: the test check passes. The apify-pr-toolkit check is red on its final gate only:

If issue is not linked to the pull request then estimate the pull request in ZenHub or GitHub Projects!

The adhoc label was added (matching the prior spec-sync PR #18), which cleared the issue/epic-linking requirement. The remaining requirement is a ZenHub estimate — the same step that turned #18 green after it was set manually. That requires ZenHub access, which this automated update flow does not have, so it needs a maintainer to set the estimate (and then this check will pass on re-run). Everything within the automated flow's control is green.


Generated by Claude Code

claude added 4 commits July 25, 2026 22:27
…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.
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jul 26, 2026
claude added 6 commits July 26, 2026 05:38
…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
@Pijukatel Pijukatel closed this Aug 10, 2026
@Pijukatel
Pijukatel deleted the claude/rust-spec-sync-2026-07-23 branch August 10, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants