Skip to content

refactor!: make the Java client more idiomatic#4

Closed
Pijukatel wants to merge 5 commits into
masterfrom
claude/confident-edison-nm574i
Closed

refactor!: make the Java client more idiomatic#4
Pijukatel wants to merge 5 commits into
masterfrom
claude/confident-edison-nm574i

Conversation

@Pijukatel

Copy link
Copy Markdown
Collaborator

Summary

Refactors the Java client to be more idiomatic Java, per the updated orchestration consistency requirement ("Consistency with the reference implementation that would go against idiomatic use of the language is not desired") with breaking public-interface changes explicitly permitted. This is not an OpenAPI spec sync — the client remains on v2-2026-07-07T132551Z. Consistency is kept with the JS reference at the API-surface level, not with sibling clients. Version bumped 0.1.10.2.0.

Idiomatic changes (breaking)

  • Enums replacing stringly-typed closed sets (wire values verified against the spec, with null-safe forward-compat on deserialized enums): RunStatus (with isTerminal(), replacing the internal Statuses helper) on ActorRun.getStatus()/Build.getStatus() and the status filters; RunOrigin, PermissionLevel, WebhookEventType flowing through LastRunOptions, ActorClient/TaskClient.lastRun, RunListOptions.status, ActorStartOptions.forcePermissionLevel, and Webhook.getEventTypes(). RunOrigin/PermissionLevel are write-only (no @JsonCreator).
  • Lazy pagination store().iterate(...) and requestQueue().paginateRequests(...) now return Stream<T> instead of a raw Iterator<T>.
  • Boolean-trap removed: RunClient.abort(Boolean)abort() + abort(boolean gracefully).

Tests / CI

  • New EnumTest (wire round-trips, hyphenated TIMING-OUT/TIMED-OUT, UNKNOWN fallback) wired into both the PR and publish gates; new offline abort()/RunListOptions unit tests.
  • Docs, examples, CHANGELOG, and README updated to the 0.2.0 surface.

Verification

  • Spotless + SpotBugs clean (no suppressions); full live suite (units + EnumTest + integration + examples + doc snippets) passes with APIFY_TOKEN.

Patterns already idiomatic (builders, Optional, unchecked ApifyApiException, single well-named boolean params) were left unchanged. Java publishing requirements (Maven Central via mvn, Publishing environment secrets) are unchanged and compliant.


Generated by Claude Code

claude added 5 commits July 9, 2026 10:57
…overloads)

Breaking changes to the public interface:
- RunStatus/RunOrigin/PermissionLevel/WebhookEventType enums replace stringly-typed
  status, origin, permission level and webhook event type fields/params.
- store().iterate() and requestQueue().paginateRequests() return Stream<T>.
- RunClient.abort(Boolean) split into abort() / abort(boolean gracefully).

Consistency target is the JS reference implementation only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
…ses, docs, tests)

- README install snippets bumped to 0.2.0.
- RunListOptions.apply filters null wire values so RunStatus.UNKNOWN cannot leak into the query.
- PermissionLevel: drop unused @jsonvalue (write-only enum), document intent.
- docs/webhooks.md: document typed-getter vs string-create asymmetry; derive create keys via getWireValue().
- CHANGELOG: add abort(null) -> abort() migration hint.
- Add EnumTest (UNKNOWN fallback, hyphenated/dotted wire values, end-to-end deserialization); wire into CI unit-test step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
…h-gate EnumTest parity

- Add EnumTest to the java-publish.yml unit-test step so the enum-correctness
  guard runs before release (parity with the PR gate).
- Add offline unit tests: abort() omits the gracefully param, abort(true)/(false)
  map to gracefully=1/0, and RunListOptions filters RunStatus.UNKNOWN off the wire.
- CHANGELOG: note nullable-Boolean auto-unboxing NPE risk in the abort migration.
- Fix duplicated 'immediate' in RunClient.abort() javadoc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
RunOrigin is only emitted to the origin query param via LastRunOptions; no model
field deserializes it, so its @JsonCreator/@JsonValue/UNKNOWN machinery was dead
and the 'deserialization never fails' javadoc described a nonexistent path. Strip
the annotations and UNKNOWN sentinel and document it as write-only, mirroring the
refactor's own treatment of PermissionLevel. EnumTest updated accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
@Pijukatel

Copy link
Copy Markdown
Collaborator Author

Contaminated by other implementations.

@Pijukatel Pijukatel closed this Jul 9, 2026
@Pijukatel Pijukatel deleted the claude/confident-edison-nm574i branch July 10, 2026 11:00
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.

3 participants