@intentius/chant-lexicon-gitlab 0.0.1

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.
Files changed (56) hide show
  1. package/package.json +27 -0
  2. package/src/codegen/__snapshots__/snapshot.test.ts.snap +33 -0
  3. package/src/codegen/docs-cli.ts +3 -0
  4. package/src/codegen/docs.ts +962 -0
  5. package/src/codegen/fetch.ts +73 -0
  6. package/src/codegen/generate-cli.ts +41 -0
  7. package/src/codegen/generate-lexicon.ts +53 -0
  8. package/src/codegen/generate-typescript.ts +144 -0
  9. package/src/codegen/generate.ts +166 -0
  10. package/src/codegen/naming.ts +52 -0
  11. package/src/codegen/package.ts +64 -0
  12. package/src/codegen/parse.test.ts +195 -0
  13. package/src/codegen/parse.ts +531 -0
  14. package/src/codegen/patches.test.ts +99 -0
  15. package/src/codegen/patches.ts +100 -0
  16. package/src/codegen/rollback.ts +26 -0
  17. package/src/codegen/snapshot.test.ts +109 -0
  18. package/src/coverage.test.ts +39 -0
  19. package/src/coverage.ts +52 -0
  20. package/src/generated/index.d.ts +248 -0
  21. package/src/generated/index.ts +23 -0
  22. package/src/generated/lexicon-gitlab.json +77 -0
  23. package/src/generated/runtime.ts +4 -0
  24. package/src/import/generator.test.ts +151 -0
  25. package/src/import/generator.ts +173 -0
  26. package/src/import/parser.test.ts +160 -0
  27. package/src/import/parser.ts +282 -0
  28. package/src/import/roundtrip.test.ts +89 -0
  29. package/src/index.ts +25 -0
  30. package/src/intrinsics.test.ts +42 -0
  31. package/src/intrinsics.ts +40 -0
  32. package/src/lint/post-synth/post-synth.test.ts +155 -0
  33. package/src/lint/post-synth/wgl010.ts +41 -0
  34. package/src/lint/post-synth/wgl011.ts +54 -0
  35. package/src/lint/post-synth/yaml-helpers.ts +88 -0
  36. package/src/lint/rules/artifact-no-expiry.ts +62 -0
  37. package/src/lint/rules/deprecated-only-except.ts +53 -0
  38. package/src/lint/rules/index.ts +8 -0
  39. package/src/lint/rules/missing-script.ts +65 -0
  40. package/src/lint/rules/missing-stage.ts +62 -0
  41. package/src/lint/rules/rules.test.ts +146 -0
  42. package/src/lsp/completions.test.ts +85 -0
  43. package/src/lsp/completions.ts +18 -0
  44. package/src/lsp/hover.test.ts +60 -0
  45. package/src/lsp/hover.ts +36 -0
  46. package/src/plugin.test.ts +228 -0
  47. package/src/plugin.ts +380 -0
  48. package/src/serializer.test.ts +309 -0
  49. package/src/serializer.ts +226 -0
  50. package/src/testdata/ci-schema-fixture.json +2184 -0
  51. package/src/testdata/create-fixture.ts +46 -0
  52. package/src/testdata/load-fixtures.ts +23 -0
  53. package/src/validate-cli.ts +19 -0
  54. package/src/validate.test.ts +43 -0
  55. package/src/validate.ts +125 -0
  56. package/src/variables.ts +27 -0
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Schema augmentation patches for GitLab CI JSON Schema.
3
+ *
4
+ * The official GitLab CI schema sometimes has gaps, missing properties,
5
+ * or incorrect types. Patches are applied after fetch but before parse
6
+ * to fix these issues.
7
+ */
8
+
9
+ /**
10
+ * A targeted fix for a schema definition.
11
+ */
12
+ export interface SchemaPatch {
13
+ /** Human-readable description of what this patch fixes */
14
+ description: string;
15
+ /** JSON path to the definition to patch (e.g. "definitions.job_template") */
16
+ path: string;
17
+ /** Function that applies the patch to the definition */
18
+ apply(def: Record<string, unknown>): void;
19
+ }
20
+
21
+ /**
22
+ * Registry of known schema patches.
23
+ */
24
+ export const schemaPatches: SchemaPatch[] = [
25
+ {
26
+ description: "Add 'pages' property type to job_template if missing",
27
+ path: "definitions.job_template",
28
+ apply(def) {
29
+ const props = def.properties as Record<string, unknown> | undefined;
30
+ if (props && !props.pages) {
31
+ props.pages = {
32
+ description: "GitLab Pages configuration for publishing static sites.",
33
+ oneOf: [
34
+ { type: "object", properties: { publish: { type: "string" } } },
35
+ { type: "boolean" },
36
+ ],
37
+ };
38
+ }
39
+ },
40
+ },
41
+ {
42
+ description: "Add 'manual_confirmation' property to job_template if missing",
43
+ path: "definitions.job_template",
44
+ apply(def) {
45
+ const props = def.properties as Record<string, unknown> | undefined;
46
+ if (props && !props.manual_confirmation) {
47
+ props.manual_confirmation = {
48
+ type: "string",
49
+ description: "Confirmation message displayed when a manual job is triggered.",
50
+ };
51
+ }
52
+ },
53
+ },
54
+ {
55
+ description: "Add 'inputs' property to job_template if missing",
56
+ path: "definitions.job_template",
57
+ apply(def) {
58
+ const props = def.properties as Record<string, unknown> | undefined;
59
+ if (props && !props.inputs) {
60
+ props.inputs = {
61
+ type: "object",
62
+ description: "Input parameters for CI/CD component jobs.",
63
+ additionalProperties: true,
64
+ };
65
+ }
66
+ },
67
+ },
68
+ ];
69
+
70
+ /**
71
+ * Apply all registered patches to a parsed schema.
72
+ * Modifies the schema in place.
73
+ */
74
+ export function applyPatches(schema: Record<string, unknown>): { applied: string[]; skipped: string[] } {
75
+ const applied: string[] = [];
76
+ const skipped: string[] = [];
77
+
78
+ for (const patch of schemaPatches) {
79
+ const segments = patch.path.split(".");
80
+ let target: Record<string, unknown> | undefined = schema;
81
+
82
+ for (const segment of segments) {
83
+ if (target && typeof target === "object" && segment in target) {
84
+ target = target[segment] as Record<string, unknown>;
85
+ } else {
86
+ target = undefined;
87
+ break;
88
+ }
89
+ }
90
+
91
+ if (target) {
92
+ patch.apply(target);
93
+ applied.push(patch.description);
94
+ } else {
95
+ skipped.push(`${patch.description} (path "${patch.path}" not found)`);
96
+ }
97
+ }
98
+
99
+ return { applied, skipped };
100
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Rollback and snapshot management for GitLab CI lexicon.
3
+ *
4
+ * Wraps the core rollback module with GitLab-specific artifact names.
5
+ */
6
+
7
+ export type { ArtifactSnapshot, SnapshotInfo } from "@intentius/chant/codegen/rollback";
8
+ export {
9
+ snapshotArtifacts,
10
+ saveSnapshot,
11
+ restoreSnapshot,
12
+ listSnapshots,
13
+ } from "@intentius/chant/codegen/rollback";
14
+
15
+ /**
16
+ * GitLab-specific artifact filenames to snapshot.
17
+ */
18
+ export const GITLAB_ARTIFACT_NAMES = ["lexicon-gitlab.json", "index.d.ts", "index.ts"];
19
+
20
+ /**
21
+ * Snapshot GitLab lexicon artifacts.
22
+ */
23
+ export function snapshotGitLabArtifacts(generatedDir: string) {
24
+ const { snapshotArtifacts } = require("@intentius/chant/codegen/rollback");
25
+ return snapshotArtifacts(generatedDir, GITLAB_ARTIFACT_NAMES);
26
+ }
@@ -0,0 +1,109 @@
1
+ import { describe, test, expect } from "bun:test";
2
+ import { readFileSync } from "fs";
3
+ import { join, dirname } from "path";
4
+ import { fileURLToPath } from "url";
5
+
6
+ const generatedDir = join(dirname(dirname(fileURLToPath(import.meta.url))), "generated");
7
+
8
+ describe("generated lexicon-gitlab.json", () => {
9
+ const content = readFileSync(join(generatedDir, "lexicon-gitlab.json"), "utf-8");
10
+ const registry = JSON.parse(content);
11
+
12
+ test("is valid JSON with expected entries", () => {
13
+ expect(Object.keys(registry)).toHaveLength(15);
14
+ });
15
+
16
+ test("contains all resource entities", () => {
17
+ expect(registry.Job).toBeDefined();
18
+ expect(registry.Job.kind).toBe("resource");
19
+ expect(registry.Job.resourceType).toBe("GitLab::CI::Job");
20
+ expect(registry.Job.lexicon).toBe("gitlab");
21
+
22
+ expect(registry.Default).toBeDefined();
23
+ expect(registry.Default.kind).toBe("resource");
24
+
25
+ expect(registry.Workflow).toBeDefined();
26
+ expect(registry.Workflow.kind).toBe("resource");
27
+ });
28
+
29
+ test("contains all property entities", () => {
30
+ const propertyNames = [
31
+ "AllowFailure", "Artifacts", "AutoCancel", "Cache",
32
+ "Environment", "Image", "Include", "Parallel",
33
+ "Release", "Retry", "Rule", "Trigger",
34
+ ];
35
+ for (const name of propertyNames) {
36
+ expect(registry[name]).toBeDefined();
37
+ expect(registry[name].kind).toBe("property");
38
+ expect(registry[name].lexicon).toBe("gitlab");
39
+ }
40
+ });
41
+
42
+ test("entries match snapshot", () => {
43
+ expect(registry.Job).toMatchSnapshot();
44
+ expect(registry.Artifacts).toMatchSnapshot();
45
+ expect(registry.Cache).toMatchSnapshot();
46
+ expect(registry.Image).toMatchSnapshot();
47
+ });
48
+ });
49
+
50
+ describe("generated index.d.ts", () => {
51
+ const content = readFileSync(join(generatedDir, "index.d.ts"), "utf-8");
52
+
53
+ test("contains all class declarations", () => {
54
+ const expectedClasses = [
55
+ "Job", "Default", "Workflow",
56
+ "AllowFailure", "Artifacts", "AutoCancel", "Cache",
57
+ "Environment", "Image", "Include", "Parallel",
58
+ "Release", "Retry", "Rule", "Trigger",
59
+ ];
60
+ for (const cls of expectedClasses) {
61
+ expect(content).toContain(`export declare class ${cls}`);
62
+ }
63
+ });
64
+
65
+ test("contains CI variables declaration", () => {
66
+ expect(content).toContain("export declare const CI");
67
+ expect(content).toContain("readonly CommitBranch: string");
68
+ expect(content).toContain("readonly CommitSha: string");
69
+ expect(content).toContain("readonly PipelineId: string");
70
+ });
71
+
72
+ test("Job class has key properties in constructor", () => {
73
+ // Extract the Job class declaration
74
+ const jobMatch = content.match(/export declare class Job \{[\s\S]*?\n\}/);
75
+ expect(jobMatch).toBeDefined();
76
+ const jobDecl = jobMatch![0];
77
+ expect(jobDecl).toContain("script");
78
+ expect(jobDecl).toContain("stage");
79
+ expect(jobDecl).toContain("image");
80
+ expect(jobDecl).toContain("artifacts");
81
+ expect(jobDecl).toContain("cache");
82
+ });
83
+ });
84
+
85
+ describe("generated index.ts", () => {
86
+ const content = readFileSync(join(generatedDir, "index.ts"), "utf-8");
87
+
88
+ test("has correct resource createResource calls", () => {
89
+ expect(content).toContain('createResource("GitLab::CI::Default"');
90
+ expect(content).toContain('createResource("GitLab::CI::Job"');
91
+ expect(content).toContain('createResource("GitLab::CI::Workflow"');
92
+ });
93
+
94
+ test("has correct property createProperty calls", () => {
95
+ expect(content).toContain('createProperty("GitLab::CI::Artifacts"');
96
+ expect(content).toContain('createProperty("GitLab::CI::Cache"');
97
+ expect(content).toContain('createProperty("GitLab::CI::Image"');
98
+ expect(content).toContain('createProperty("GitLab::CI::Rule"');
99
+ });
100
+
101
+ test("re-exports reference and CI", () => {
102
+ expect(content).toContain('export { reference } from "../intrinsics"');
103
+ expect(content).toContain('export { CI } from "../variables"');
104
+ });
105
+
106
+ test("imports from runtime", () => {
107
+ expect(content).toContain('from "./runtime"');
108
+ });
109
+ });
@@ -0,0 +1,39 @@
1
+ import { describe, test, expect } from "bun:test";
2
+ import { computeCoverage, overallPct, formatSummary } from "./coverage";
3
+ import { readFileSync } from "fs";
4
+ import { join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
6
+
7
+ const basePath = dirname(dirname(fileURLToPath(import.meta.url)));
8
+ const lexiconJSON = readFileSync(join(basePath, "src", "generated", "lexicon-gitlab.json"), "utf-8");
9
+
10
+ describe("coverage analysis", () => {
11
+ test("computes coverage for GitLab lexicon", () => {
12
+ const report = computeCoverage(lexiconJSON);
13
+ expect(report.resourceCount).toBe(3); // Job, Default, Workflow
14
+ expect(report.resources).toHaveLength(3);
15
+ });
16
+
17
+ test("reports resource names correctly", () => {
18
+ const report = computeCoverage(lexiconJSON);
19
+ const names = report.resources.map((r) => r.name);
20
+ expect(names).toContain("Job");
21
+ expect(names).toContain("Default");
22
+ expect(names).toContain("Workflow");
23
+ });
24
+
25
+ test("overallPct returns a number", () => {
26
+ const report = computeCoverage(lexiconJSON);
27
+ const pct = overallPct(report);
28
+ expect(typeof pct).toBe("number");
29
+ expect(pct).toBeGreaterThanOrEqual(0);
30
+ expect(pct).toBeLessThanOrEqual(100);
31
+ });
32
+
33
+ test("formatSummary returns readable string", () => {
34
+ const report = computeCoverage(lexiconJSON);
35
+ const summary = formatSummary(report);
36
+ expect(summary).toContain("Coverage Report");
37
+ expect(summary).toContain("3 resources");
38
+ });
39
+ });
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Coverage analysis for GitLab CI lexicon.
3
+ *
4
+ * Measures how many of the CI schema's definitions are covered
5
+ * by the generated lexicon entities.
6
+ */
7
+
8
+ import { readFileSync } from "fs";
9
+ import { join, dirname } from "path";
10
+ import { fileURLToPath } from "url";
11
+ import {
12
+ computeCoverage,
13
+ overallPct,
14
+ formatSummary,
15
+ formatVerbose,
16
+ checkThresholds,
17
+ type CoverageReport,
18
+ type CoverageThresholds,
19
+ } from "@intentius/chant/codegen/coverage";
20
+
21
+ export type { CoverageReport, CoverageThresholds };
22
+ export { computeCoverage, overallPct, formatSummary, formatVerbose, checkThresholds };
23
+
24
+ /**
25
+ * Run coverage analysis for the GitLab lexicon.
26
+ */
27
+ export async function analyzeGitLabCoverage(opts?: {
28
+ basePath?: string;
29
+ verbose?: boolean;
30
+ minOverall?: number;
31
+ }): Promise<CoverageReport> {
32
+ const basePath = opts?.basePath ?? dirname(dirname(fileURLToPath(import.meta.url)));
33
+ const lexiconPath = join(basePath, "src", "generated", "lexicon-gitlab.json");
34
+ const content = readFileSync(lexiconPath, "utf-8");
35
+ const report = computeCoverage(content);
36
+
37
+ if (opts?.verbose) {
38
+ console.error(formatVerbose(report));
39
+ } else {
40
+ console.error(formatSummary(report));
41
+ }
42
+
43
+ if (typeof opts?.minOverall === "number") {
44
+ const result = checkThresholds(report, { minOverallPct: opts.minOverall });
45
+ if (!result.ok) {
46
+ for (const v of result.violations) console.error(` FAIL: ${v}`);
47
+ throw new Error("Coverage below threshold");
48
+ }
49
+ }
50
+
51
+ return report;
52
+ }
@@ -0,0 +1,248 @@
1
+ // Code generated by chant gitlab generate. DO NOT EDIT.
2
+
3
+ // --- CI Entity classes ---
4
+
5
+ export declare class AllowFailure {
6
+ constructor(props: {
7
+ exit_codes: number;
8
+ });
9
+ }
10
+
11
+ export declare class Artifacts {
12
+ constructor(props: {
13
+ access?: "none" | "developer" | "all";
14
+ exclude?: string[];
15
+ expire_in?: string;
16
+ expose_as?: string;
17
+ name?: string;
18
+ paths?: string[];
19
+ reports?: Record<string, unknown>;
20
+ untracked?: boolean;
21
+ when?: "on_success" | "on_failure" | "always";
22
+ });
23
+ }
24
+
25
+ export declare class AutoCancel {
26
+ constructor(props: {
27
+ on_job_failure?: "none" | "all";
28
+ on_new_commit?: "conservative" | "interruptible" | "none";
29
+ });
30
+ }
31
+
32
+ export declare class Cache {
33
+ constructor(props: {
34
+ fallback_keys?: string[];
35
+ key?: string | Record<string, any>;
36
+ paths?: string[];
37
+ policy?: string;
38
+ unprotect?: boolean;
39
+ untracked?: boolean;
40
+ when?: "on_success" | "on_failure" | "always";
41
+ });
42
+ }
43
+
44
+ export declare class Default {
45
+ constructor(props: {
46
+ after_script?: string | string[];
47
+ artifacts?: Artifacts;
48
+ before_script?: string | string[];
49
+ cache?: Cache | Cache[];
50
+ hooks?: Record<string, unknown>;
51
+ id_tokens?: Record<string, unknown>;
52
+ identity?: "google_cloud";
53
+ image?: Image;
54
+ interruptible?: boolean;
55
+ retry?: Retry | number;
56
+ services?: Service[];
57
+ tags?: any[];
58
+ timeout?: string;
59
+ });
60
+ }
61
+
62
+ export declare class Environment {
63
+ constructor(props: {
64
+ /** The name of the environment, e.g. 'qa', 'staging', 'production'. */
65
+ name: string;
66
+ /** Specifies what this job will do. 'start' (default) indicates the job will start the deployment. 'prepare'/'verify'/'access' indicates this will not affect the deployment. 'stop' indicates this will stop the deployment. */
67
+ action?: "start" | "prepare" | "stop" | "verify" | "access";
68
+ /** The amount of time it should take before Gitlab will automatically stop the environment. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'. */
69
+ auto_stop_in?: string;
70
+ /** Explicitly specifies the tier of the deployment environment if non-standard environment name is used. */
71
+ deployment_tier?: "production" | "staging" | "testing" | "development" | "other";
72
+ /** Used to configure the kubernetes deployment for this environment. This is currently not supported for kubernetes clusters that are managed by Gitlab. */
73
+ kubernetes?: Record<string, unknown>;
74
+ /** The name of a job to execute when the environment is about to be stopped. */
75
+ on_stop?: string;
76
+ /** When set, this will expose buttons in various places for the current environment in Gitlab, that will take you to the defined URL. */
77
+ url?: string;
78
+ });
79
+ }
80
+
81
+ export declare class Image {
82
+ constructor(props: {
83
+ /** Full name of the image that should be used. It should contain the Registry part if needed. */
84
+ name: string;
85
+ docker?: Record<string, unknown>;
86
+ /** Command or script that should be executed as the container's entrypoint. It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array. */
87
+ entrypoint?: any[];
88
+ pull_policy?: "always" | "never" | "if-not-present" | "always" | "never" | "if-not-present"[];
89
+ });
90
+ }
91
+
92
+ export declare class Include {
93
+ constructor(props: {
94
+ file: string | string[];
95
+ /** Path to the project, e.g. `group/project`, or `group/sub-group/project` [Learn more](https://docs.gitlab.com/ee/ci/yaml/index.html#includefile). */
96
+ project: string;
97
+ inputs?: Record<string, unknown>;
98
+ /** Branch/Tag/Commit-hash for the target project. */
99
+ ref?: string;
100
+ rules?: any[];
101
+ });
102
+ }
103
+
104
+ export declare class Job {
105
+ constructor(props: {
106
+ after_script?: string | string[];
107
+ allow_failure?: AllowFailure | boolean;
108
+ artifacts?: Artifacts;
109
+ before_script?: string | string[];
110
+ cache?: Cache | Cache[];
111
+ /** Must be a regular expression, optionally but recommended to be quoted, and must be surrounded with '/'. Example: '/Code coverage: \d+\.\d+/' */
112
+ coverage?: string;
113
+ /** Specify a list of job names from earlier stages from which artifacts should be loaded. By default, all previous artifacts are passed. Use an empty array to skip downloading artifacts. */
114
+ dependencies?: string[];
115
+ /** Used to associate environment metadata with a deploy. Environment can have a name and URL attached to it, and will be displayed under /environments under the project. */
116
+ environment?: string | Record<string, any>;
117
+ /** Job will run *except* for when these filtering options match. */
118
+ except?: any;
119
+ /** The name of one or more jobs to inherit configuration from. */
120
+ extends?: string | string[];
121
+ hooks?: Record<string, unknown>;
122
+ id_tokens?: Record<string, unknown>;
123
+ identity?: "google_cloud";
124
+ image?: Image;
125
+ inherit?: Record<string, unknown>;
126
+ interruptible?: boolean;
127
+ manual_confirmation?: string;
128
+ /** The list of jobs in previous stages whose sole completion is needed to start the current job. */
129
+ needs?: string | Record<string, any> | any[][];
130
+ /** Job will run *only* when these filtering options match. */
131
+ only?: any;
132
+ pages?: Record<string, any> | boolean;
133
+ parallel?: Parallel | number;
134
+ /** A path to a directory that contains the files to be published with Pages */
135
+ publish?: string;
136
+ /** Indicates that the job creates a Release. */
137
+ release?: Record<string, unknown>;
138
+ /** Limit job concurrency. Can be used to ensure that the Runner will not run certain jobs simultaneously. */
139
+ resource_group?: string;
140
+ retry?: Retry | number;
141
+ rules?: Rule[];
142
+ run?: any[];
143
+ script?: string | string[];
144
+ secrets?: Record<string, unknown>;
145
+ services?: Service[];
146
+ /** Define what stage the job will run in. */
147
+ stage?: string | string[];
148
+ start_in?: string;
149
+ tags?: any[];
150
+ timeout?: string;
151
+ trigger?: Record<string, any> | string;
152
+ variables?: Record<string, unknown>;
153
+ when?: "on_success" | "on_failure" | "always" | "never" | "manual" | "delayed";
154
+ });
155
+ }
156
+
157
+ export declare class Parallel {
158
+ constructor(props: {
159
+ /** Defines different variables for jobs that are running in parallel. */
160
+ matrix: Record<string, unknown>[];
161
+ });
162
+ }
163
+
164
+ export declare class Release {
165
+ constructor(props: {
166
+ /** Specifies the longer description of the Release. */
167
+ description: string;
168
+ /** The tag_name must be specified. It can refer to an existing Git tag or can be specified by the user. */
169
+ tag_name: string;
170
+ assets?: Record<string, unknown>;
171
+ /** The title of each milestone the release is associated with. */
172
+ milestones?: string[];
173
+ /** The Release name. If omitted, it is populated with the value of release: tag_name. */
174
+ name?: string;
175
+ /** If the release: tag_name doesn’t exist yet, the release is created from ref. ref can be a commit SHA, another tag name, or a branch name. */
176
+ ref?: string;
177
+ /** The date and time when the release is ready. Defaults to the current date and time if not defined. Should be enclosed in quotes and expressed in ISO 8601 format. */
178
+ released_at?: string;
179
+ /** Message to use if creating a new annotated tag. */
180
+ tag_message?: string;
181
+ });
182
+ }
183
+
184
+ export declare class Retry {
185
+ constructor(props: {
186
+ exit_codes?: number[] | number;
187
+ max?: number;
188
+ when?: any[];
189
+ });
190
+ }
191
+
192
+ export declare class Rule {
193
+ constructor(props: {
194
+ allow_failure?: AllowFailure | boolean;
195
+ changes?: any;
196
+ exists?: any;
197
+ if?: string;
198
+ interruptible?: boolean;
199
+ needs?: any[];
200
+ start_in?: string;
201
+ variables?: Record<string, unknown>;
202
+ when?: "on_success" | "on_failure" | "always" | "never" | "manual" | "delayed";
203
+ });
204
+ }
205
+
206
+ export declare class Trigger {
207
+ constructor(props: {
208
+ /** Path to the project, e.g. `group/project`, or `group/sub-group/project`. */
209
+ project: string;
210
+ /** The branch name that a downstream pipeline will use */
211
+ branch?: string;
212
+ /** Specify what to forward to the downstream pipeline. */
213
+ forward?: Record<string, unknown>;
214
+ /** You can mirror the pipeline status from the triggered pipeline to the source bridge job by using strategy: depend */
215
+ strategy?: "depend";
216
+ });
217
+ }
218
+
219
+ export declare class Workflow {
220
+ constructor(props: {
221
+ auto_cancel?: AutoCancel;
222
+ name?: string;
223
+ rules?: Record<string, any> | string[][];
224
+ });
225
+ }
226
+
227
+ // --- CI/CD Variables ---
228
+
229
+ export declare const CI: {
230
+ readonly CommitBranch: string;
231
+ readonly CommitRef: string;
232
+ readonly CommitSha: string;
233
+ readonly CommitTag: string;
234
+ readonly DefaultBranch: string;
235
+ readonly Environment: string;
236
+ readonly JobId: string;
237
+ readonly JobName: string;
238
+ readonly JobStage: string;
239
+ readonly MergeRequestIid: string;
240
+ readonly PipelineId: string;
241
+ readonly PipelineSource: string;
242
+ readonly ProjectDir: string;
243
+ readonly ProjectId: string;
244
+ readonly ProjectName: string;
245
+ readonly ProjectPath: string;
246
+ readonly Registry: string;
247
+ readonly RegistryImage: string;
248
+ };
@@ -0,0 +1,23 @@
1
+ // Code generated by chant generate. DO NOT EDIT.
2
+ import { createResource, createProperty } from "./runtime";
3
+
4
+ export const Default = createResource("GitLab::CI::Default", "gitlab", {});
5
+ export const Job = createResource("GitLab::CI::Job", "gitlab", {});
6
+ export const Workflow = createResource("GitLab::CI::Workflow", "gitlab", {});
7
+
8
+ export const AllowFailure = createProperty("GitLab::CI::AllowFailure", "gitlab");
9
+ export const Artifacts = createProperty("GitLab::CI::Artifacts", "gitlab");
10
+ export const AutoCancel = createProperty("GitLab::CI::AutoCancel", "gitlab");
11
+ export const Cache = createProperty("GitLab::CI::Cache", "gitlab");
12
+ export const Environment = createProperty("GitLab::CI::Environment", "gitlab");
13
+ export const Image = createProperty("GitLab::CI::Image", "gitlab");
14
+ export const Include = createProperty("GitLab::CI::Include", "gitlab");
15
+ export const Parallel = createProperty("GitLab::CI::Parallel", "gitlab");
16
+ export const Release = createProperty("GitLab::CI::Release", "gitlab");
17
+ export const Retry = createProperty("GitLab::CI::Retry", "gitlab");
18
+ export const Rule = createProperty("GitLab::CI::Rule", "gitlab");
19
+ export const Trigger = createProperty("GitLab::CI::Trigger", "gitlab");
20
+
21
+ // Re-exports for convenience
22
+ export { reference } from "../intrinsics";
23
+ export { CI } from "../variables";
@@ -0,0 +1,77 @@
1
+ {
2
+ "AllowFailure": {
3
+ "resourceType": "GitLab::CI::AllowFailure",
4
+ "kind": "property",
5
+ "lexicon": "gitlab"
6
+ },
7
+ "Artifacts": {
8
+ "resourceType": "GitLab::CI::Artifacts",
9
+ "kind": "property",
10
+ "lexicon": "gitlab"
11
+ },
12
+ "AutoCancel": {
13
+ "resourceType": "GitLab::CI::AutoCancel",
14
+ "kind": "property",
15
+ "lexicon": "gitlab"
16
+ },
17
+ "Cache": {
18
+ "resourceType": "GitLab::CI::Cache",
19
+ "kind": "property",
20
+ "lexicon": "gitlab"
21
+ },
22
+ "Default": {
23
+ "resourceType": "GitLab::CI::Default",
24
+ "kind": "resource",
25
+ "lexicon": "gitlab"
26
+ },
27
+ "Environment": {
28
+ "resourceType": "GitLab::CI::Environment",
29
+ "kind": "property",
30
+ "lexicon": "gitlab"
31
+ },
32
+ "Image": {
33
+ "resourceType": "GitLab::CI::Image",
34
+ "kind": "property",
35
+ "lexicon": "gitlab"
36
+ },
37
+ "Include": {
38
+ "resourceType": "GitLab::CI::Include",
39
+ "kind": "property",
40
+ "lexicon": "gitlab"
41
+ },
42
+ "Job": {
43
+ "resourceType": "GitLab::CI::Job",
44
+ "kind": "resource",
45
+ "lexicon": "gitlab"
46
+ },
47
+ "Parallel": {
48
+ "resourceType": "GitLab::CI::Parallel",
49
+ "kind": "property",
50
+ "lexicon": "gitlab"
51
+ },
52
+ "Release": {
53
+ "resourceType": "GitLab::CI::Release",
54
+ "kind": "property",
55
+ "lexicon": "gitlab"
56
+ },
57
+ "Retry": {
58
+ "resourceType": "GitLab::CI::Retry",
59
+ "kind": "property",
60
+ "lexicon": "gitlab"
61
+ },
62
+ "Rule": {
63
+ "resourceType": "GitLab::CI::Rule",
64
+ "kind": "property",
65
+ "lexicon": "gitlab"
66
+ },
67
+ "Trigger": {
68
+ "resourceType": "GitLab::CI::Trigger",
69
+ "kind": "property",
70
+ "lexicon": "gitlab"
71
+ },
72
+ "Workflow": {
73
+ "resourceType": "GitLab::CI::Workflow",
74
+ "kind": "resource",
75
+ "lexicon": "gitlab"
76
+ }
77
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Runtime factory constructors — re-exported from core.
3
+ */
4
+ export { createResource, createProperty } from "@intentius/chant/runtime";