@intentius/chant-lexicon-gitlab 0.106.1 → 0.106.3

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "47ce6b5b8e35b2dd162ab80d25122abeadf6c896bc1ecca0ae585b3c7cbb6c31",
4
+ "manifest.json": "fb4d145f385ac1702b9084aa87ef84069138eff4010d2a8d0b61d50ce64e235f",
5
5
  "meta.json": "931fc3246a55645b1493080bbeb160e5d205e42349e8bdca96ca243adb5f0da3",
6
6
  "types/index.d.ts": "5cd2e99f135a929b72bdd822d00d780d39b1cd407ba0cfb3d511c7ac9d667b58",
7
7
  "rules/artifact-no-expiry.ts": "3f3cabf9792cbf8207e53a25f506715466b19ec25e9c3b4d0d77fed6b2eb4542",
@@ -55,5 +55,5 @@
55
55
  "skills/chant-gitlab-migrate.md": "4853d04980560b379e5b0f7267dcb0a1e5d5879cb9e9931681ce76b2a5fe69d8",
56
56
  "skills/chant-gitlab-patterns.md": "6d9a44e9e8de4c3820be9d65381b0d2ede4cb3626aaaf0011e21838a9fbf556e"
57
57
  },
58
- "composite": "a5370ff33eed54ef2099b3cb8454208518b7a5005cf5ca8249b2a127a997023c"
58
+ "composite": "b4573669289f773787b3da6c76e8d20c8adf55482914d721749f627b308b7d11"
59
59
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitlab",
3
- "version": "0.106.1",
3
+ "version": "0.106.3",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "GitLab",
6
6
  "intrinsics": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-gitlab",
3
- "version": "0.106.1",
3
+ "version": "0.106.3",
4
4
  "description": "GitLab CI lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -67,8 +67,8 @@
67
67
  "typescript": "^5.9.3"
68
68
  },
69
69
  "peerDependencies": {
70
- "@intentius/chant": "^0.106.1",
71
- "@intentius/chant-lexicon-github": "^0.106.1",
70
+ "@intentius/chant": "^0.106.3",
71
+ "@intentius/chant-lexicon-github": "^0.106.3",
72
72
  "typescript": "^5.9.3"
73
73
  },
74
74
  "peerDependenciesMeta": {
@@ -31,7 +31,7 @@ describe("generateGitlabPipeline for a workspace member", () => {
31
31
  test("jobs take the member's name, run in its directory and only on its changes", () => {
32
32
  const result = generateGitlabPipeline(components, { env: "staging", member: api });
33
33
  const doc = parseYAML(result.yaml) as Record<string, unknown>;
34
- expect(doc.workflow).toEqual({ name: "chant-components-api-staging" });
34
+ expect(doc.workflow).toEqual({ name: "chant-components.api.staging" });
35
35
  expect(doc["shared-alb"]).toBeUndefined();
36
36
 
37
37
  const job = doc["api-api"] as Job;
@@ -305,7 +305,9 @@ function prLoopGitlabPipeline(
305
305
  const script = (job: typeof plan): string[] => [...prLoopSetup(image), ...enter, ...beforeScript, ...(job.setup ?? []), job.command, ...extraScript];
306
306
  const stages = ["plan", "apply"];
307
307
  const doc: Record<string, unknown> = {
308
- workflow: { name: member ? `chant-pr-${member.name}-${env}` : `chant-pr-${env}`, rules: [{ if: onMergeRequest }, { if: onMerge }] },
308
+ // Included files merge their top-level keys, so a member's file carries
309
+ // the rules every member shares and no name: two names would collide.
310
+ workflow: { ...(member ? {} : { name: `chant-pr-${env}` }), rules: [{ if: onMergeRequest }, { if: onMerge }] },
309
311
  stages,
310
312
  variables: { ...options.variables, CHANT_ENV: env, GIT_DEPTH: "0" },
311
313
  [planJob]: {
@@ -382,6 +384,6 @@ function scopeToMember(
382
384
  job.jobName = renamed.get(job.jobName)!;
383
385
  job.needs = job.needs.map((n) => renamed.get(n) ?? n);
384
386
  }
385
- doc.workflow = { name: `chant-components-${member.name}-${env}` };
387
+ doc.workflow = { name: `chant-components.${member.name}.${env}` };
386
388
  return promoteJob ? renamed.get(promoteJob) : undefined;
387
389
  }
@@ -97,12 +97,14 @@ describe("the GitLab merge-request pipeline", () => {
97
97
  });
98
98
 
99
99
  test("inside a workspace member: member-named jobs that cd into the member, with no changes rule (#3465)", () => {
100
- const member = { name: "network", dir: "infra/network", file: ".gitlab/ci/chant-pr-network-prod.gitlab-ci.yml" };
100
+ const member = { name: "network", dir: "infra/network", file: ".gitlab/ci/chant-pr.network.prod.gitlab-ci.yml" };
101
101
  const scoped = generateGitlabPipeline(ESTATE, { env: "prod", prLoop: {}, member });
102
- const mdoc = parseYAML(scoped.yaml) as Record<string, unknown> & { workflow: { name: string } };
102
+ const mdoc = parseYAML(scoped.yaml) as Record<string, unknown> & { workflow: { name?: string; rules: unknown[] } };
103
103
  expect(scoped.jobs.map((j) => j.jobName)).toEqual(["network-plan", "network-apply"]);
104
104
  expect(mdoc.plan).toBeUndefined();
105
- expect(mdoc.workflow.name).toBe("chant-pr-network-prod");
105
+ // Included files merge top-level keys: no name, so members do not collide on it.
106
+ expect(mdoc.workflow.name).toBeUndefined();
107
+ expect(mdoc.workflow.rules).toHaveLength(2);
106
108
  const plan = mdoc["network-plan"] as Job;
107
109
  const apply = mdoc["network-apply"] as Job;
108
110
  expect(plan.script).toContain("cd infra/network");
@@ -111,9 +113,9 @@ describe("the GitLab merge-request pipeline", () => {
111
113
  expect(apply.script.find((l) => l.includes("pr-apply"))).toContain("--member network");
112
114
  // A change outside the member can reach it, so the jobs keep only their pipeline-source rules.
113
115
  expect(plan.rules).toEqual([{ if: '$CI_PIPELINE_SOURCE == "merge_request_event"' }]);
114
- expect(apply.resource_group).toBe("chant-apply-network-prod");
116
+ expect(apply.resource_group).toBe("chant-apply.network.prod");
115
117
  expect(plan.artifacts).toEqual({ when: "always", paths: ["infra/network/.chant/pr"] });
116
118
  expect(apply.artifacts).toEqual({ when: "always", paths: ["infra/network/.chant/pr"] });
117
- expect(apply.cache).toEqual({ key: "chant-apply-network-prod-$CI_COMMIT_SHA", paths: ["infra/network/.chant/pr-resume/pr-apply.json"], when: "always" });
119
+ expect(apply.cache).toEqual({ key: "chant-apply.network.prod-$CI_COMMIT_SHA", paths: ["infra/network/.chant/pr-resume/pr-apply.json"], when: "always" });
118
120
  });
119
121
  });