Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BIND_ADDRESS=127.0.0.1
# AI_THROTTLE_LIMIT=20
# CODEGEN_FILL_THROTTLE_LIMIT=10

# ── Database (Neo4j) ─────────────────────────────────────────────────────────
# ── Database (Neo4j) — minimum 8 characters (Neo4j 5 requirement) ─────────────
NEO4J_PASSWORD=change_me_please

# ── Local owner identity (no login screen) ───────────────────────────────────
Expand Down
27 changes: 14 additions & 13 deletions apps/server/test/codegen.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,22 @@ it("no project -> 404 ERR_PROJECT_NOT_FOUND", async () => {
expect(res.body.error.code).toBe("ERR_PROJECT_NOT_FOUND");
});

it("skippedKinds + stub: unsupported kind (Cache) survives DB round-trip", async () => {
it("skippedKinds: EnvironmentVariable survives DB round-trip (config, not a code module)", async () => {
await seedGraph();

// Add an unsupported kind (Cache) — emitter produces stub, skippedKinds counts.
// EnvironmentVariable is not in EMITTER_REGISTRY — counted in skippedKinds, no stub file.
// Config is represented once in scaffold .env.example (see codegen.service.spec.ts).
await createNode({
type: "Cache",
type: "EnvironmentVariable",
projectId,
position: { x: 0, y: 0 },
properties: {
CacheName: "SessionCache",
Description: "Session cache",
KeyPattern: "session:{id}",
TTL_Seconds: 3600,
Engine: "Redis",
EvictionPolicy: "LRU",
Key: "DATABASE_URL",
Description: "DB connection",
DataType: "String",
IsSecret: false,
Environment: ["Prod"],
IsRequired: true,
},
});

Expand All @@ -265,11 +266,11 @@ it("no project -> 404 ERR_PROJECT_NOT_FOUND", async () => {
.expect(200);

const data = res.body.data;
// skippedKinds Passed the full path Controller->Service->Repository->Neo4j.
expect(data.summary.skippedKinds).toEqual({ Cache: 1 });
// The relevant stub file should be generated.
expect(data.summary.skippedKinds).toEqual({ EnvironmentVariable: 1 });
const paths: string[] = data.files.map((f: { path: string }) => f.path);
expect(paths.some((p) => p.endsWith(".cache.stub.ts"))).toBe(true);
expect(paths.some((p) => p.endsWith(".stub.ts"))).toBe(false);
const envExample = data.files.find((f: { path: string }) => f.path === ".env.example");
expect(envExample?.content).toContain("DATABASE_URL");
});

it("DETERMINISM: same graph generated twice -> byte-identical files", async () => {
Expand Down
Loading
Loading