Skip to content

Commit fa23cbc

Browse files
Add descriptions to object definitions in test-run-settings (#1554)
Fixes OPS-2873
1 parent d5b42be commit fa23cbc

File tree

1 file changed

+40
-10
lines changed

1 file changed

+40
-10
lines changed

packages/shared/src/lib/flow-run/test-run-settings.ts

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
11
import { Static, Type } from '@sinclair/typebox';
22

3-
export const TestRunLimit = Type.Object({
4-
blockName: Type.String(),
5-
actionName: Type.String(),
6-
isEnabled: Type.Boolean(),
7-
limit: Type.Number(),
8-
});
3+
export const TestRunLimit = Type.Object(
4+
{
5+
blockName: Type.String({
6+
description:
7+
"The block's full package name that owns the action (e.g., '@scope/block').",
8+
}),
9+
actionName: Type.String({
10+
description:
11+
'The exact action name within the block for which the limit applies.',
12+
}),
13+
isEnabled: Type.Boolean({
14+
description:
15+
'Whether this specific action limit is active during test runs.',
16+
}),
17+
limit: Type.Number({
18+
description:
19+
'Maximum number of times this action will be executed in a single test run.',
20+
}),
21+
},
22+
{
23+
description:
24+
'Per-action write safety limit used when executing workflows in test mode.',
25+
},
26+
);
927

1028
export type TestRunLimit = Static<typeof TestRunLimit>;
1129

12-
export const TestRunLimitSettings = Type.Object({
13-
isEnabled: Type.Boolean(),
14-
limits: Type.Array(TestRunLimit),
15-
});
30+
export const TestRunLimitSettings = Type.Object(
31+
{
32+
isEnabled: Type.Boolean({
33+
description:
34+
'Master switch to enable or disable all test run action limits for the workflow.',
35+
}),
36+
limits: Type.Array(TestRunLimit, {
37+
description:
38+
'List of per-action limits that restrict write operations during test runs.',
39+
}),
40+
},
41+
{
42+
description:
43+
'Global test run safety configuration combining a master toggle and per-action limits.',
44+
},
45+
);
1646

1747
export type TestRunLimitSettings = Static<typeof TestRunLimitSettings>;
1848

0 commit comments

Comments
 (0)