#2 Add 'get offsets' command#338
Conversation
|
@gunnarmorling if you have a moment, mind taking a look at this one? Thanks! |
gunnarmorling
left a comment
There was a problem hiding this comment.
Woot, woot, LOVING it 😍! This has been on the roadmap for sooo long (I mean, it's issue #2 after all :). Thanks a ton for picking this up.
Looks great to me overall, a few minor comments inline. Besides those, taking a step back, instead of making this a new sub-command of get, did you consider making this part of describe connector, e.g. via a new switch akin to --tasks-config? I feel this would be somewhat more intuitive/user-friendly, as I wouldn't consider offsets to be their own entity that much as just a property of the connector entity. Curious what you think.
Once we've made a decision on that one,
- The completion file should be updated as part of this PR, too
- The help output in the README should be updated if it changes at all (if we stick with get offsets, then the help output of get should mention that)
Thanks again!
|
|
||
| Instant start = Instant.now(); | ||
|
|
||
| while (Duration.between(start, Instant.now()).toSeconds() < 30) { |
There was a problem hiding this comment.
Looks like a good use case for Awaitility. Let's add it as a dependency and use it here if you like the idea. It would make that test a bit nicer to read, but it's also not a strict requirement from my PoV.
There was a problem hiding this comment.
Love it! Done. The one small issue I found is that (with the five minutes of docs perusal I did) there doesn't seem to be an easy way to emit a custom error message if an awaited condition never evaluates to true, but it still seems worth the tradeoff in improved readability, especially since (fingers crossed) it's unlikely these tests will start spontaneously failing.
|
Thanks Gunnar! Planning to push a new commit tomorrow to address the suggestions. RE folding this into Thoughts on which syntax to choose with the future offsets-related commands (that I *promise* to implement after Kafka 3.6.0 is released) in mind? |
|
Good point about those future offset related APIs. Looks like making We still may consider later on whether to add a flag I'd say let's go with your proposal and take it from there. |
|
Thanks Gunnar! I've updated the README and completion script, and addressed your other inline code suggestions. This is ready for another pass when you have time. |
|
Hmm... the Kicking off another CI run. If this is only slightly flaky, I'd like to file a follow-up issue to investigate further; if it occurs frequently enough to be annoying, then we should probably investigate further before merging this PR to make sure that it's not caused by these changes. |
|
Latest run succeeded. Kicking off one more just to be safe. |
|
Yeah, we definitely have some issues with flaky tests. Last one just passed, will merge.
Yes, if you could log one, that'd be great. Not sure when this started, also saw this when merging a few Dependabot PRs yesterday. So it definitely shouldn't be related by this PR. Thanks again, really cool to see this finally becoming reality in kcctl! |
|
Thanks Gunnar! Logged #353 regarding the flaky integration tests. |
Addresses #2
Usage:
Uses the
GET /connectors/{name}/offsetsendpoint introduced in KIP-875 to retrieve committed offsets for a connector.Since this feature requires Kafka Connect 3.5 or later, the integration test is customized to use a non-stable version of Debezium (2.4.0 alpha). We can and should update the version used in that test once a final release takes place for 2.4.0.