diff --git a/server/__tests__/lane-profile.test.js b/server/__tests__/lane-profile.test.js index 78ae281..73949c7 100644 --- a/server/__tests__/lane-profile.test.js +++ b/server/__tests__/lane-profile.test.js @@ -90,3 +90,24 @@ describe("hookEnv extraEnv", () => { slots.releaseSlot(lane.id); }); }); + +describe("resolveProfile — E2 declarations", () => { + it("defaults MIGRATIONS_DIR to empty and GENERATED_MERGE_PATHS to an empty array", () => { + const lane = makeLane(); + writeProfile(lane.cwd, "PORTS=api\n"); + const profile = profileLib.resolveProfile(lanesLib.getLane(lane.id)); + assert.equal(profile.env.MIGRATIONS_DIR, ""); + assert.deepEqual(profile.generatedMergePaths, []); + }); + + it("parses declared MIGRATIONS_DIR and GENERATED_MERGE_PATHS", () => { + const lane = makeLane(); + writeProfile( + lane.cwd, + 'PORTS=api\nMIGRATIONS_DIR="db/migrations"\nGENERATED_MERGE_PATHS="api/openapi.json api/client.ts"\n' + ); + const profile = profileLib.resolveProfile(lanesLib.getLane(lane.id)); + assert.equal(profile.env.MIGRATIONS_DIR, "db/migrations"); + assert.deepEqual(profile.generatedMergePaths, ["api/openapi.json", "api/client.ts"]); + }); +}); diff --git a/server/lib/lane-profile.js b/server/lib/lane-profile.js index 8bdd3b1..e930e8b 100644 --- a/server/lib/lane-profile.js +++ b/server/lib/lane-profile.js @@ -76,6 +76,15 @@ const DEFAULTS = Object.freeze({ // stack `ship-feature-lane`'s Stage 3 boots for QC. Empty = off, same as // every declaration above. QC_BOOT_ENV: "", + // E2: repo-relative path to a numbered-migrations directory (e.g. + // "db/migrations"), consumed by sync-base's collision preflight. Empty = + // off, same DEFAULTS pattern as every declaration above. + MIGRATIONS_DIR: "", + // E2: space-separated repo-relative paths given a keep-ours merge driver + // by sync-base's merge mode and regenerated post-merge by the profile's + // `regen` hook (e.g. an OpenAPI contract + its generated client). Empty = + // off — no driver installed, no regen fold-in attempted. + GENERATED_MERGE_PATHS: "", }); /** @@ -173,6 +182,7 @@ function resolveProfile(lane) { hooks, ports: splitList(env.PORTS), laneDirs: splitList(env.LANE_DIRS), + generatedMergePaths: splitList(env.GENERATED_MERGE_PATHS), }; } return null;