You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "xiaozou-wine (via GitHub)" <gi...@apache.org> on 2026/10/01 08:27:28 UTC

[PR] feat(go): add GetMe to the Go SDK [iggy]

xiaozou-wine opened a new pull request, #4371:
URL: https://github.com/apache/iggy/pull/4371

   Fixes #4368
   
   The Rust client exposes `SystemClient::get_me`, and the Go SDK already defined `GetMeCode`, but the command, the interface method and the client call were missing. Consumers had to send the raw code and decode the reply by hand, which is what the e2e suite did in four places.
   
   - `GetMe` command in `internal/command/system.go`, mirroring `GetStats`
   - `GetMe(ctx)` on the `Client` interface, next to `GetClient`
   - TCP implementation in `tcp_clients_management.go`, reusing `DeserializeClient` since the reply layout is identical
   - `GetMe` added to `TestEmptySystemCommandBodies`
   - The four raw `SendBinaryRequest(ctx, uint32(command.GetMeCode), nil)` calls in `tests/e2e_test.go` replaced with `GetMe`
   
   Also adds `TestE2E_GetMeDescribesTheCallingClient`, which signs in and checks the reply's `UserID` against the user id the sign-in returned. The four existing call sites sit in tests that skip without a split-primary cluster, so `GetMe` had no coverage in CI.
   
   Verified locally: `gofmt`, `go vet`, `go build`, the unit tests, the full e2e suite against a real server (15 passed, 0 failed, 3 skipped on environment gates), and `prek run` on both the pre-commit and pre-push stages.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(go): add GetMe to the Go SDK [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio merged PR #4371:
URL: https://github.com/apache/iggy/pull/4371


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(go): add GetMe to the Go SDK [iggy]

Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on PR #4371:
URL: https://github.com/apache/iggy/pull/4371#issuecomment-5941928827

   /skill team-review-slim


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(go): add GetMe to the Go SDK [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #4371:
URL: https://github.com/apache/iggy/pull/4371#discussion_r4161197919


##########
foreign/go/tests/e2e_test.go:
##########
@@ -335,6 +330,24 @@ func TestE2E_RawRequestsDoNotGapMetadataRequestIDs(t *testing.T) {
 	require.NotNil(t, topic)
 }
 
+// GetMe is self-scoped: the reply must describe this connection and this user,
+// so the user id is checked against the one the sign-in returned rather than
+// against a constant.
+func TestE2E_GetMeDescribesTheCallingClient(t *testing.T) {

Review Comment:
   nit: This test signs in first, so the `Authentication is required` claim on `GetMe` stays unverified. Add a `GetMe` call to `TestE2E_OnlyPingWorksBeforeSigningIn` and assert `ierror.ErrUnauthenticated`.



##########
foreign/go/tests/e2e_test.go:
##########
@@ -335,6 +330,24 @@ func TestE2E_RawRequestsDoNotGapMetadataRequestIDs(t *testing.T) {
 	require.NotNil(t, topic)
 }
 
+// GetMe is self-scoped: the reply must describe this connection and this user,
+// so the user id is checked against the one the sign-in returned rather than
+// against a constant.
+func TestE2E_GetMeDescribesTheCallingClient(t *testing.T) {
+	connected := newClient(t)
+	ctx := context.Background()
+
+	identity, err := connected.LoginUser(ctx, rootUsername, rootPassword)
+	require.NoError(t, err)
+
+	me, err := connected.GetMe(ctx)
+	require.NoError(t, err)
+	require.NotNil(t, me)
+	assert.Positive(t, me.ID)
+	assert.Equal(t, identity.UserId, me.UserID)
+	assert.Equal(t, string(iggcon.Tcp), me.Transport)

Review Comment:
   nit: `MapClientInfo` writes `string(iggcon.Tcp)` into `Transport`, so this assertion holds for any value of that constant. Compare against the literal `"tcp"` to pin the wire value.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(go): add GetMe to the Go SDK [iggy]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #4371:
URL: https://github.com/apache/iggy/pull/4371#issuecomment-5947327671

   ## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/4371?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `22.22222%` with `7 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 87.85%. Comparing base ([`d7458b8`](https://app.codecov.io/gh/apache/iggy/commit/d7458b8e6176bf74a954c4dbc1ad80c555ed1214?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4c3b4dc`](https://app.codecov.io/gh/apache/iggy/commit/4c3b4dc0cc4e03237cdf0eb721a0f9b69f794e34?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/4371?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [foreign/go/client/tcp/tcp\_clients\_management.go](https://app.codecov.io/gh/apache/iggy/pull/4371?src=pr&el=tree&filepath=foreign%2Fgo%2Fclient%2Ftcp%2Ftcp_clients_management.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9nby9jbGllbnQvdGNwL3RjcF9jbGllbnRzX21hbmFnZW1lbnQuZ28=) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/4371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [foreign/go/internal/command/system.go](https://app.codecov.io/gh/apache/iggy/pull/4371?src=pr&el=tree&filepath=foreign%2Fgo%2Finternal%2Fcommand%2Fsystem.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9nby9pbnRlcm5hbC9jb21tYW5kL3N5c3RlbS5nbw==) | 50.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/4371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   :x: Your patch check has failed because the patch coverage (22.22%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the [target](https://docs.codecov.com/docs/commit-status#target) coverage.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #4371      +/-   ##
   ============================================
   - Coverage     87.85%   87.85%   -0.01%     
     Complexity     1577     1577              
   ============================================
     Files          1290     1290              
     Lines        228835   228844       +9     
     Branches     192194   192194              
   ============================================
   + Hits         201045   201051       +6     
   - Misses        23065    23070       +5     
   + Partials       4725     4723       -2     
   ```
   
   | [Components](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `88.95% <ø> (ø)` | |
   | [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.73% <ø> (ø)` | |
   | [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.44% <ø> (ø)` | |
   | [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.24% <ø> (ø)` | |
   | [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.67% <ø> (ø)` | |
   | [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.51% <ø> (ø)` | |
   | [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/4371/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.32% <22.22%> (-0.01%)` | :arrow_down: |
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/4371?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [foreign/go/internal/command/system.go](https://app.codecov.io/gh/apache/iggy/pull/4371?src=pr&el=tree&filepath=foreign%2Fgo%2Finternal%2Fcommand%2Fsystem.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9nby9pbnRlcm5hbC9jb21tYW5kL3N5c3RlbS5nbw==) | `81.25% <50.00%> (-4.47%)` | :arrow_down: |
   | [foreign/go/client/tcp/tcp\_clients\_management.go](https://app.codecov.io/gh/apache/iggy/pull/4371?src=pr&el=tree&filepath=foreign%2Fgo%2Fclient%2Ftcp%2Ftcp_clients_management.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9nby9jbGllbnQvdGNwL3RjcF9jbGllbnRzX21hbmFnZW1lbnQuZ28=) | `33.33% <0.00%> (-16.67%)` | :arrow_down: |
   
   ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/4371/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(go): add GetMe to the Go SDK [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4371:
URL: https://github.com/apache/iggy/pull/4371#issuecomment-5927683304

   <!-- iggy-pr-triage-welcome -->
   Thanks for the PR. It is labeled `S-waiting-on-review` and queued for review.
   
   Slash commands (own line, regular comment) move it around the queue:
   
   - `/ready` - back to `S-waiting-on-review` after addressing feedback
   - `/author` - flip to `S-waiting-on-author` while you finish changes
   - `/request-review @user-or-team` - request a reviewer
   - `/pin` - exempt the PR from the stale bot, `/unpin` to undo
   
   See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md#pr-triage-commands) for details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org