Skip to content

[DEV-762] Allow overriding the deadline at the call level while reading events #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

w1am
Copy link
Contributor

@w1am w1am commented Aug 6, 2025

Changed operation type of reading to regular to allow overriding deadline at the call level

Fixes: #333

* Allows overriding deadline at the call level
@w1am w1am requested a review from Copilot August 6, 2025 07:21
@w1am w1am self-assigned this Aug 6, 2025
@w1am w1am added the cherry-pick:trunk Cherry picks PR into trunk branch label Aug 6, 2025
Copy link

linear bot commented Aug 6, 2025

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR changes the operation type of reading operations from streaming to regular to enable deadline overriding at the call level. This allows users to specify custom deadlines for read operations when making individual calls.

  • Removed explicit OperationKind.Streaming parameter from ReadStreamOptions and ReadAllOptions constructors
  • Added comprehensive test coverage for deadline functionality on read operations
  • Updated existing test assertions to follow best practices

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/main/java/io/kurrent/dbclient/ReadStreamOptions.java Removed streaming operation kind from constructor to allow deadline overriding
src/main/java/io/kurrent/dbclient/ReadAllOptions.java Removed streaming operation kind from constructor to allow deadline overriding
src/test/java/io/kurrent/dbclient/streams/DeadlineTests.java Added new test methods for read operations with deadlines and improved existing test assertions
Comments suppressed due to low confidence (2)

src/test/java/io/kurrent/dbclient/streams/DeadlineTests.java:56

  • [nitpick] The method call getDefaultClient() is inconsistent with other test methods that use getDatabase().defaultClient(). Consider using the same pattern for consistency.
        KurrentDBClient client = getDefaultClient();

src/test/java/io/kurrent/dbclient/streams/DeadlineTests.java:83

  • [nitpick] The method call getDefaultClient() is inconsistent with other test methods that use getDatabase().defaultClient(). Consider using the same pattern for consistency.
        KurrentDBClient client = getDefaultClient();

@w1am w1am force-pushed the w1am/dev-762-client-ignores-deadline-option-for-readstream-operation branch from 005af8d to cf6b6fa Compare August 6, 2025 07:54
@w1am w1am merged commit ae24623 into release/v1.0 Aug 6, 2025
56 of 58 checks passed
@w1am w1am deleted the w1am/dev-762-client-ignores-deadline-option-for-readstream-operation branch August 6, 2025 08:03
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 @w1am Failed to create cherry Pick PR due to error:

RequestError [HttpError]: Resource not accessible by integration
   at /home/runner/work/_actions/kurrent-io/Automations/master/cherry-pick-pr-for-label/node_modules/@octokit/request/dist-node/index.js:66:23
   at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
 status: '403',
 headers: {
   'access-control-allow-origin': '*',
   'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
   'content-encoding': 'gzip',
   'content-security-policy': "default-src 'none'",
   'content-type': 'application/json; charset=utf-8',
   date: 'Wed, 06 Aug 2025 08:03:16 GMT',
   'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
   server: 'github.com',
   'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
   'transfer-encoding': 'chunked',
   vary: 'Accept-Encoding, Accept, X-Requested-With',
   'x-accepted-github-permissions': 'contents=write',
   'x-content-type-options': 'nosniff',
   'x-frame-options': 'deny',
   'x-github-api-version-selected': '2022-11-28',
   'x-github-media-type': 'github.v3; format=json',
   'x-github-request-id': 'CC10:29EFA0:1C12F4B:42FC15D:68930C44',
   'x-ratelimit-limit': '5000',
   'x-ratelimit-remaining': '4990',
   'x-ratelimit-reset': '1754470994',
   'x-ratelimit-resource': 'core',
   'x-ratelimit-used': '10',
   'x-xss-protection': '0'
 },
 request: {
   method: 'POST',
   url: 'https://api.github.com/repos/kurrent-io/KurrentDB-Client-Java/merges',
   headers: {
     accept: 'application/vnd.github.v3+json',
     'user-agent': 'octokit-core.js/3.3.2 Node.js/20.19.3 (linux; x64)',
     authorization: 'token [REDACTED]',
     'content-type': 'application/json; charset=utf-8'
   },
   body: '{"base":"cherry-pick-cherry-pick/339/w1am/dev-762-client-ignores-deadline-option-for-readstream-operation-trunk-73d45506-7921-41e2-92ce-ed4cd27ea920","commit_message":"Merge b830e11bd01f8bb46d1714ab4f6600d0520e7444 into cherry-pick-cherry-pick/339/w1am/dev-762-client-ignores-deadline-option-for-readstream-operation-trunk-73d45506-7921-41e2-92ce-ed4cd27ea920 [skip ci]\\n\\n\\nskip-checks: true\\n","head":"b830e11bd01f8bb46d1714ab4f6600d0520e7444"}',
   request: { agent: [Agent], hook: [Function: bound bound register] }
 },
 documentation_url: 'https://docs.github.com/rest/branches/branches#merge-a-branch'
}

🚨👉 Check https://github.com/kurrent-io/KurrentDB-Client-Java/actions/runs/16771143128

w1am added a commit that referenced this pull request Aug 6, 2025
* Change operation type of reading to regular
* Allows overriding deadline at the call level
@w1am w1am changed the title [DEV-762] Change operation type of reading to regular [DEV-762] Allow overriding the deadline at the call level while reading events Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick:trunk Cherry picks PR into trunk branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant