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:
1 parent
a328ef5ea7
commit
ff83b6c7da
40 files changed
+1457
-137
No files matched your search
@@ -12,8 +12,11 @@ import type {
|
||||
ScenarioRunDetail,
|
||||
ScenarioRunStep,
|
||||
ScenarioStep,
|
||||
ScenarioVersion,
|
||||
Snippet,
|
||||
SnippetVersion,
|
||||
TraceMode,
|
||||
UsedSnippet,
|
||||
} from './types';
|
||||
import { emitApiErrorToast } from '../lib/toast-events';
|
||||
|
||||
@@ -122,6 +125,9 @@ export const snippets = {
|
||||
remove(id: string): Promise<void> {
|
||||
return request(`/snippets/${id}`, { method: 'DELETE' });
|
||||
},
|
||||
versions(id: string): Promise<SnippetVersion[]> {
|
||||
return request(`/snippets/${id}/versions`);
|
||||
},
|
||||
exportSnippet(id: string): Promise<unknown> {
|
||||
return request(`/snippets/${id}/export`);
|
||||
},
|
||||
@@ -229,12 +235,17 @@ export const scenarios = {
|
||||
environmentId: string,
|
||||
saveSession?: boolean,
|
||||
traceMode?: TraceMode,
|
||||
/** Scenario version to run; omit for the latest. */
|
||||
version?: number,
|
||||
): Promise<ScenarioRun> {
|
||||
return request(`/scenarios/${id}/run`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ environmentId, saveSession, traceMode }),
|
||||
body: JSON.stringify({ environmentId, saveSession, traceMode, version }),
|
||||
});
|
||||
},
|
||||
versions(id: string): Promise<ScenarioVersion[]> {
|
||||
return request(`/scenarios/${id}/versions`);
|
||||
},
|
||||
runDefaults(): Promise<RunDefaults> {
|
||||
return request('/scenarios/run-defaults');
|
||||
},
|
||||
@@ -274,7 +285,7 @@ export const scenarios = {
|
||||
exportE2eTestUrl(id: string): string {
|
||||
return `${BASE_URL}/scenarios/${id}/export-e2e`;
|
||||
},
|
||||
usedSnippets(id: string): Promise<Snippet[]> {
|
||||
usedSnippets(id: string): Promise<UsedSnippet[]> {
|
||||
return request(`/scenarios/${id}/used-snippets`);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user