@intentius/chant-lexicon-gitlab 0.6.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 +2 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +12 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/fetch.d.ts +40 -0
- package/dist/codegen/fetch.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +6 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate-lexicon.d.ts +19 -0
- package/dist/codegen/generate-lexicon.d.ts.map +1 -0
- package/dist/codegen/generate-typescript.d.ts +11 -0
- package/dist/codegen/generate-typescript.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +19 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/naming.d.ts +15 -0
- package/dist/codegen/naming.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +11 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/codegen/parse.d.ts +60 -0
- package/dist/codegen/parse.d.ts.map +1 -0
- package/dist/codegen/patches.d.ts +31 -0
- package/dist/codegen/patches.d.ts.map +1 -0
- package/dist/codegen/typecheck.d.ts +5 -0
- package/dist/codegen/typecheck.d.ts.map +1 -0
- package/dist/composites/docker-build.d.ts +29 -0
- package/dist/composites/docker-build.d.ts.map +1 -0
- package/dist/composites/index.d.ts +11 -0
- package/dist/composites/index.d.ts.map +1 -0
- package/dist/composites/mr-plan-report.d.ts +43 -0
- package/dist/composites/mr-plan-report.d.ts.map +1 -0
- package/dist/composites/node-pipeline.d.ts +55 -0
- package/dist/composites/node-pipeline.d.ts.map +1 -0
- package/dist/composites/python-pipeline.d.ts +21 -0
- package/dist/composites/python-pipeline.d.ts.map +1 -0
- package/dist/composites/review-app.d.ts +24 -0
- package/dist/composites/review-app.d.ts.map +1 -0
- package/dist/coverage.d.ts +18 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/generated/index.d.ts +22 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/runtime.d.ts +5 -0
- package/dist/generated/runtime.d.ts.map +1 -0
- package/dist/import/generator.d.ts +19 -0
- package/dist/import/generator.d.ts.map +1 -0
- package/dist/import/parser.d.ts +14 -0
- package/dist/import/parser.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +12 -12
- package/dist/intrinsics.d.ts +30 -0
- package/dist/intrinsics.d.ts.map +1 -0
- 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/wgl010.d.ts +9 -0
- package/dist/lint/post-synth/wgl010.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl011.d.ts +13 -0
- package/dist/lint/post-synth/wgl011.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl012.d.ts +13 -0
- package/dist/lint/post-synth/wgl012.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl013.d.ts +16 -0
- package/dist/lint/post-synth/wgl013.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl014.d.ts +13 -0
- package/dist/lint/post-synth/wgl014.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl015.d.ts +12 -0
- package/dist/lint/post-synth/wgl015.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl016.d.ts +10 -0
- package/dist/lint/post-synth/wgl016.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl017.d.ts +10 -0
- package/dist/lint/post-synth/wgl017.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl018.d.ts +9 -0
- package/dist/lint/post-synth/wgl018.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl019.d.ts +9 -0
- package/dist/lint/post-synth/wgl019.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl020.d.ts +11 -0
- package/dist/lint/post-synth/wgl020.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl021.d.ts +10 -0
- package/dist/lint/post-synth/wgl021.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl022.d.ts +10 -0
- package/dist/lint/post-synth/wgl022.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl023.d.ts +10 -0
- package/dist/lint/post-synth/wgl023.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl024.d.ts +10 -0
- package/dist/lint/post-synth/wgl024.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl025.d.ts +10 -0
- package/dist/lint/post-synth/wgl025.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl026.d.ts +10 -0
- package/dist/lint/post-synth/wgl026.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl027.d.ts +9 -0
- package/dist/lint/post-synth/wgl027.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl028.d.ts +11 -0
- package/dist/lint/post-synth/wgl028.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl029.d.ts +11 -0
- package/dist/lint/post-synth/wgl029.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl030.d.ts +11 -0
- package/dist/lint/post-synth/wgl030.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl031.d.ts +11 -0
- package/dist/lint/post-synth/wgl031.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl032.d.ts +12 -0
- package/dist/lint/post-synth/wgl032.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl033.d.ts +11 -0
- package/dist/lint/post-synth/wgl033.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl034.d.ts +12 -0
- package/dist/lint/post-synth/wgl034.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl035.d.ts +12 -0
- package/dist/lint/post-synth/wgl035.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl036.d.ts +14 -0
- package/dist/lint/post-synth/wgl036.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl037.d.ts +12 -0
- package/dist/lint/post-synth/wgl037.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl038.d.ts +14 -0
- package/dist/lint/post-synth/wgl038.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl039.d.ts +11 -0
- package/dist/lint/post-synth/wgl039.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl040.d.ts +11 -0
- package/dist/lint/post-synth/wgl040.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl041.d.ts +13 -0
- package/dist/lint/post-synth/wgl041.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl042.d.ts +12 -0
- package/dist/lint/post-synth/wgl042.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl043.d.ts +12 -0
- package/dist/lint/post-synth/wgl043.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl044.d.ts +11 -0
- package/dist/lint/post-synth/wgl044.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl045.d.ts +12 -0
- package/dist/lint/post-synth/wgl045.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl046.d.ts +12 -0
- package/dist/lint/post-synth/wgl046.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl047.d.ts +11 -0
- package/dist/lint/post-synth/wgl047.d.ts.map +1 -0
- package/dist/lint/post-synth/wgl048.d.ts +11 -0
- package/dist/lint/post-synth/wgl048.d.ts.map +1 -0
- package/dist/lint/post-synth/yaml-helpers.d.ts +107 -0
- package/dist/lint/post-synth/yaml-helpers.d.ts.map +1 -0
- package/dist/lint/rules/artifact-no-expiry.d.ts +9 -0
- package/dist/lint/rules/artifact-no-expiry.d.ts.map +1 -0
- package/dist/lint/rules/data/known-include-sources.d.ts +14 -0
- package/dist/lint/rules/data/known-include-sources.d.ts.map +1 -0
- package/dist/lint/rules/data/untrusted-variables.d.ts +14 -0
- package/dist/lint/rules/data/untrusted-variables.d.ts.map +1 -0
- package/dist/lint/rules/deprecated-only-except.d.ts +10 -0
- package/dist/lint/rules/deprecated-only-except.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +8 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/missing-script.d.ts +9 -0
- package/dist/lint/rules/missing-script.d.ts.map +1 -0
- package/dist/lint/rules/missing-stage.d.ts +9 -0
- package/dist/lint/rules/missing-stage.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +6 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +6 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +1 -1
- package/dist/mcp/context-tools.d.ts +20 -0
- package/dist/mcp/context-tools.d.ts.map +1 -0
- package/dist/migrate/from-github/actions/index.d.ts +13 -0
- package/dist/migrate/from-github/actions/index.d.ts.map +1 -0
- package/dist/migrate/from-github/actions/registry.d.ts +63 -0
- package/dist/migrate/from-github/actions/registry.d.ts.map +1 -0
- package/dist/migrate/from-github/actions/tier-1.d.ts +20 -0
- package/dist/migrate/from-github/actions/tier-1.d.ts.map +1 -0
- package/dist/migrate/from-github/actions/tier-2.d.ts +9 -0
- package/dist/migrate/from-github/actions/tier-2.d.ts.map +1 -0
- package/dist/migrate/from-github/actions/tier-3.d.ts +9 -0
- package/dist/migrate/from-github/actions/tier-3.d.ts.map +1 -0
- package/dist/migrate/from-github/composites/patterns.d.ts +27 -0
- package/dist/migrate/from-github/composites/patterns.d.ts.map +1 -0
- package/dist/migrate/from-github/composites/rewriter.d.ts +14 -0
- package/dist/migrate/from-github/composites/rewriter.d.ts.map +1 -0
- package/dist/migrate/from-github/diagnostics.d.ts +17 -0
- package/dist/migrate/from-github/diagnostics.d.ts.map +1 -0
- package/dist/migrate/from-github/emit-yaml.d.ts +16 -0
- package/dist/migrate/from-github/emit-yaml.d.ts.map +1 -0
- package/dist/migrate/from-github/expressions.d.ts +65 -0
- package/dist/migrate/from-github/expressions.d.ts.map +1 -0
- package/dist/migrate/from-github/index.d.ts +61 -0
- package/dist/migrate/from-github/index.d.ts.map +1 -0
- package/dist/migrate/from-github/provenance.d.ts +68 -0
- package/dist/migrate/from-github/provenance.d.ts.map +1 -0
- package/dist/migrate/from-github/rules.d.ts +12 -0
- package/dist/migrate/from-github/rules.d.ts.map +1 -0
- package/dist/migrate/from-github/security.d.ts +35 -0
- package/dist/migrate/from-github/security.d.ts.map +1 -0
- package/dist/migrate/from-github/stages.d.ts +34 -0
- package/dist/migrate/from-github/stages.d.ts.map +1 -0
- package/dist/migrate/from-github/transformer.d.ts +26 -0
- package/dist/migrate/from-github/transformer.d.ts.map +1 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/rules/wgl011.ts +2 -2
- package/dist/rules/wgl012.ts +2 -2
- package/dist/rules/wgl018.ts +2 -2
- package/dist/rules/wgl019.ts +2 -2
- package/dist/rules/wgl022.ts +2 -2
- package/dist/rules/wgl023.ts +2 -2
- package/dist/rules/wgl024.ts +2 -2
- package/dist/rules/wgl025.ts +2 -2
- package/dist/rules/wgl026.ts +2 -2
- package/dist/rules/wgl027.ts +2 -2
- package/dist/serializer.d.ts +14 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/testdata/create-fixture.d.ts +7 -0
- package/dist/testdata/create-fixture.d.ts.map +1 -0
- package/dist/testdata/load-fixtures.d.ts +12 -0
- package/dist/testdata/load-fixtures.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 +17 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/variables.d.ts +31 -0
- package/dist/variables.d.ts.map +1 -0
- package/package.json +20 -6
- package/src/codegen/parse.ts +2 -2
- package/src/lint/post-synth/index.ts +83 -0
- package/src/lint/post-synth/wgl011.ts +2 -2
- package/src/lint/post-synth/wgl012.ts +2 -2
- package/src/lint/post-synth/wgl018.ts +2 -2
- package/src/lint/post-synth/wgl019.ts +2 -2
- package/src/lint/post-synth/wgl022.ts +2 -2
- package/src/lint/post-synth/wgl023.ts +2 -2
- package/src/lint/post-synth/wgl024.ts +2 -2
- package/src/lint/post-synth/wgl025.ts +2 -2
- package/src/lint/post-synth/wgl026.ts +2 -2
- package/src/lint/post-synth/wgl027.ts +2 -2
- package/src/mcp/context-tools.ts +3 -5
- package/src/plugin.ts +2 -3
- package/src/serializer.ts +5 -5
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern recognisers for `chant migrate --use-composites`.
|
|
3
|
+
*
|
|
4
|
+
* Each pattern walks the GitLab IR looking for a recognisable shape
|
|
5
|
+
* (e.g. NodePipeline-shaped 2-job setup) and rewrites the matched
|
|
6
|
+
* resources into a sentinel IR type (`GitLab::Composite::NodePipeline`)
|
|
7
|
+
* that the GitLab generator (`lexicons/gitlab/src/import/generator.ts`)
|
|
8
|
+
* will emit as `NodePipeline({...})` instead of raw `new Job(...)`.
|
|
9
|
+
*/
|
|
10
|
+
import type { TemplateIR, ResourceIR } from "@intentius/chant/import/parser";
|
|
11
|
+
import type { ProvenanceRecord } from "../provenance.js";
|
|
12
|
+
export interface CompositePattern {
|
|
13
|
+
name: string;
|
|
14
|
+
match(ir: TemplateIR): MatchResult | null;
|
|
15
|
+
rewrite(ir: TemplateIR, match: MatchResult): {
|
|
16
|
+
ir: TemplateIR;
|
|
17
|
+
provenance: ProvenanceRecord[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface MatchResult {
|
|
21
|
+
/** Resource logicalIds to remove */
|
|
22
|
+
removed: string[];
|
|
23
|
+
/** New composite resource to add */
|
|
24
|
+
added: ResourceIR;
|
|
25
|
+
}
|
|
26
|
+
export declare const PATTERNS: CompositePattern[];
|
|
27
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../../../src/migrate/from-github/composites/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG;QAAE,EAAE,EAAE,UAAU,CAAC;QAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAC;CACjG;AAED,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oCAAoC;IACpC,KAAK,EAAE,UAAU,CAAC;CACnB;AA0ID,eAAO,MAAM,QAAQ,EAAE,gBAAgB,EAItC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--use-composites` orchestrator: walks the registered patterns and
|
|
3
|
+
* applies the first match. Patterns are tried in declaration order
|
|
4
|
+
* (NodePipeline before NodeCI so the 2-job shape wins over the 1-job
|
|
5
|
+
* shape when both could match).
|
|
6
|
+
*/
|
|
7
|
+
import type { TemplateIR } from "@intentius/chant/import/parser";
|
|
8
|
+
import type { ProvenanceRecord } from "../provenance.js";
|
|
9
|
+
import { type CompositePattern } from "./patterns.js";
|
|
10
|
+
export declare function applyComposites(ir: TemplateIR, registry?: CompositePattern[]): {
|
|
11
|
+
ir: TemplateIR;
|
|
12
|
+
provenance: ProvenanceRecord[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=rewriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewriter.d.ts","sourceRoot":"","sources":["../../../../src/migrate/from-github/composites/rewriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE7D,wBAAgB,eAAe,CAC7B,EAAE,EAAE,UAAU,EACd,QAAQ,GAAE,gBAAgB,EAAa,GACtC;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAcpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert ProvenanceRecord[] into LintDiagnostic[] for SARIF output.
|
|
3
|
+
*
|
|
4
|
+
* Mapping:
|
|
5
|
+
* - category "needs-review" → severity "warning" (or "error" if --strict)
|
|
6
|
+
* - category "skipped" → severity "info"
|
|
7
|
+
* - category "action-map" tier 3 → severity "warning"
|
|
8
|
+
* - all others → no diagnostic (clean translation)
|
|
9
|
+
*/
|
|
10
|
+
import type { LintDiagnostic } from "@intentius/chant/lint/rule";
|
|
11
|
+
import type { ProvenanceRecord } from "./provenance.js";
|
|
12
|
+
export interface DiagnosticOptions {
|
|
13
|
+
/** When true, needs-review records become errors instead of warnings */
|
|
14
|
+
strict?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function provenanceToDiagnostics(records: ProvenanceRecord[], opts?: DiagnosticOptions): LintDiagnostic[];
|
|
17
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,IAAI,GAAE,iBAAsB,GAC3B,cAAc,EAAE,CAyClB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Direct GitLab TemplateIR → `.gitlab-ci.yml` text emission.
|
|
3
|
+
*
|
|
4
|
+
* We deliberately bypass the existing `gitlabSerializer.serialize()` because
|
|
5
|
+
* that path consumes `Map<string, Declarable>` (entity instances built by
|
|
6
|
+
* user TS code), not a raw IR. Going through entity instances would require
|
|
7
|
+
* runtime construction of typed objects we don't have. Direct emission is
|
|
8
|
+
* ~60 LOC.
|
|
9
|
+
*/
|
|
10
|
+
import type { TemplateIR } from "@intentius/chant/import/parser";
|
|
11
|
+
/**
|
|
12
|
+
* Convert a GitLab `TemplateIR` (produced by the GH→GL transformer) into
|
|
13
|
+
* `.gitlab-ci.yml` text.
|
|
14
|
+
*/
|
|
15
|
+
export declare function emitGitlabYaml(ir: TemplateIR): string;
|
|
16
|
+
//# sourceMappingURL=emit-yaml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-yaml.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/emit-yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AA6CjE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAoErD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Actions expression substitution.
|
|
3
|
+
*
|
|
4
|
+
* Translates `${{ github.X }}`, `${{ runner.X }}`, `${{ secrets.X }}`,
|
|
5
|
+
* `${{ env.X }}`, `${{ vars.X }}`, `${{ inputs.X }}`, `${{ matrix.X }}`,
|
|
6
|
+
* and a small set of expression functions (`always()`, `failure()`, etc.)
|
|
7
|
+
* to their GitLab CI predefined-variable equivalents.
|
|
8
|
+
*
|
|
9
|
+
* Source: the upstream `github-actions-to-gitlab-ci` skill's
|
|
10
|
+
* `references/syntax-mapping.md` "github.* context expressions" tables.
|
|
11
|
+
*/
|
|
12
|
+
import type { ProvenanceRecord } from "./provenance.js";
|
|
13
|
+
/**
|
|
14
|
+
* Map a GitHub `if:` boolean function to a GitLab `when:` value or rule.
|
|
15
|
+
*
|
|
16
|
+
* Returned tuple is `[gitlabExpression, isWhenClause]` — when `isWhenClause`
|
|
17
|
+
* is true, the caller should emit `when: <expr>` rather than `if: <expr>`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function translateIfFunction(expr: string): {
|
|
20
|
+
expression: string;
|
|
21
|
+
whenClause?: string;
|
|
22
|
+
needsReview?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Substitute all `${{ ... }}` template expressions in a string with their
|
|
26
|
+
* GitLab equivalents. Returns the substituted string plus any provenance
|
|
27
|
+
* records describing which substitutions happened (or which need review).
|
|
28
|
+
*/
|
|
29
|
+
export declare function substituteExpressions(input: string, ctx: {
|
|
30
|
+
gitlabPath: string;
|
|
31
|
+
sourceKey?: string;
|
|
32
|
+
sourceFile?: string;
|
|
33
|
+
}): {
|
|
34
|
+
output: string;
|
|
35
|
+
provenance: ProvenanceRecord[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Substitute GitHub identifiers (e.g. `github.ref`) appearing anywhere
|
|
39
|
+
* in a string with their GitLab predefined-variable equivalents.
|
|
40
|
+
* Used for if-conditions, concurrency.group values, and other places
|
|
41
|
+
* where identifiers appear without `${{ }}` wrapping.
|
|
42
|
+
*/
|
|
43
|
+
export declare function substituteIdentifiers(input: string, ctx: {
|
|
44
|
+
gitlabPath: string;
|
|
45
|
+
sourceKey?: string;
|
|
46
|
+
sourceFile?: string;
|
|
47
|
+
}): {
|
|
48
|
+
output: string;
|
|
49
|
+
provenance: ProvenanceRecord[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Translate a GitHub `if:` condition expression (without `${{ }}` wrapping)
|
|
53
|
+
* into a GitLab `rules:if:` expression. Returns substituted expression and
|
|
54
|
+
* any whenClause hint extracted from boolean function calls.
|
|
55
|
+
*/
|
|
56
|
+
export declare function translateIfCondition(rawIf: string, ctx: {
|
|
57
|
+
gitlabPath: string;
|
|
58
|
+
sourceKey?: string;
|
|
59
|
+
sourceFile?: string;
|
|
60
|
+
}): {
|
|
61
|
+
ifExpression: string;
|
|
62
|
+
whenClause?: string;
|
|
63
|
+
provenance: ProvenanceRecord[];
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=expressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/expressions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAyCrD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GACX;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CASpE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAwGpD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAmEpD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CA6B/E"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for the GitHub Actions → GitLab CI migration tool.
|
|
3
|
+
*
|
|
4
|
+
* Lazy-imports `@intentius/chant-lexicon-github` so users who don't need
|
|
5
|
+
* migration don't pay the install cost (the github lexicon is an optional
|
|
6
|
+
* peer dependency of `@intentius/chant-lexicon-gitlab`).
|
|
7
|
+
*/
|
|
8
|
+
import type { TemplateIR } from "@intentius/chant/import/parser";
|
|
9
|
+
import type { LintDiagnostic } from "@intentius/chant/lint/rule";
|
|
10
|
+
import { type ProvenanceRecord } from "./provenance.js";
|
|
11
|
+
import type { ActionMappingRegistry } from "./actions/registry.js";
|
|
12
|
+
import "./actions/index.js";
|
|
13
|
+
export interface MigrateOptions {
|
|
14
|
+
/** Output format. */
|
|
15
|
+
emit?: "yaml" | "ts";
|
|
16
|
+
/** Enable composite-pattern recognition (Node patterns in v1). */
|
|
17
|
+
useComposites?: boolean;
|
|
18
|
+
/** Source file path for provenance (display only). */
|
|
19
|
+
sourceFile?: string;
|
|
20
|
+
/** Inject a custom action mapping registry for testing. */
|
|
21
|
+
registry?: ActionMappingRegistry;
|
|
22
|
+
/** Escalate needs-review diagnostics to errors. */
|
|
23
|
+
strict?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Security-aware migration (#306): classify each security property's fate
|
|
26
|
+
* across the edge and run the GitLab security post-synth checks against the
|
|
27
|
+
* migrated YAML. Enabled by the CLI's `--validate` path.
|
|
28
|
+
*/
|
|
29
|
+
security?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface MigrationResult {
|
|
32
|
+
/** GitLab IR (consumed by `chant import`-style tools downstream). */
|
|
33
|
+
ir: TemplateIR;
|
|
34
|
+
/** Rendered output (YAML by default, TS when emit: "ts"). */
|
|
35
|
+
output: string;
|
|
36
|
+
/** Per-key provenance records. */
|
|
37
|
+
provenance: ProvenanceRecord[];
|
|
38
|
+
/** SARIF-shaped diagnostics derived from provenance. */
|
|
39
|
+
diagnostics: LintDiagnostic[];
|
|
40
|
+
/** Inferred stage list. */
|
|
41
|
+
stages: string[];
|
|
42
|
+
/** Markdown "Security posture" section (#306). */
|
|
43
|
+
securityPosture: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Migrate a GitHub Actions workflow YAML into GitLab CI.
|
|
47
|
+
*
|
|
48
|
+
* @param yamlContent raw .github/workflows/*.yml content
|
|
49
|
+
* @param opts migration options
|
|
50
|
+
*/
|
|
51
|
+
export declare function transform(yamlContent: string, opts?: MigrateOptions): Promise<MigrationResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Lightweight detector: does this YAML look like a GitHub Actions workflow?
|
|
54
|
+
* Used by the plugin's `migrationSource("github")` extension.
|
|
55
|
+
*/
|
|
56
|
+
export declare function detectGitHubWorkflow(content: string): boolean;
|
|
57
|
+
export { ProvenanceAccumulator } from "./provenance.js";
|
|
58
|
+
export type { ProvenanceRecord, ProvenanceCategory } from "./provenance.js";
|
|
59
|
+
export type { ActionMapping, ActionMapCtx, ActionMappedResult, ActionMappingRegistry } from "./actions/registry.js";
|
|
60
|
+
export { createRegistry, getDefaultRegistry, lookupAction } from "./actions/registry.js";
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAO5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAIhE,OAAO,iBAAiB,CAAC;AAEzB,MAAM,WAAW,cAAc;IAC7B,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,EAAE,EAAE,UAAU,CAAC;IACf,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,wDAAwD;IACxD,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kDAAkD;IAClD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,eAAe,CAAC,CAiE1B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI7D;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-node provenance for GitHub Actions → GitLab CI migration.
|
|
3
|
+
*
|
|
4
|
+
* Returned as a side channel from `transform()` so the IR stays clean
|
|
5
|
+
* (re-usable by `chant import`) while still capturing per-key migration
|
|
6
|
+
* history for SARIF/Markdown reporting.
|
|
7
|
+
*/
|
|
8
|
+
export type ProvenanceCategory = "literal" | "rewrite" | "synthesis" | "needs-review" | "skipped" | "action-map";
|
|
9
|
+
export interface ProvenanceRecord {
|
|
10
|
+
/** Where this lives in the output (GitLab IR) — e.g. "jobs.test.script[2]" */
|
|
11
|
+
gitlabPath: string;
|
|
12
|
+
/** Resource logicalId in the GitLab IR, if applicable */
|
|
13
|
+
gitlabLogicalId?: string;
|
|
14
|
+
/** Source file name (for SARIF) */
|
|
15
|
+
sourceFile?: string;
|
|
16
|
+
/** 1-based source line (best effort) */
|
|
17
|
+
sourceLine?: number;
|
|
18
|
+
/** 1-based source column (best effort) */
|
|
19
|
+
sourceColumn?: number;
|
|
20
|
+
/** YAML path in the source (e.g. "jobs.test.steps[1].uses") */
|
|
21
|
+
sourceKey?: string;
|
|
22
|
+
/** What category of translation happened */
|
|
23
|
+
category: ProvenanceCategory;
|
|
24
|
+
/** Rule ID (e.g. "MIG-TRIGGER-001", "ACT-actions-checkout") */
|
|
25
|
+
rule: string;
|
|
26
|
+
/** Free-form explanation for human readers */
|
|
27
|
+
note?: string;
|
|
28
|
+
/** Original action reference (e.g. "actions/checkout@v4") for action-map records */
|
|
29
|
+
actionRef?: string;
|
|
30
|
+
/** Tier 1/2/3 for action-map records */
|
|
31
|
+
mappingTier?: 1 | 2 | 3;
|
|
32
|
+
/** Security classification, when this record concerns a security property. */
|
|
33
|
+
security?: SecurityProvenance;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Fate of a security property as it crosses the GitHub → GitLab boundary,
|
|
37
|
+
* mirroring the functional provenance categories.
|
|
38
|
+
*/
|
|
39
|
+
export type SecurityFate = "translated" | "approximated" | "needs-review" | "lost";
|
|
40
|
+
/**
|
|
41
|
+
* Security classification attached to a provenance record — tracks whether a
|
|
42
|
+
* security-relevant property survived migration, alongside the functional one.
|
|
43
|
+
*/
|
|
44
|
+
export interface SecurityProvenance {
|
|
45
|
+
/** Human label for the property (e.g. "Pinned action SHA"). */
|
|
46
|
+
property: string;
|
|
47
|
+
/** What happened to the property across the migration edge. */
|
|
48
|
+
fate: SecurityFate;
|
|
49
|
+
/** Diagnostic severity for this finding. */
|
|
50
|
+
severity: "error" | "warning" | "info";
|
|
51
|
+
/** Cross-reference to the endpoint that re-establishes the property. */
|
|
52
|
+
reestablish?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Accumulator passed through the transformer pipeline so any step can
|
|
56
|
+
* append to the same provenance list without threading return values.
|
|
57
|
+
*/
|
|
58
|
+
export declare class ProvenanceAccumulator {
|
|
59
|
+
private records;
|
|
60
|
+
push(record: ProvenanceRecord): void;
|
|
61
|
+
pushAll(records: ProvenanceRecord[]): void;
|
|
62
|
+
all(): ProvenanceRecord[];
|
|
63
|
+
byCategory(category: ProvenanceCategory): ProvenanceRecord[];
|
|
64
|
+
needsReviewCount(): number;
|
|
65
|
+
/** Records carrying a security classification. */
|
|
66
|
+
securityRecords(): ProvenanceRecord[];
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,SAAS,GACT,WAAW,GACX,cAAc,GACd,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM,CAAC;AAEnF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,IAAI,EAAE,YAAY,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAA0B;IAEzC,IAAI,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAIpC,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,IAAI;IAI1C,GAAG,IAAI,gBAAgB,EAAE;IAIzB,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,gBAAgB,EAAE;IAI5D,gBAAgB,IAAI,MAAM;IAI1B,kDAAkD;IAClD,eAAe,IAAI,gBAAgB,EAAE;CAGtC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static LintRule metadata for SARIF enrichment.
|
|
3
|
+
*
|
|
4
|
+
* Each rule fired by the transformer (provenance.rule field) gets a
|
|
5
|
+
* corresponding entry here so SARIF output carries description + helpUri.
|
|
6
|
+
*
|
|
7
|
+
* These rules don't actually run a `check()` — the work has already been
|
|
8
|
+
* done by the transformer. They're metadata-only.
|
|
9
|
+
*/
|
|
10
|
+
import type { LintRule } from "@intentius/chant/lint/rule";
|
|
11
|
+
export declare const MIGRATION_RULES: LintRule[];
|
|
12
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAe3D,eAAO,MAAM,eAAe,EAAE,QAAQ,EA+DrC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security-aware migration (#306).
|
|
3
|
+
*
|
|
4
|
+
* Migration is the edge between the two security endpoints (#296 ↔ #305).
|
|
5
|
+
* Security properties don't translate 1:1 — some are silently preserved, some
|
|
6
|
+
* lost, some need re-establishing on the GitLab side. This module classifies
|
|
7
|
+
* each security-relevant property's fate as it crosses the boundary and runs
|
|
8
|
+
* the GitLab security post-synth checks against the migrated output so anything
|
|
9
|
+
* lost in translation is caught on the target side.
|
|
10
|
+
*/
|
|
11
|
+
import type { ProvenanceRecord } from "./provenance.js";
|
|
12
|
+
/**
|
|
13
|
+
* Classify the fate of security-relevant properties as they migrate from a
|
|
14
|
+
* GitHub Actions workflow to GitLab CI. Returns provenance records carrying a
|
|
15
|
+
* `security` classification (which flow into diagnostics, SARIF, and the report
|
|
16
|
+
* like any other provenance record).
|
|
17
|
+
*/
|
|
18
|
+
export declare function analyzeSecurity(sourceYaml: string, opts?: {
|
|
19
|
+
sourceFile?: string;
|
|
20
|
+
}): ProvenanceRecord[];
|
|
21
|
+
/**
|
|
22
|
+
* Run the GitLab security post-synth checks against the migrated `.gitlab-ci.yml`
|
|
23
|
+
* and return their findings as provenance records — *migrate, then prove the
|
|
24
|
+
* output clears the GitLab security bar*. Anything lost in translation that
|
|
25
|
+
* lands as a concrete weakness on the target is caught here.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runSecurityChecks(gitlabYaml: string, opts?: {
|
|
28
|
+
sourceFile?: string;
|
|
29
|
+
}): Promise<ProvenanceRecord[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Render a "Security posture" Markdown section from the security provenance
|
|
32
|
+
* records (those carrying a `security` classification).
|
|
33
|
+
*/
|
|
34
|
+
export declare function renderSecurityPosture(records: ProvenanceRecord[]): string;
|
|
35
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAiBrD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,gBAAgB,EAAE,CA0F1G;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAwC3H;AAUD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAqBzE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage inference for GitHub jobs → GitLab stages.
|
|
3
|
+
*
|
|
4
|
+
* GitHub Actions has no `stages:` concept; jobs only declare optional
|
|
5
|
+
* `needs:` edges. GitLab CI requires every job to belong to a stage.
|
|
6
|
+
*
|
|
7
|
+
* Approach (Kahn topological sort on the `needs:` DAG):
|
|
8
|
+
* 1. Build adjacency from `needs:` (jobs without `needs:` are depth 0).
|
|
9
|
+
* 2. Peel zero-indegree nodes; assign stage by depth + name heuristic.
|
|
10
|
+
* 3. Map depths to stage names:
|
|
11
|
+
* depth 0 → "lint" / "build" (by name heuristic, default "build")
|
|
12
|
+
* depth 1 → "test"
|
|
13
|
+
* depth 2 → "deploy"
|
|
14
|
+
* depth N>2 → `post-${N-2}`
|
|
15
|
+
* 4. If a cycle is detected, place each remaining job in its own stage
|
|
16
|
+
* and append a needs-review record so the user notices.
|
|
17
|
+
*/
|
|
18
|
+
import type { ProvenanceRecord } from "./provenance.js";
|
|
19
|
+
export interface GhJobSummary {
|
|
20
|
+
logicalId: string;
|
|
21
|
+
needs: string[];
|
|
22
|
+
/** Original GH job key (kebab-case) for name heuristics */
|
|
23
|
+
originalName: string;
|
|
24
|
+
}
|
|
25
|
+
export interface StageInferenceResult {
|
|
26
|
+
/** Map from job logicalId to assigned stage name */
|
|
27
|
+
stageByJob: Map<string, string>;
|
|
28
|
+
/** Ordered list of distinct stages, declaration-order */
|
|
29
|
+
stages: string[];
|
|
30
|
+
/** Any provenance records (cycles, synthesis events) */
|
|
31
|
+
provenance: ProvenanceRecord[];
|
|
32
|
+
}
|
|
33
|
+
export declare function inferStages(jobs: GhJobSummary[]): StageInferenceResult;
|
|
34
|
+
//# sourceMappingURL=stages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/stages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,wDAAwD;IACxD,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAuBD,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAuHtE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Actions → GitLab CI transformer.
|
|
3
|
+
*
|
|
4
|
+
* Takes a GitHub TemplateIR (produced by `GitHubActionsParser.parse`)
|
|
5
|
+
* and rewrites it into a GitLab TemplateIR (consumed by the existing
|
|
6
|
+
* `GitLabGenerator` for TS emit, or by `emit-yaml.ts` for direct YAML).
|
|
7
|
+
*
|
|
8
|
+
* Per-key provenance is collected in a side-channel `ProvenanceAccumulator`
|
|
9
|
+
* so the IR stays clean (re-usable by `chant import`).
|
|
10
|
+
*/
|
|
11
|
+
import type { TemplateIR } from "@intentius/chant/import/parser";
|
|
12
|
+
import type { ProvenanceAccumulator } from "./provenance.js";
|
|
13
|
+
import { type ActionMappingRegistry } from "./actions/registry.js";
|
|
14
|
+
export interface TransformOptions {
|
|
15
|
+
/** Source file path for provenance (best-effort, no parse) */
|
|
16
|
+
sourceFile?: string;
|
|
17
|
+
/** Optional registry override for testability */
|
|
18
|
+
registry?: ActionMappingRegistry;
|
|
19
|
+
/** Provenance accumulator to write to */
|
|
20
|
+
provenance: ProvenanceAccumulator;
|
|
21
|
+
}
|
|
22
|
+
export declare function transformIR(ghIR: TemplateIR, opts: TransformOptions): Promise<{
|
|
23
|
+
ir: TemplateIR;
|
|
24
|
+
stages: string[];
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../../src/migrate/from-github/transformer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAgB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAwB9E,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,yCAAyC;IACzC,UAAU,EAAE,qBAAqB,CAAC;CACnC;AAwiBD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAqH/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-cli.d.ts","sourceRoot":"","sources":["../src/package-cli.ts"],"names":[],"mappings":""}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitLab CI/CD lexicon plugin.
|
|
3
|
+
*
|
|
4
|
+
* Provides serializer, template detection, and code generation
|
|
5
|
+
* for GitLab CI/CD pipelines.
|
|
6
|
+
*/
|
|
7
|
+
import type { LexiconPlugin } from "@intentius/chant/lexicon";
|
|
8
|
+
export declare const gitlabPlugin: LexiconPlugin;
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,0BAA0B,CAAC;AAiB7F,eAAO,MAAM,YAAY,EAAE,aA2f1B,CAAC"}
|
package/dist/rules/wgl011.ts
CHANGED
|
@@ -21,10 +21,10 @@ export const wgl011: PostSynthCheck = {
|
|
|
21
21
|
|
|
22
22
|
for (const [entityName, entity] of ctx.entities) {
|
|
23
23
|
if (isPropertyDeclarable(entity)) continue;
|
|
24
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
24
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
25
25
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
26
26
|
|
|
27
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
27
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
28
28
|
if (!props?.rules || !Array.isArray(props.rules)) continue;
|
|
29
29
|
|
|
30
30
|
const rules = props.rules as Array<Record<string, unknown>>;
|
package/dist/rules/wgl012.ts
CHANGED
|
@@ -53,11 +53,11 @@ export function checkDeprecatedProperties(
|
|
|
53
53
|
for (const [entityName, entity] of ctx.entities) {
|
|
54
54
|
if (isPropertyDeclarable(entity)) continue;
|
|
55
55
|
|
|
56
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
56
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
57
57
|
const deprProps = deprecated.get(entityType);
|
|
58
58
|
if (!deprProps) continue;
|
|
59
59
|
|
|
60
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
60
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
61
61
|
if (!props) continue;
|
|
62
62
|
|
|
63
63
|
for (const propName of Object.keys(props)) {
|
package/dist/rules/wgl018.ts
CHANGED
|
@@ -17,10 +17,10 @@ export const wgl018: PostSynthCheck = {
|
|
|
17
17
|
|
|
18
18
|
for (const [entityName, entity] of ctx.entities) {
|
|
19
19
|
if (isPropertyDeclarable(entity)) continue;
|
|
20
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
20
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
21
21
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
22
22
|
|
|
23
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
23
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
24
24
|
if (!props) continue;
|
|
25
25
|
|
|
26
26
|
if (!props.timeout) {
|
package/dist/rules/wgl019.ts
CHANGED
|
@@ -19,10 +19,10 @@ export const wgl019: PostSynthCheck = {
|
|
|
19
19
|
|
|
20
20
|
for (const [entityName, entity] of ctx.entities) {
|
|
21
21
|
if (isPropertyDeclarable(entity)) continue;
|
|
22
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
22
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
23
23
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
24
24
|
|
|
25
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
25
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
26
26
|
if (!props) continue;
|
|
27
27
|
|
|
28
28
|
const stage = props.stage as string | undefined;
|
package/dist/rules/wgl022.ts
CHANGED
|
@@ -18,10 +18,10 @@ export const wgl022: PostSynthCheck = {
|
|
|
18
18
|
|
|
19
19
|
for (const [entityName, entity] of ctx.entities) {
|
|
20
20
|
if (isPropertyDeclarable(entity)) continue;
|
|
21
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
21
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
22
22
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
23
23
|
|
|
24
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
24
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
25
25
|
if (!props?.artifacts) continue;
|
|
26
26
|
|
|
27
27
|
const artifacts = props.artifacts as Record<string, unknown>;
|
package/dist/rules/wgl023.ts
CHANGED
|
@@ -18,10 +18,10 @@ export const wgl023: PostSynthCheck = {
|
|
|
18
18
|
|
|
19
19
|
for (const [entityName, entity] of ctx.entities) {
|
|
20
20
|
if (isPropertyDeclarable(entity)) continue;
|
|
21
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
21
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
22
22
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
23
23
|
|
|
24
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
24
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
25
25
|
if (!props?.rules || !Array.isArray(props.rules)) continue;
|
|
26
26
|
|
|
27
27
|
const rules = props.rules as Array<Record<string, unknown>>;
|
package/dist/rules/wgl024.ts
CHANGED
|
@@ -18,10 +18,10 @@ export const wgl024: PostSynthCheck = {
|
|
|
18
18
|
|
|
19
19
|
for (const [entityName, entity] of ctx.entities) {
|
|
20
20
|
if (isPropertyDeclarable(entity)) continue;
|
|
21
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
21
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
22
22
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
23
23
|
|
|
24
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
24
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
25
25
|
if (!props) continue;
|
|
26
26
|
|
|
27
27
|
// Check top-level when: manual
|
package/dist/rules/wgl025.ts
CHANGED
|
@@ -18,10 +18,10 @@ export const wgl025: PostSynthCheck = {
|
|
|
18
18
|
|
|
19
19
|
for (const [entityName, entity] of ctx.entities) {
|
|
20
20
|
if (isPropertyDeclarable(entity)) continue;
|
|
21
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
21
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
22
22
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
23
23
|
|
|
24
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
24
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
25
25
|
if (!props?.cache) continue;
|
|
26
26
|
|
|
27
27
|
// Cache can be a single object or an array
|
package/dist/rules/wgl026.ts
CHANGED
|
@@ -24,10 +24,10 @@ export const wgl026: PostSynthCheck = {
|
|
|
24
24
|
|
|
25
25
|
for (const [entityName, entity] of ctx.entities) {
|
|
26
26
|
if (isPropertyDeclarable(entity)) continue;
|
|
27
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
27
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
28
28
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
29
29
|
|
|
30
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
30
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
31
31
|
if (!props?.services || !Array.isArray(props.services)) continue;
|
|
32
32
|
|
|
33
33
|
for (const service of props.services) {
|
package/dist/rules/wgl027.ts
CHANGED
|
@@ -17,10 +17,10 @@ export const wgl027: PostSynthCheck = {
|
|
|
17
17
|
|
|
18
18
|
for (const [entityName, entity] of ctx.entities) {
|
|
19
19
|
if (isPropertyDeclarable(entity)) continue;
|
|
20
|
-
const entityType = (entity as Record<string, unknown>).entityType as string;
|
|
20
|
+
const entityType = (entity as unknown as Record<string, unknown>).entityType as string;
|
|
21
21
|
if (entityType !== "GitLab::CI::Job") continue;
|
|
22
22
|
|
|
23
|
-
const props = (entity as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
23
|
+
const props = (entity as unknown as Record<string, unknown>).props as Record<string, unknown> | undefined;
|
|
24
24
|
if (!props) continue;
|
|
25
25
|
|
|
26
26
|
const script = props.script;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitLab CI YAML serializer.
|
|
3
|
+
*
|
|
4
|
+
* Converts Chant declarables to .gitlab-ci.yml YAML output.
|
|
5
|
+
* Uses snake_case keys (GitLab CI convention) and produces
|
|
6
|
+
* valid YAML without a library dependency — the CI schema is
|
|
7
|
+
* simple enough for a direct emitter.
|
|
8
|
+
*/
|
|
9
|
+
import type { Serializer } from "@intentius/chant/serializer";
|
|
10
|
+
/**
|
|
11
|
+
* GitLab CI YAML serializer implementation.
|
|
12
|
+
*/
|
|
13
|
+
export declare const gitlabSerializer: Serializer;
|
|
14
|
+
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AA0E9D;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAmF9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-fixture.d.ts","sourceRoot":"","sources":["../../src/testdata/create-fixture.ts"],"names":[],"mappings":";AACA;;;GAGG"}
|