feat(lanes): add MIGRATIONS_DIR + GENERATED_MERGE_PATHS profile declarations (E2)
This commit is contained in:
@@ -90,3 +90,24 @@ describe("hookEnv extraEnv", () => {
|
|||||||
slots.releaseSlot(lane.id);
|
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"]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -76,6 +76,15 @@ const DEFAULTS = Object.freeze({
|
|||||||
// stack `ship-feature-lane`'s Stage 3 boots for QC. Empty = off, same as
|
// stack `ship-feature-lane`'s Stage 3 boots for QC. Empty = off, same as
|
||||||
// every declaration above.
|
// every declaration above.
|
||||||
QC_BOOT_ENV: "",
|
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,
|
hooks,
|
||||||
ports: splitList(env.PORTS),
|
ports: splitList(env.PORTS),
|
||||||
laneDirs: splitList(env.LANE_DIRS),
|
laneDirs: splitList(env.LANE_DIRS),
|
||||||
|
generatedMergePaths: splitList(env.GENERATED_MERGE_PATHS),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user