History

[codex] Extract infrastructure, telemetry, and test tooling (#2994)

Julius Marminge committed 5 months agov0.0.25-nightly.20260608.497

Commit 0e4a4351 parent 3ea6adf34 files · +810 −113Browse files

Showing the changes to scripts (2 of 34 files). Show all

Unified · Split

2 files
  1. scripts/lib/public-config.test.ts +22 −1
  2. scripts/lib/public-config.ts +36 −0
scripts/lib/public-config.test.ts+22−1
@@ -27,6 +27,12 @@ describe("loadRepoEnv", () => { · 26 unmodified lines
2727 expect(env.EXPO_PUBLIC_CLERK_JWT_TEMPLATE).toBeUndefined();
2828 expect(env.T3CODE_RELAY_URL).toBeUndefined();
2929 expect(env.VITE_T3CODE_RELAY_URL).toBeUndefined();
30+ expect(env.T3CODE_MOBILE_OTLP_TRACES_URL).toBeUndefined();
31+ expect(env.T3CODE_MOBILE_OTLP_TRACES_DATASET).toBeUndefined();
32+ expect(env.T3CODE_MOBILE_OTLP_TRACES_TOKEN).toBeUndefined();
33+ expect(env.EXPO_PUBLIC_OTLP_TRACES_URL).toBeUndefined();
34+ expect(env.EXPO_PUBLIC_OTLP_TRACES_DATASET).toBeUndefined();
35+ expect(env.EXPO_PUBLIC_OTLP_TRACES_TOKEN).toBeUndefined();
3036 });
3137
3238 it("applies process, root local, and root precedence in that order", () => {
@@ -73,26 +79,41 @@ describe("loadRepoEnv", () => { · 40 unmodified lines
7379 VITE_CLERK_JWT_TEMPLATE: "template_legacy",
7480 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: "oauth_canonical",
7581 VITE_T3CODE_RELAY_URL: "https://legacy.example.test",
82+ EXPO_PUBLIC_OTLP_TRACES_URL: "https://api.axiom.co/v1/traces",
83+ EXPO_PUBLIC_OTLP_TRACES_DATASET: "mobile-traces",
84+ EXPO_PUBLIC_OTLP_TRACES_TOKEN: "mobile-token",
7685 }),
7786 ).toEqual({
7887 clerkPublishableKey: "pk_legacy",
7988 clerkJwtTemplate: "template_legacy",
8089 clerkCliOAuthClientId: "oauth_canonical",
8190 relayUrl: "https://legacy.example.test",
91+ mobileOtlpTracesUrl: "https://api.axiom.co/v1/traces",
92+ mobileOtlpTracesDataset: "mobile-traces",
93+ mobileOtlpTracesToken: "mobile-token",
8294 });
8395 });
8496
85− it("projects only the configured aliases", () => {
97+ it("projects canonical mobile tracing values to Expo public aliases", () => {
8698 expect(
8799 loadRepoEnv({
88100 baseEnv: {
89101 T3CODE_RELAY_URL: "https://relay.example.test",
102+ T3CODE_MOBILE_OTLP_TRACES_URL: "https://api.axiom.co/v1/traces",
103+ T3CODE_MOBILE_OTLP_TRACES_DATASET: "mobile-traces",
104+ T3CODE_MOBILE_OTLP_TRACES_TOKEN: "mobile-token",
90105 },
91106 repoRoot: makeTemporaryDirectory(),
92107 }),
93108 ).toEqual({
94109 T3CODE_RELAY_URL: "https://relay.example.test",
95110 VITE_T3CODE_RELAY_URL: "https://relay.example.test",
111+ T3CODE_MOBILE_OTLP_TRACES_URL: "https://api.axiom.co/v1/traces",
112+ T3CODE_MOBILE_OTLP_TRACES_DATASET: "mobile-traces",
113+ T3CODE_MOBILE_OTLP_TRACES_TOKEN: "mobile-token",
114+ EXPO_PUBLIC_OTLP_TRACES_URL: "https://api.axiom.co/v1/traces",
115+ EXPO_PUBLIC_OTLP_TRACES_DATASET: "mobile-traces",
116+ EXPO_PUBLIC_OTLP_TRACES_TOKEN: "mobile-token",
96117 });
97118 });
98119 });
scripts/lib/public-config.ts+36−0
@@ -9,6 +9,9 @@ export interface T3CodePublicConfig { · 8 unmodified lines
99 readonly clerkJwtTemplate: string | undefined;
1010 readonly clerkCliOAuthClientId: string | undefined;
1111 readonly relayUrl: string | undefined;
12+ readonly mobileOtlpTracesUrl: string | undefined;
13+ readonly mobileOtlpTracesDataset: string | undefined;
14+ readonly mobileOtlpTracesToken: string | undefined;
1215 }
1316
1417 type Environment = Readonly<Record<string, string | undefined>>;
@@ -57,6 +60,24 @@ export function loadRepoEnv({ · 42 unmodified lines
5760 VITE_T3CODE_RELAY_URL: config.relayUrl,
5861 }
5962 : {}),
63+ ...(config.mobileOtlpTracesUrl
64+ ? {
65+ T3CODE_MOBILE_OTLP_TRACES_URL: config.mobileOtlpTracesUrl,
66+ EXPO_PUBLIC_OTLP_TRACES_URL: config.mobileOtlpTracesUrl,
67+ }
68+ : {}),
69+ ...(config.mobileOtlpTracesDataset
70+ ? {
71+ T3CODE_MOBILE_OTLP_TRACES_DATASET: config.mobileOtlpTracesDataset,
72+ EXPO_PUBLIC_OTLP_TRACES_DATASET: config.mobileOtlpTracesDataset,
73+ }
74+ : {}),
75+ ...(config.mobileOtlpTracesToken
76+ ? {
77+ T3CODE_MOBILE_OTLP_TRACES_TOKEN: config.mobileOtlpTracesToken,
78+ EXPO_PUBLIC_OTLP_TRACES_TOKEN: config.mobileOtlpTracesToken,
79+ }
80+ : {}),
6081 };
6182 }
6283
@@ -76,6 +97,21 @@ export function resolvePublicConfig(...sources: readonly Environment[]): T3CodeP · 13 unmodified lines
7697 ),
7798 clerkCliOAuthClientId: firstNonEmpty(sources, "T3CODE_CLERK_CLI_OAUTH_CLIENT_ID"),
7899 relayUrl: firstNonEmpty(sources, "T3CODE_RELAY_URL", "VITE_T3CODE_RELAY_URL"),
100+ mobileOtlpTracesUrl: firstNonEmpty(
101+ sources,
102+ "T3CODE_MOBILE_OTLP_TRACES_URL",
103+ "EXPO_PUBLIC_OTLP_TRACES_URL",
104+ ),
105+ mobileOtlpTracesDataset: firstNonEmpty(
106+ sources,
107+ "T3CODE_MOBILE_OTLP_TRACES_DATASET",
108+ "EXPO_PUBLIC_OTLP_TRACES_DATASET",
109+ ),
110+ mobileOtlpTracesToken: firstNonEmpty(
111+ sources,
112+ "T3CODE_MOBILE_OTLP_TRACES_TOKEN",
113+ "EXPO_PUBLIC_OTLP_TRACES_TOKEN",
114+ ),
79115 };
80116 }
81117

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t