Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda29411

Browse files
authored
feat: add telemetry enrichment to StartRequest (#63)
Adds `TelemetryEnricher` class and interface to enrich the `StartRequest` message with OS, device ID, and version information.Also adds the version to `Publish.ps1` so that it is available in released binaries.
1 parente0a11dd commitda29411

File tree

8 files changed

+258
-160
lines changed

8 files changed

+258
-160
lines changed

‎.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ resharper_web_config_module_not_resolved_highlighting = warning
7676
resharper_web_config_type_not_resolved_highlighting =warning
7777
resharper_web_config_wrong_module_highlighting =warning
7878

79-
[{*.json,*.jsonc,*.yml,*.yaml,*.proto}]
79+
[{*.json,*.jsonc,*.yml,*.yaml}]
8080
indent_style =space
8181
indent_size =2
82+
83+
[{*.proto}]
84+
indent_style =tab
85+
indent_size =1
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
usingCoder.Desktop.Vpn.Proto;
2+
usingCoder.Desktop.Vpn.Service;
3+
4+
namespaceCoder.Desktop.Tests.Vpn.Service;
5+
6+
[TestFixture]
7+
publicclassTelemetryEnricherTest
8+
{
9+
[Test]
10+
publicvoidEnrichStartRequest()
11+
{
12+
varreq=newStartRequest
13+
{
14+
CoderUrl="https://coder.example.com",
15+
};
16+
varenricher=newTelemetryEnricher();
17+
req=enricher.EnrichStartRequest(req);
18+
19+
// quick sanity check that non-telemetry fields aren't lost or overwritten
20+
Assert.That(req.CoderUrl,Is.EqualTo("https://coder.example.com"));
21+
22+
Assert.That(req.DeviceOs,Is.EqualTo("Windows"));
23+
// seems that test assemblies always set 1.0.0.0
24+
Assert.That(req.CoderDesktopVersion,Is.EqualTo("1.0.0.0"));
25+
Assert.That(req.DeviceId,Is.Not.Empty);
26+
vardeviceId=req.DeviceId;
27+
28+
// deviceId is different on different machines, but we can test that
29+
// each instance of the TelemetryEnricher produces the same value.
30+
enricher=newTelemetryEnricher();
31+
req=enricher.EnrichStartRequest(newStartRequest());
32+
Assert.That(req.DeviceId,Is.EqualTo(deviceId));
33+
}
34+
}

‎Vpn.Proto/RpcVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Coder.Desktop.Vpn.Proto;
55
/// </summary>
66
publicclassRpcVersion
77
{
8-
publicstaticreadonlyRpcVersionCurrent=new(1,0);
8+
publicstaticreadonlyRpcVersionCurrent=new(1,1);
99

1010
publiculongMajor{get;}
1111
publiculongMinor{get;}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp