feat(versioning): version scenarios and snippets, bump to 1.16.0

- snapshot scenario and snippet content into version tables on every
  content change; live tables keep holding the latest version
- record the scenario version on each run and copy its steps into the
  run steps, so runs execute and show the version they were created with
- keep run step history when a step is deleted (FK set null)
- pin a snippet version with runSnippet('alias@N')
- add version picker to the run modal and version info across the UI
- add version list/get endpoints and MCP tools
- include version in exports and require it on import, restoring the
  exact version by id + version
This commit is contained in:
Andrii Arsenin committed 2026-09-30 15:24:44 +03:00
1 parent 9fb6e8538b
commit eed385debf
40 files changed
+1457 -137

No files matched your search

+10 -1
View File
@@ -676,6 +676,7 @@ describe("ScenarioController", () => {
it("creates a new scenario with all steps", async () => {
const payload = {
name: "imported scenario",
version: 1,
steps: [
{
sessionName: "s",
@@ -750,13 +751,20 @@ describe("ScenarioController", () => {
it("imports with empty steps array", async () => {
const res = await request(app.getHttpServer())
.post("/scenarios/import")
.send({ name: "empty-import", steps: [] })
.send({ name: "empty-import", version: 1, steps: [] })
.expect(201);
expect(res.body.name).toBe("empty-import");
expect(res.body.steps).toHaveLength(0);
});
it("returns 400 when version is missing", async () => {
await request(app.getHttpServer())
.post("/scenarios/import")
.send({ name: "no-version", steps: [] })
.expect(400);
});
it("returns 400 when name is missing", async () => {
await request(app.getHttpServer())
.post("/scenarios/import")
@@ -776,6 +784,7 @@ describe("ScenarioController", () => {
.post("/scenarios/import")
.send({
name: "bad-type",
version: 1,
steps: [{ type: "unknown", sessionName: "s" }],
})
.expect(201);