@intentius/chant-lexicon-temporal 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/docs-cli.d.ts +3 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +7 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +3 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +16 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/package-cli.d.ts +3 -0
- package/dist/codegen/package-cli.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +10 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/composites/apply-op.d.ts +73 -0
- package/dist/composites/apply-op.d.ts.map +1 -0
- package/dist/composites/cloud-stack.d.ts +54 -0
- package/dist/composites/cloud-stack.d.ts.map +1 -0
- package/dist/composites/dev-stack.d.ts +63 -0
- package/dist/composites/dev-stack.d.ts.map +1 -0
- package/dist/composites/pipeline-audit-op.d.ts +55 -0
- package/dist/composites/pipeline-audit-op.d.ts.map +1 -0
- package/dist/composites/reconcile-op.d.ts +62 -0
- package/dist/composites/reconcile-op.d.ts.map +1 -0
- package/dist/composites/watch-op.d.ts +56 -0
- package/dist/composites/watch-op.d.ts.map +1 -0
- package/dist/composites/workflow-audit-op.d.ts +61 -0
- package/dist/composites/workflow-audit-op.d.ts.map +1 -0
- package/dist/config.d.ts +197 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/coverage.d.ts +15 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/describe-resources.d.ts +26 -0
- package/dist/describe-resources.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +5 -5
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/post-synth/tmp001-retention-too-short.d.ts +10 -0
- package/dist/lint/post-synth/tmp001-retention-too-short.d.ts.map +1 -0
- package/dist/lint/post-synth/tmp002-allowall-without-note.d.ts +11 -0
- package/dist/lint/post-synth/tmp002-allowall-without-note.d.ts.map +1 -0
- package/dist/lint/post-synth/tmp010-cron-syntax.d.ts +12 -0
- package/dist/lint/post-synth/tmp010-cron-syntax.d.ts.map +1 -0
- package/dist/lint/post-synth/tmp011-namespace-reference.d.ts +10 -0
- package/dist/lint/post-synth/tmp011-namespace-reference.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/op/activities/apply.d.ts +70 -0
- package/dist/op/activities/apply.d.ts.map +1 -0
- package/dist/op/activities/argo.d.ts +56 -0
- package/dist/op/activities/argo.d.ts.map +1 -0
- package/dist/op/activities/build.d.ts +11 -0
- package/dist/op/activities/build.d.ts.map +1 -0
- package/dist/op/activities/gitlab.d.ts +15 -0
- package/dist/op/activities/gitlab.d.ts.map +1 -0
- package/dist/op/activities/heartbeat.d.ts +27 -0
- package/dist/op/activities/heartbeat.d.ts.map +1 -0
- package/dist/op/activities/helm.d.ts +18 -0
- package/dist/op/activities/helm.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +29 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/op/activities/kubectl.d.ts +11 -0
- package/dist/op/activities/kubectl.d.ts.map +1 -0
- package/dist/op/activities/lifecycle.d.ts +42 -0
- package/dist/op/activities/lifecycle.d.ts.map +1 -0
- package/dist/op/activities/pipeline-audit.d.ts +84 -0
- package/dist/op/activities/pipeline-audit.d.ts.map +1 -0
- package/dist/op/activities/policy.d.ts +17 -0
- package/dist/op/activities/policy.d.ts.map +1 -0
- package/dist/op/activities/reconcile.d.ts +69 -0
- package/dist/op/activities/reconcile.d.ts.map +1 -0
- package/dist/op/activities/shell.d.ts +13 -0
- package/dist/op/activities/shell.d.ts.map +1 -0
- package/dist/op/activities/teardown.d.ts +10 -0
- package/dist/op/activities/teardown.d.ts.map +1 -0
- package/dist/op/activities/util.d.ts +8 -0
- package/dist/op/activities/util.d.ts.map +1 -0
- package/dist/op/activities/wait.d.ts +16 -0
- package/dist/op/activities/wait.d.ts.map +1 -0
- package/dist/op/activities/workflow-audit.d.ts +92 -0
- package/dist/op/activities/workflow-audit.d.ts.map +1 -0
- package/dist/op/serializer.d.ts +20 -0
- package/dist/op/serializer.d.ts.map +1 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/resources.d.ts +101 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/rules/{tmp001.ts → tmp001-retention-too-short.ts} +9 -11
- package/dist/rules/{tmp002.ts → tmp002-allowall-without-note.ts} +9 -11
- package/dist/rules/tmp011-namespace-reference.ts +2 -2
- package/dist/serializer.d.ts +15 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate.d.ts +18 -0
- package/dist/validate.d.ts.map +1 -0
- package/package.json +27 -6
- package/src/lint/post-synth/index.ts +13 -0
- package/src/lint/post-synth/post-synth.test.ts +124 -1
- package/src/lint/{rules/tmp001.ts → post-synth/tmp001-retention-too-short.ts} +9 -11
- package/src/lint/{rules/tmp002.ts → post-synth/tmp002-allowall-without-note.ts} +9 -11
- package/src/lint/post-synth/tmp011-namespace-reference.ts +2 -2
- package/src/op/serializer.ts +2 -2
- package/src/plugin.test.ts +5 -6
- package/src/plugin.ts +2 -12
- package/src/serializer.ts +6 -6
- package/src/lint/rules/index.ts +0 -2
- package/src/lint/rules/lint-rules.test.ts +0 -150
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lint rule tests — TMP001, TMP002.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { describe, test, expect } from "vitest";
|
|
6
|
-
import type { LintContext } from "@intentius/chant/lint/rule";
|
|
7
|
-
import { DECLARABLE_MARKER } from "@intentius/chant/declarable";
|
|
8
|
-
import { tmp001 } from "./tmp001";
|
|
9
|
-
import { tmp002 } from "./tmp002";
|
|
10
|
-
|
|
11
|
-
// ── Helpers ─────────────────────────────────────────────────────────
|
|
12
|
-
|
|
13
|
-
function makeEntity(entityType: string, props: Record<string, unknown>) {
|
|
14
|
-
return {
|
|
15
|
-
[DECLARABLE_MARKER]: true,
|
|
16
|
-
entityType,
|
|
17
|
-
lexicon: "temporal",
|
|
18
|
-
kind: "resource",
|
|
19
|
-
props,
|
|
20
|
-
attributes: {},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function makeCtx(entities: Map<string, unknown>): LintContext {
|
|
25
|
-
return {
|
|
26
|
-
entities: entities as Map<string, never>,
|
|
27
|
-
project: { name: "test" } as never,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ── TMP001: retention-too-short ──────────────────────────────────────
|
|
32
|
-
|
|
33
|
-
describe("TMP001: retention-too-short", () => {
|
|
34
|
-
test("flags namespace with 1d retention", () => {
|
|
35
|
-
const ctx = makeCtx(new Map([
|
|
36
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "1d" })],
|
|
37
|
-
]));
|
|
38
|
-
const diags = tmp001.check(ctx);
|
|
39
|
-
expect(diags).toHaveLength(1);
|
|
40
|
-
expect(diags[0].ruleId).toBe("TMP001");
|
|
41
|
-
expect(diags[0].severity).toBe("error");
|
|
42
|
-
expect(diags[0].message).toContain("1d");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("flags namespace with 48h retention", () => {
|
|
46
|
-
const ctx = makeCtx(new Map([
|
|
47
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "48h" })],
|
|
48
|
-
]));
|
|
49
|
-
const diags = tmp001.check(ctx);
|
|
50
|
-
expect(diags).toHaveLength(1);
|
|
51
|
-
expect(diags[0].ruleId).toBe("TMP001");
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
test("passes with 3d retention (exactly at threshold)", () => {
|
|
55
|
-
const ctx = makeCtx(new Map([
|
|
56
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "3d" })],
|
|
57
|
-
]));
|
|
58
|
-
expect(tmp001.check(ctx)).toHaveLength(0);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test("passes with 7d retention", () => {
|
|
62
|
-
const ctx = makeCtx(new Map([
|
|
63
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "7d" })],
|
|
64
|
-
]));
|
|
65
|
-
expect(tmp001.check(ctx)).toHaveLength(0);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
test("passes when retention is unset (defaults to 7d)", () => {
|
|
69
|
-
const ctx = makeCtx(new Map([
|
|
70
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default" })],
|
|
71
|
-
]));
|
|
72
|
-
expect(tmp001.check(ctx)).toHaveLength(0);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
test("skips non-namespace entities", () => {
|
|
76
|
-
const ctx = makeCtx(new Map([
|
|
77
|
-
["s", makeEntity("Temporal::Server", { mode: "dev" })],
|
|
78
|
-
]));
|
|
79
|
-
expect(tmp001.check(ctx)).toHaveLength(0);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
test("skips unrecognised retention format", () => {
|
|
83
|
-
const ctx = makeCtx(new Map([
|
|
84
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default", retention: "1week" })],
|
|
85
|
-
]));
|
|
86
|
-
expect(tmp001.check(ctx)).toHaveLength(0);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// ── TMP002: allowall-without-note ────────────────────────────────────
|
|
91
|
-
|
|
92
|
-
describe("TMP002: allowall-without-note", () => {
|
|
93
|
-
test("warns for AllowAll overlap without state.note", () => {
|
|
94
|
-
const ctx = makeCtx(new Map([
|
|
95
|
-
["sched", makeEntity("Temporal::Schedule", {
|
|
96
|
-
scheduleId: "heavy-job",
|
|
97
|
-
spec: { cronExpressions: ["0 * * * *"] },
|
|
98
|
-
action: { workflowType: "heavyWorkflow", taskQueue: "heavy" },
|
|
99
|
-
policies: { overlap: "AllowAll" },
|
|
100
|
-
})],
|
|
101
|
-
]));
|
|
102
|
-
const diags = tmp002.check(ctx);
|
|
103
|
-
expect(diags).toHaveLength(1);
|
|
104
|
-
expect(diags[0].ruleId).toBe("TMP002");
|
|
105
|
-
expect(diags[0].severity).toBe("warning");
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
test("passes when AllowAll has a note", () => {
|
|
109
|
-
const ctx = makeCtx(new Map([
|
|
110
|
-
["sched", makeEntity("Temporal::Schedule", {
|
|
111
|
-
scheduleId: "heavy-job",
|
|
112
|
-
spec: { cronExpressions: ["0 * * * *"] },
|
|
113
|
-
action: { workflowType: "heavyWorkflow", taskQueue: "heavy" },
|
|
114
|
-
policies: { overlap: "AllowAll" },
|
|
115
|
-
state: { note: "Workflow is idempotent — concurrent runs are safe" },
|
|
116
|
-
})],
|
|
117
|
-
]));
|
|
118
|
-
expect(tmp002.check(ctx)).toHaveLength(0);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test("passes for Skip overlap (no note needed)", () => {
|
|
122
|
-
const ctx = makeCtx(new Map([
|
|
123
|
-
["sched", makeEntity("Temporal::Schedule", {
|
|
124
|
-
scheduleId: "daily",
|
|
125
|
-
spec: { cronExpressions: ["0 3 * * *"] },
|
|
126
|
-
action: { workflowType: "dailyWorkflow", taskQueue: "daily" },
|
|
127
|
-
policies: { overlap: "Skip" },
|
|
128
|
-
})],
|
|
129
|
-
]));
|
|
130
|
-
expect(tmp002.check(ctx)).toHaveLength(0);
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test("passes when no policies set", () => {
|
|
134
|
-
const ctx = makeCtx(new Map([
|
|
135
|
-
["sched", makeEntity("Temporal::Schedule", {
|
|
136
|
-
scheduleId: "daily",
|
|
137
|
-
spec: { cronExpressions: ["0 3 * * *"] },
|
|
138
|
-
action: { workflowType: "dailyWorkflow", taskQueue: "daily" },
|
|
139
|
-
})],
|
|
140
|
-
]));
|
|
141
|
-
expect(tmp002.check(ctx)).toHaveLength(0);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
test("skips non-schedule entities", () => {
|
|
145
|
-
const ctx = makeCtx(new Map([
|
|
146
|
-
["ns", makeEntity("Temporal::Namespace", { name: "default" })],
|
|
147
|
-
]));
|
|
148
|
-
expect(tmp002.check(ctx)).toHaveLength(0);
|
|
149
|
-
});
|
|
150
|
-
});
|