Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): allow explicit environment display labels #32333

Closedzeroknots(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/32333/headopened View on GitHub

Showing 4 changed files with 104 additions and 3 deletions (loading 1).

x
0 of 4 viewed, 4 left
10 additions and 2 deletionsapps/server/src/environment/ServerEnvironment.test.tsModified
View file
@@ -272,12 +272,20 @@
const first = yield* Effect.gen(function* () {
const serverEnvironment = yield* ServerEnvironment.ServerEnvironment;
return yield* serverEnvironment.getDescriptor;
- }).pipe(Effect.provide(layerServerEnvironment(baseDir)));
+ }).pipe(
+ Effect.provide(layerServerEnvironment(baseDir)),
+ Effect.provideService(HostProcess.Environment, { T3CODE_ENVIRONMENT_LABEL: "Personal" }),
+ );
const second = yield* Effect.gen(function* () {
const serverEnvironment = yield* ServerEnvironment.ServerEnvironment;
return yield* serverEnvironment.getDescriptor;
- }).pipe(Effect.provide(layerServerEnvironment(baseDir)));
+ }).pipe(
+ Effect.provide(layerServerEnvironment(baseDir)),
+ Effect.provideService(HostProcess.Environment, { T3CODE_ENVIRONMENT_LABEL: "Work" }),
+ );
​
+ expect(first.label).not.toBe(second.label);
+ expect({ ...first, label: second.label }).toEqual(second);
expect(first.environmentId).toBe(second.environmentId);
expect(first.orchestrationProtocolVersion).toBe(ORCHESTRATION_PROTOCOL_VERSION);
expect(second.capabilities.repositoryIdentity).toBe(true);
88 additions and 1 deletionapps/server/src/environment/ServerEnvironmentLabel.test.tsModified
View file
@@ -1,4 +1,4 @@
-import { assert, it } from "@effect/vitest";
+import { assert, expect, it } from "@effect/vitest";
import * as HostProcess from "@t3tools/shared/HostProcess";