Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit d8a5834

Browse files
committed
feat(Telemetry): add prerelease channel tags
1 parent a442468 commit d8a5834

8 files changed

Lines changed: 30 additions & 8 deletions

File tree

apps/vscode-nightly/esbuild.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ async function main() {
3333
sourcesContent: false,
3434
platform: "node",
3535
define: {
36-
"process.env.PKG_NAME": '"roo-code-nightly"',
36+
"process.env.PKG_NAME": '"zoo-code-nightly"',
3737
"process.env.PKG_VERSION": `"${overrideJson.version}"`,
38-
"process.env.PKG_OUTPUT_CHANNEL": '"Roo-Code-Nightly"',
38+
"process.env.PKG_OUTPUT_CHANNEL": '"Zoo-Code-Nightly"',
39+
"process.env.PKG_RELEASE_CHANNEL": '"prerelease"',
40+
"process.env.POSTHOG_API_KEY": JSON.stringify(process.env.POSTHOG_API_KEY || ""),
3941
...(gitSha ? { "process.env.PKG_SHA": `"${gitSha}"` } : {}),
4042
},
4143
}
@@ -88,7 +90,7 @@ async function main() {
8890
const generatedPackageJson = generatePackageJson({
8991
packageJson,
9092
overrideJson,
91-
substitution: ["roo-cline", "roo-code-nightly"],
93+
substitution: ["roo-cline", "zoo-code-nightly"],
9294
})
9395

9496
fs.writeFileSync(path.join(buildDir, "package.json"), JSON.stringify(generatedPackageJson, null, 2))

packages/types/src/telemetry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export enum TelemetryEventName {
8383
export const staticAppPropertiesSchema = z.object({
8484
appName: z.string(),
8585
appVersion: z.string(),
86+
releaseChannel: z.string(),
8687
vscodeVersion: z.string(),
8788
platform: z.string(),
8889
editorName: z.string(),

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,6 +3027,7 @@ export class ClineProvider
30273027
this._appProperties = {
30283028
appName: packageJSON?.name ?? Package.name,
30293029
appVersion: packageJSON?.version ?? Package.version,
3030+
releaseChannel: Package.releaseChannel,
30303031
vscodeVersion: vscode.version,
30313032
platform: process.platform,
30323033
editorName: vscode.env.appName,

src/esbuild.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ async function main() {
4646
format: "cjs",
4747
sourcesContent: false,
4848
platform: "node",
49+
define: {
50+
"process.env.PKG_RELEASE_CHANNEL": JSON.stringify(process.env.PKG_RELEASE_CHANNEL || "stable"),
51+
"process.env.POSTHOG_API_KEY": JSON.stringify(process.env.POSTHOG_API_KEY || ""),
52+
},
4953
}
5054

5155
const srcDir = __dirname

src/shared/package.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const Package = {
1010
publisher,
1111
name: process.env.PKG_NAME || name,
1212
version: process.env.PKG_VERSION || version,
13-
outputChannel: process.env.PKG_OUTPUT_CHANNEL || "Roo-Code",
13+
outputChannel: process.env.PKG_OUTPUT_CHANNEL || "Zoo-Code",
14+
releaseChannel: process.env.PKG_RELEASE_CHANNEL || "stable",
1415
sha: process.env.PKG_SHA,
1516
} as const

webview-ui/src/__tests__/TelemetryClient.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ describe("TelemetryClient", () => {
9999
telemetryClient.capture("test_event", { property: "value" })
100100

101101
// Assert
102-
expect(posthog.capture).toHaveBeenCalledWith("test_event", { property: "value" })
102+
expect(posthog.capture).toHaveBeenCalledWith(
103+
"test_event",
104+
expect.objectContaining({
105+
property: "value",
106+
releaseChannel: "stable",
107+
}),
108+
)
103109
})
104110

105111
it("doesn't capture events when telemetry is disabled", () => {

webview-ui/src/utils/TelemetryClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ class TelemetryClient {
3737
public capture(eventName: string, properties?: Record<string, any>) {
3838
if (TelemetryClient.telemetryEnabled) {
3939
try {
40-
posthog.capture(eventName, properties)
40+
posthog.capture(eventName, {
41+
appName: process.env.PKG_NAME,
42+
appVersion: process.env.PKG_VERSION,
43+
releaseChannel: process.env.PKG_RELEASE_CHANNEL || "stable",
44+
...properties,
45+
})
4146
} catch (_error) {
4247
// Silently fail if there's an error capturing an event.
4348
}

webview-ui/vite.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ export default defineConfig(({ mode }) => {
6363
"process.env.VSCODE_TEXTMATE_DEBUG": JSON.stringify(process.env.VSCODE_TEXTMATE_DEBUG),
6464
"process.env.PKG_NAME": JSON.stringify(pkg.name),
6565
"process.env.PKG_VERSION": JSON.stringify(pkg.version),
66-
"process.env.PKG_OUTPUT_CHANNEL": JSON.stringify("Roo-Code"),
66+
"process.env.PKG_OUTPUT_CHANNEL": JSON.stringify("Zoo-Code"),
67+
"process.env.PKG_RELEASE_CHANNEL": JSON.stringify("stable"),
6768
...(gitSha ? { "process.env.PKG_SHA": JSON.stringify(gitSha) } : {}),
6869
}
6970

@@ -78,7 +79,8 @@ export default defineConfig(({ mode }) => {
7879

7980
define["process.env.PKG_NAME"] = JSON.stringify(nightlyPkg.name)
8081
define["process.env.PKG_VERSION"] = JSON.stringify(nightlyPkg.version)
81-
define["process.env.PKG_OUTPUT_CHANNEL"] = JSON.stringify("Roo-Code-Nightly")
82+
define["process.env.PKG_OUTPUT_CHANNEL"] = JSON.stringify("Zoo-Code-Nightly")
83+
define["process.env.PKG_RELEASE_CHANNEL"] = JSON.stringify("prerelease")
8284
}
8385

8486
const plugins: PluginOption[] = [

0 commit comments

Comments
 (0)