Fix .NET GitHub telemetry forwarding#1910
Conversation
Update E2E tests for nullable telemetry session IDs and the generated permissions.setAllowAll signature. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Updates .NET E2E tests to align with recently generated RPC and telemetry types so the test project compiles and assertions match updated nullability.
Changes:
- Update
SetAllowAllAsynccalls to use the namedenabled:argument (to avoid binding issues after an optionalmodeparameter was added). - Update GitHub telemetry E2E assertion to be compatible with a nullable
SessionIdproperty type.
Show a summary per file
| File | Description |
|---|---|
| dotnet/test/E2E/RpcSessionStateExtrasE2ETests.cs | Uses the named enabled: argument for SetAllowAllAsync to match the updated generated RPC signature. |
| dotnet/test/E2E/GitHubTelemetryForwardingE2ETests.cs | Adjusts the assertion for notification.SessionId to avoid nullable-type assertion issues. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Low
| @@ -43,7 +43,7 @@ await TestHelper.WaitForConditionAsync( | |||
| timeoutMessage: "Timed out waiting for GitHub telemetry notification."); | |||
|
|
|||
| Assert.True(notifications.TryPeek(out var notification)); | |||
| Assert.NotEmpty(notification.SessionId); | |||
| Assert.False(string.IsNullOrEmpty(notification.SessionId)); | |||
Send telemetry forwarding opt-in during the connect handshake, harden the .NET telemetry E2E to wait for the live session's notification, and add unit coverage for the connect request. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency:
|
| SDK | In connect |
In session.create |
In session.resume |
|---|---|---|---|
| .NET (this PR) | ✅ | ✅ | ✅ |
| Node.js | ❌ | ✅ | ✅ |
| Python | ❌ | ✅ | ✅ |
| Go | ❌ | ✅ | ✅ |
| Java | ❌ | ✅ | ✅ |
| Rust | ❌ | ✅ | ✅ |
Where to apply the equivalent fix
-
Node.js –
nodejs/src/client.ts— where theconnectrequest is sent (currently only includestoken); addenableGitHubTelemetryForwarding: truewhenthis.onGitHubTelemetry != null. The generatedConnectRequesttype innodejs/src/generated/rpc.tsalready has the field. -
Python –
python/copilot/client.py, line 3307 —_ConnectRequest(token=self._effective_connection_token)→ addenable_git_hub_telemetry_forwarding=Truewhenself._on_github_telemetry is not None. The generated_ConnectRequestdataclass inpython/copilot/generated/rpc.pyalready has the field. -
Go –
go/client.go— inconnectToServer, therpc.ConnectRequestis built with onlyToken; addEnableGitHubTelemetryForwarding: Bool(true)whenc.options.OnGitHubTelemetry != nil. The generatedConnectRequeststruct ingo/rpc/zrpc.goalready has the field. -
Java –
java/src/main/java/com/github/copilot/CopilotClient.java,verifyProtocolVersionmethod —new ConnectParams(effectiveConnectionToken)needs a field forenableGitHubTelemetryForwarding. The generatedConnectRequestclass injava/src/generated/java/already has the field (checkgetEnableGitHubTelemetryForwarding()/setEnableGitHubTelemetryForwarding()). -
Rust –
rust/src/lib.rs,connect_handshakemethod, line 1823 —ConnectRequest { token: ... }→ addenable_github_telemetry_forwarding: self.inner.on_github_telemetry.is_some().then_some(true). The generatedConnectRequeststruct inrust/src/generated/api_types.rsalready has the field.
Since the PR description states that the runtime now negotiates forwarding at the connect level, leaving the other SDKs unchanged would silently break GitHub telemetry forwarding for those SDK users after a runtime update.
Generated by SDK Consistency Review Agent for issue #1910 · sonnet46 1.9M · ◷
Summary
enableGitHubTelemetryForwardingduring theconnecthandshake, which is where the runtime now negotiates forwarding.connect, and add the replay snapshot used by the E2E.Validation
DOTNET_ROLL_FORWARD=Major dotnet test dotnet/test/GitHub.Copilot.SDK.Test.csproj -f net8.0 --filter "FullyQualifiedName~GitHubTelemetryTests|FullyQualifiedName~GitHubTelemetryForwardingE2ETests|FullyQualifiedName~RpcSessionStateExtrasE2ETests"