@simplysf/simply-cicd 0.3.0 → 0.5.4

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 (183) hide show
  1. package/LICENSE.txt +206 -0
  2. package/README.md +221 -163
  3. package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +1 -1
  4. package/lib/commands/simply/cicd/build/create-fallback-tag.d.ts +2 -2
  5. package/lib/commands/simply/cicd/build/create-fallback-tag.js +1 -1
  6. package/lib/commands/simply/cicd/build/create-package-version.d.ts +2 -2
  7. package/lib/commands/simply/cicd/build/create-package-version.js +1 -1
  8. package/lib/commands/simply/cicd/build/create-scratch.js +1 -1
  9. package/lib/commands/simply/cicd/build/delete-scratch.js +1 -1
  10. package/lib/commands/simply/cicd/build/determine-package-changes.js +1 -1
  11. package/lib/commands/simply/cicd/build/generate-flexipage-diff.d.ts +9 -2
  12. package/lib/commands/simply/cicd/build/generate-flexipage-diff.js +8 -1
  13. package/lib/commands/simply/cicd/build/generate-flexipage-diff.js.map +1 -1
  14. package/lib/commands/simply/cicd/build/generate-flow-diff.d.ts +9 -2
  15. package/lib/commands/simply/cicd/build/generate-flow-diff.js +8 -1
  16. package/lib/commands/simply/cicd/build/generate-flow-diff.js.map +1 -1
  17. package/lib/commands/simply/cicd/build/install-dependencies.js +1 -1
  18. package/lib/commands/simply/cicd/build/lwc-jest.js +1 -1
  19. package/lib/commands/simply/cicd/build/push-scratch.js +1 -1
  20. package/lib/commands/simply/cicd/build/test-scratch.js +1 -1
  21. package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.d.ts +2 -2
  22. package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js +1 -1
  23. package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.d.ts +2 -2
  24. package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js +1 -1
  25. package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.d.ts +2 -0
  26. package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js +5 -4
  27. package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js.map +1 -1
  28. package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.d.ts +2 -2
  29. package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js +1 -1
  30. package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.d.ts +2 -2
  31. package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js +1 -1
  32. package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.d.ts +2 -2
  33. package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js +1 -1
  34. package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.d.ts +2 -2
  35. package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js +1 -1
  36. package/lib/commands/simply/cicd/deploy/happy-soup/validate.js +1 -1
  37. package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.d.ts +2 -2
  38. package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js +1 -1
  39. package/lib/commands/simply/cicd/deploy/project/install-packaged.d.ts +2 -0
  40. package/lib/commands/simply/cicd/deploy/project/install-packaged.js +5 -4
  41. package/lib/commands/simply/cicd/deploy/project/install-packaged.js.map +1 -1
  42. package/lib/commands/simply/cicd/deploy/project/post-deploy.d.ts +2 -2
  43. package/lib/commands/simply/cicd/deploy/project/post-deploy.js +1 -1
  44. package/lib/commands/simply/cicd/deploy/project/post-destructive.d.ts +2 -2
  45. package/lib/commands/simply/cicd/deploy/project/post-destructive.js +1 -1
  46. package/lib/commands/simply/cicd/deploy/project/pre-destructive.d.ts +2 -2
  47. package/lib/commands/simply/cicd/deploy/project/pre-destructive.js +1 -1
  48. package/lib/commands/simply/cicd/deploy/project/run-apex-tests.d.ts +2 -0
  49. package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js +5 -4
  50. package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js.map +1 -1
  51. package/lib/commands/simply/cicd/deploy/project/validate.js +1 -1
  52. package/lib/commands/simply/cicd/deploy/validate.js +1 -1
  53. package/lib/commands/simply/cicd/notify/happy-soup.js +1 -1
  54. package/lib/commands/simply/cicd/notify/project.d.ts +5 -16
  55. package/lib/commands/simply/cicd/notify/project.js +19 -203
  56. package/lib/commands/simply/cicd/notify/project.js.map +1 -1
  57. package/lib/commands/simply/cicd/notify/teams.js +1 -1
  58. package/lib/commands/simply/cicd/sfdx-dependabot.d.ts +7 -58
  59. package/lib/commands/simply/cicd/sfdx-dependabot.js +41 -287
  60. package/lib/commands/simply/cicd/sfdx-dependabot.js.map +1 -1
  61. package/lib/common/alm/gitlabIssues.d.ts +11 -0
  62. package/lib/common/alm/gitlabIssues.js +54 -0
  63. package/lib/common/alm/gitlabIssues.js.map +1 -0
  64. package/lib/common/alm/index.d.ts +4 -0
  65. package/lib/common/alm/index.js +24 -0
  66. package/lib/common/alm/index.js.map +1 -0
  67. package/lib/common/alm/jira.d.ts +8 -0
  68. package/lib/common/alm/jira.js +43 -0
  69. package/lib/common/alm/jira.js.map +1 -0
  70. package/lib/common/alm/registry.d.ts +10 -0
  71. package/lib/common/alm/registry.js +37 -0
  72. package/lib/common/alm/registry.js.map +1 -0
  73. package/lib/common/alm/types.d.ts +35 -0
  74. package/lib/common/alm/types.js +17 -0
  75. package/lib/common/alm/types.js.map +1 -0
  76. package/lib/common/build/cleanupScratchOrgs.js +1 -1
  77. package/lib/common/build/createFallbackTag.d.ts +1 -1
  78. package/lib/common/build/createFallbackTag.js +7 -4
  79. package/lib/common/build/createFallbackTag.js.map +1 -1
  80. package/lib/common/build/createPackageVersion.d.ts +1 -1
  81. package/lib/common/build/createPackageVersion.js +7 -4
  82. package/lib/common/build/createPackageVersion.js.map +1 -1
  83. package/lib/common/build/createScratchOrg.js +1 -1
  84. package/lib/common/build/deleteScratchOrg.js +1 -1
  85. package/lib/common/build/deltaRunner.d.ts +73 -0
  86. package/lib/common/build/deltaRunner.js +109 -0
  87. package/lib/common/build/deltaRunner.js.map +1 -0
  88. package/lib/common/build/determinePackageChanges.js +1 -1
  89. package/lib/common/build/devHubs.js +1 -1
  90. package/lib/common/build/flags.d.ts +17 -5
  91. package/lib/common/build/flags.js +29 -6
  92. package/lib/common/build/flags.js.map +1 -1
  93. package/lib/common/build/flexipageDelta.d.ts +6 -19
  94. package/lib/common/build/flexipageDelta.js +6 -63
  95. package/lib/common/build/flexipageDelta.js.map +1 -1
  96. package/lib/common/build/flowDelta.d.ts +6 -19
  97. package/lib/common/build/flowDelta.js +6 -63
  98. package/lib/common/build/flowDelta.js.map +1 -1
  99. package/lib/common/build/installDependencies.js +1 -1
  100. package/lib/common/build/lwcJest.js +1 -1
  101. package/lib/common/build/pushScratch.js +1 -1
  102. package/lib/common/build/scratchOrgInfo.js +1 -1
  103. package/lib/common/build/skipGuard.js +1 -1
  104. package/lib/common/build/testScratch.d.ts +3 -3
  105. package/lib/common/build/testScratch.js +4 -4
  106. package/lib/common/deploy/deployCommon.d.ts +1 -1
  107. package/lib/common/deploy/deployCommon.js +4 -4
  108. package/lib/common/deploy/deployCommon.js.map +1 -1
  109. package/lib/common/deploy/deployHappySoup.d.ts +3 -3
  110. package/lib/common/deploy/deployHappySoup.js +11 -9
  111. package/lib/common/deploy/deployHappySoup.js.map +1 -1
  112. package/lib/common/deploy/deployProject.d.ts +1 -1
  113. package/lib/common/deploy/deployProject.js +1 -1
  114. package/lib/common/deploy/flags.d.ts +3 -2
  115. package/lib/common/deploy/flags.js +3 -3
  116. package/lib/common/deploy/flags.js.map +1 -1
  117. package/lib/common/deploy/runDeployStage.js +1 -1
  118. package/lib/common/deploy/stageCommand.d.ts +5 -5
  119. package/lib/common/deploy/stageCommand.js +1 -1
  120. package/lib/common/deploy/validate.js +1 -1
  121. package/lib/common/env.js +1 -1
  122. package/lib/common/exec/sfCli.js +1 -1
  123. package/lib/common/flags/env.js +1 -1
  124. package/lib/common/git.d.ts +1 -2
  125. package/lib/common/git.js +4 -4
  126. package/lib/common/git.js.map +1 -1
  127. package/lib/common/logger.js +1 -1
  128. package/lib/common/notify/getCommitStories.d.ts +13 -7
  129. package/lib/common/notify/getCommitStories.js +13 -21
  130. package/lib/common/notify/getCommitStories.js.map +1 -1
  131. package/lib/common/notify/projectNotification.d.ts +58 -0
  132. package/lib/common/notify/projectNotification.js +204 -0
  133. package/lib/common/notify/projectNotification.js.map +1 -0
  134. package/lib/common/notify/renderTemplate.js +1 -1
  135. package/lib/common/notify/sendNotification.js +1 -1
  136. package/lib/common/notify/templates.js +60 -60
  137. package/lib/common/schemas/deployConfig.js +1 -1
  138. package/lib/common/schemas/deployProgress.js +1 -1
  139. package/lib/common/schemas/deployRules.js +1 -1
  140. package/lib/common/sfApex.js +1 -1
  141. package/lib/common/sfAuth.js +1 -1
  142. package/lib/common/sfConfig.d.ts +6 -2
  143. package/lib/common/sfConfig.js +26 -9
  144. package/lib/common/sfConfig.js.map +1 -1
  145. package/lib/common/sfPackages.js +1 -1
  146. package/lib/common/sfPlugins.js +1 -1
  147. package/lib/common/sfdxDependabot/dependabotRun.d.ts +95 -0
  148. package/lib/common/sfdxDependabot/dependabotRun.js +287 -0
  149. package/lib/common/sfdxDependabot/dependabotRun.js.map +1 -0
  150. package/lib/common/sfdxDependabot/updater.js +1 -1
  151. package/lib/common/vcs/github.d.ts +27 -0
  152. package/lib/common/vcs/github.js +258 -0
  153. package/lib/common/vcs/github.js.map +1 -0
  154. package/lib/common/vcs/gitlab.d.ts +21 -14
  155. package/lib/common/vcs/gitlab.js +59 -33
  156. package/lib/common/vcs/gitlab.js.map +1 -1
  157. package/lib/common/vcs/index.d.ts +4 -4
  158. package/lib/common/vcs/index.js +8 -10
  159. package/lib/common/vcs/index.js.map +1 -1
  160. package/lib/common/vcs/registry.d.ts +10 -0
  161. package/lib/common/vcs/registry.js +37 -0
  162. package/lib/common/vcs/registry.js.map +1 -0
  163. package/lib/common/vcs/types.d.ts +68 -16
  164. package/lib/common/vcs/types.js +1 -1
  165. package/lib/config/defaultDeploymentPlugins.js +1 -1
  166. package/lib/config/trustedPlugins.js +1 -1
  167. package/lib/index.js +1 -1
  168. package/messages/simply.cicd.build.generate-flexipage-diff.md +4 -2
  169. package/messages/simply.cicd.build.generate-flow-diff.md +4 -2
  170. package/messages/simply.cicd.build.md +22 -2
  171. package/messages/simply.cicd.deploy.happy-soup.deploy-unpackaged.md +11 -11
  172. package/messages/simply.cicd.deploy.happy-soup.post-deploy.md +11 -11
  173. package/messages/simply.cicd.deploy.happy-soup.post-destructive.md +11 -11
  174. package/messages/simply.cicd.deploy.happy-soup.pre-destructive.md +11 -11
  175. package/messages/simply.cicd.deploy.md +75 -75
  176. package/messages/simply.cicd.deploy.project.deploy-unpackaged.md +11 -11
  177. package/messages/simply.cicd.deploy.project.post-deploy.md +11 -11
  178. package/messages/simply.cicd.deploy.project.post-destructive.md +11 -11
  179. package/messages/simply.cicd.deploy.project.pre-destructive.md +11 -11
  180. package/messages/simply.cicd.notify.project.md +10 -6
  181. package/messages/simply.cicd.notify.teams.md +27 -27
  182. package/messages/simply.cicd.sfdx-dependabot.md +40 -18
  183. package/package.json +215 -214
@@ -1,20 +1,27 @@
1
- import type { VcsBranch, VcsCommit, VcsMergeRequest, VcsProject, VcsProjectVariable, VcsProvider } from './types.js';
1
+ import type { VcsBranch, VcsCiContext, VcsCommit, VcsMergeRequest, VcsProject, VcsProjectRef, VcsProjectVariable, VcsProvider, VcsProviderOptions, VcsTerminology } from './types.js';
2
2
  /** A `VcsProvider` implementation for GitLab, backed by the GitLab REST API v4. */
3
3
  export declare class GitLabProvider implements VcsProvider {
4
- private readonly apiUrl;
4
+ /** Used when no `--vcs-host` is supplied, so selecting a provider is enough to reach its SaaS instance. */
5
+ static readonly defaultHost = "gitlab.com";
6
+ readonly kind: "gitlab";
7
+ readonly terminology: VcsTerminology;
8
+ readonly host: string;
9
+ readonly apiUrl: string;
5
10
  private readonly token;
6
- constructor(apiUrl: string, token: string);
7
- getGroupProjects(groupId: string | number): Promise<VcsProject[]>;
8
- getFileContent(projectId: string | number, filePath: string, ref: string): Promise<string>;
9
- branchExists(projectId: string | number, branchName: string): Promise<boolean>;
10
- createBranch(projectId: string | number, branchName: string, ref: string): Promise<VcsBranch>;
11
- commitFile(projectId: string | number, branchName: string, commitMessage: string, filePath: string, content: string): Promise<VcsCommit>;
12
- findOpenMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string): Promise<VcsMergeRequest | undefined>;
13
- createMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
14
- updateMergeRequest(projectId: string | number, mergeRequestId: number, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
15
- getProjectVariables(projectId: string | number): Promise<VcsProjectVariable[]>;
16
- buildAuthenticatedRemoteUrl(host: string, token: string, projectPath: string): string;
17
- buildCiCloneUrl(host: string, ciJobToken: string, projectPath: string): string;
11
+ constructor(options: VcsProviderOptions);
12
+ getCiContext(): VcsCiContext;
13
+ listProjects(groupId: string | number): Promise<VcsProject[]>;
14
+ getFileContent(project: VcsProjectRef, filePath: string, ref: string): Promise<string>;
15
+ branchExists(project: VcsProjectRef, branchName: string): Promise<boolean>;
16
+ createBranch(project: VcsProjectRef, branchName: string, ref: string): Promise<VcsBranch>;
17
+ commitFile(project: VcsProjectRef, branchName: string, commitMessage: string, filePath: string, content: string): Promise<VcsCommit>;
18
+ findOpenMergeRequest(project: VcsProjectRef, sourceBranch: string, targetBranch: string): Promise<VcsMergeRequest | undefined>;
19
+ createMergeRequest(project: VcsProjectRef, sourceBranch: string, targetBranch: string, title: string, description: string, labels?: string[]): Promise<VcsMergeRequest>;
20
+ updateMergeRequest(project: VcsProjectRef, mergeRequest: VcsMergeRequest, title: string, description: string, labels?: string[]): Promise<VcsMergeRequest>;
21
+ getProjectVariables(project: VcsProjectRef): Promise<VcsProjectVariable[]>;
22
+ buildChangeRequestUrl(projectUrl: string, changeRequestIid: string | number): string;
23
+ buildAuthenticatedRemoteUrl(token: string, projectPath: string): string;
24
+ buildCiCloneUrl(ciJobToken: string, projectPath: string): string;
18
25
  private request;
19
26
  private getJson;
20
27
  private getRawText;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
2
+ * Copyright (c) 2026, Clay Chipps.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
16
16
  function normalizeProject(project) {
17
17
  return {
18
18
  id: project.id,
19
+ key: String(project.id),
19
20
  name: project.name,
20
21
  pathWithNamespace: project.path_with_namespace,
21
22
  defaultBranch: project.default_branch,
@@ -37,21 +38,43 @@ function normalizeMergeRequest(mergeRequest) {
37
38
  raw: mergeRequest,
38
39
  };
39
40
  }
41
+ /** GitLab addresses projects by numeric ID or URL-encoded path; both arrive here already usable. */
42
+ function projectSegment(project) {
43
+ const key = typeof project === 'object' ? project.key : String(project);
44
+ return encodeURIComponent(key);
45
+ }
40
46
  /** A `VcsProvider` implementation for GitLab, backed by the GitLab REST API v4. */
41
47
  export class GitLabProvider {
48
+ /** Used when no `--vcs-host` is supplied, so selecting a provider is enough to reach its SaaS instance. */
49
+ static defaultHost = 'gitlab.com';
50
+ kind = 'gitlab';
51
+ terminology = {
52
+ changeRequest: 'merge request',
53
+ changeRequestShort: 'MR',
54
+ projectVariable: 'GitLab CI/CD variable',
55
+ };
56
+ host;
42
57
  apiUrl;
43
58
  token;
44
- constructor(apiUrl, token) {
45
- if (!apiUrl) {
46
- throw new Error('GitLab API URL is required.');
47
- }
59
+ constructor(options) {
60
+ const { host, token, apiUrl } = options;
48
61
  if (!token) {
49
62
  throw new Error('GitLab access token is required.');
50
63
  }
51
- this.apiUrl = apiUrl.replace(/\/+$/, '');
64
+ this.apiUrl = (apiUrl ?? `https://${host ?? GitLabProvider.defaultHost}/api/v4`).replace(/\/+$/, '');
65
+ // When only an API URL is supplied (the dependabot path), recover the host from it so the
66
+ // remote-URL builders stay usable.
67
+ this.host = host ?? new URL(this.apiUrl).host;
52
68
  this.token = token;
53
69
  }
54
- async getGroupProjects(groupId) {
70
+ // eslint-disable-next-line class-methods-use-this -- part of the VcsProvider instance contract; GitLab's CI variables are process-global
71
+ getCiContext() {
72
+ return {
73
+ projectPath: process.env.CI_PROJECT_PATH,
74
+ projectId: process.env.CI_PROJECT_ID,
75
+ };
76
+ }
77
+ async listProjects(groupId) {
55
78
  let projects = [];
56
79
  let page = 1;
57
80
  let hasMore = true;
@@ -85,14 +108,14 @@ export class GitLabProvider {
85
108
  }
86
109
  return projects.map(normalizeProject);
87
110
  }
88
- async getFileContent(projectId, filePath, ref) {
111
+ async getFileContent(project, filePath, ref) {
89
112
  const encodedFilePath = encodeURIComponent(filePath);
90
- const endpoint = `/projects/${projectId}/repository/files/${encodedFilePath}/raw?ref=${encodeURIComponent(ref)}`;
113
+ const endpoint = `/projects/${projectSegment(project)}/repository/files/${encodedFilePath}/raw?ref=${encodeURIComponent(ref)}`;
91
114
  return this.getRawText(endpoint);
92
115
  }
93
- async branchExists(projectId, branchName) {
116
+ async branchExists(project, branchName) {
94
117
  const encodedBranch = encodeURIComponent(branchName);
95
- const endpoint = `/projects/${projectId}/repository/branches/${encodedBranch}`;
118
+ const endpoint = `/projects/${projectSegment(project)}/repository/branches/${encodedBranch}`;
96
119
  try {
97
120
  await this.request(endpoint, { method: 'GET' });
98
121
  return true;
@@ -105,8 +128,8 @@ export class GitLabProvider {
105
128
  throw err;
106
129
  }
107
130
  }
108
- async createBranch(projectId, branchName, ref) {
109
- const endpoint = `/projects/${projectId}/repository/branches`;
131
+ async createBranch(project, branchName, ref) {
132
+ const endpoint = `/projects/${projectSegment(project)}/repository/branches`;
110
133
  const response = await this.request(endpoint, {
111
134
  method: 'POST',
112
135
  body: { branch: branchName, ref },
@@ -114,8 +137,8 @@ export class GitLabProvider {
114
137
  const raw = await response.json();
115
138
  return { name: branchName, raw };
116
139
  }
117
- async commitFile(projectId, branchName, commitMessage, filePath, content) {
118
- const endpoint = `/projects/${projectId}/repository/commits`;
140
+ async commitFile(project, branchName, commitMessage, filePath, content) {
141
+ const endpoint = `/projects/${projectSegment(project)}/repository/commits`;
119
142
  /* eslint-disable camelcase -- GitLab API field names */
120
143
  const response = await this.request(endpoint, {
121
144
  method: 'POST',
@@ -129,13 +152,13 @@ export class GitLabProvider {
129
152
  const raw = (await response.json());
130
153
  return { id: raw.id, raw };
131
154
  }
132
- async findOpenMergeRequest(projectId, sourceBranch, targetBranch) {
133
- const endpoint = `/projects/${projectId}/merge_requests?state=opened&source_branch=${encodeURIComponent(sourceBranch)}&target_branch=${encodeURIComponent(targetBranch)}`;
155
+ async findOpenMergeRequest(project, sourceBranch, targetBranch) {
156
+ const endpoint = `/projects/${projectSegment(project)}/merge_requests?state=opened&source_branch=${encodeURIComponent(sourceBranch)}&target_branch=${encodeURIComponent(targetBranch)}`;
134
157
  const mergeRequests = (await this.getJson(endpoint));
135
158
  return mergeRequests.length > 0 ? normalizeMergeRequest(mergeRequests[0]) : undefined;
136
159
  }
137
- async createMergeRequest(projectId, sourceBranch, targetBranch, title, description, labels) {
138
- const endpoint = `/projects/${projectId}/merge_requests`;
160
+ async createMergeRequest(project, sourceBranch, targetBranch, title, description, labels) {
161
+ const endpoint = `/projects/${projectSegment(project)}/merge_requests`;
139
162
  /* eslint-disable camelcase -- GitLab API field names */
140
163
  const body = {
141
164
  source_branch: sourceBranch,
@@ -145,24 +168,25 @@ export class GitLabProvider {
145
168
  remove_source_branch: true,
146
169
  };
147
170
  /* eslint-enable camelcase */
148
- if (labels) {
149
- body.labels = labels;
171
+ if (labels?.length) {
172
+ body.labels = labels.join(',');
150
173
  }
151
174
  const response = await this.request(endpoint, { method: 'POST', body });
152
175
  return normalizeMergeRequest((await response.json()));
153
176
  }
154
- async updateMergeRequest(projectId, mergeRequestId, title, description, labels) {
155
- const endpoint = `/projects/${projectId}/merge_requests/${mergeRequestId}`;
177
+ async updateMergeRequest(project, mergeRequest, title, description, labels) {
178
+ // GitLab's per-merge-request endpoints take the project-scoped `iid`, not the global `id`.
179
+ const endpoint = `/projects/${projectSegment(project)}/merge_requests/${mergeRequest.iid}`;
156
180
  const body = { title, description };
157
- if (labels) {
158
- body.labels = labels;
181
+ if (labels?.length) {
182
+ body.labels = labels.join(',');
159
183
  }
160
184
  const response = await this.request(endpoint, { method: 'PUT', body });
161
185
  return normalizeMergeRequest((await response.json()));
162
186
  }
163
- async getProjectVariables(projectId) {
187
+ async getProjectVariables(project) {
164
188
  try {
165
- const variables = (await this.getJson(`/projects/${projectId}/variables`));
189
+ const variables = (await this.getJson(`/projects/${projectSegment(project)}/variables`));
166
190
  return variables.map((variable) => ({ key: variable.key, value: variable.value, raw: variable }));
167
191
  }
168
192
  catch {
@@ -170,13 +194,15 @@ export class GitLabProvider {
170
194
  return [];
171
195
  }
172
196
  }
173
- // eslint-disable-next-line class-methods-use-this -- part of the VcsProvider instance contract; GitLab's URL scheme needs no instance state
174
- buildAuthenticatedRemoteUrl(host, token, projectPath) {
175
- return `https://oauth2:${token}@${host}/${projectPath}.git`;
197
+ // eslint-disable-next-line class-methods-use-this -- part of the VcsProvider instance contract; the path scheme needs no instance state
198
+ buildChangeRequestUrl(projectUrl, changeRequestIid) {
199
+ return `${projectUrl.replace(/\/+$/, '')}/-/merge_requests/${changeRequestIid}`;
200
+ }
201
+ buildAuthenticatedRemoteUrl(token, projectPath) {
202
+ return `https://oauth2:${token}@${this.host}/${projectPath}.git`;
176
203
  }
177
- // eslint-disable-next-line class-methods-use-this -- part of the VcsProvider instance contract; GitLab's URL scheme needs no instance state
178
- buildCiCloneUrl(host, ciJobToken, projectPath) {
179
- return `https://gitlab-ci-token:${ciJobToken}@${host}/${projectPath}.git`;
204
+ buildCiCloneUrl(ciJobToken, projectPath) {
205
+ return `https://gitlab-ci-token:${ciJobToken}@${this.host}/${projectPath}.git`;
180
206
  }
181
207
  async request(endpoint, options = {}) {
182
208
  const url = endpoint.startsWith('http') ? endpoint : `${this.apiUrl}${endpoint}`;
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../src/common/vcs/gitlab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA8BH,SAAS,gBAAgB,CAAC,OAA8B;IACtD,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,iBAAiB,EAAE,OAAO,CAAC,mBAAmB;QAC9C,aAAa,EAAE,OAAO,CAAC,cAAc;QACrC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;QAClC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI;QACrE,GAAG,EAAE,OAAO;KACb,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,YAAwC;IACrE,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,YAAY,EAAE,YAAY,CAAC,aAAa;QACxC,YAAY,EAAE,YAAY,CAAC,aAAa;QACxC,MAAM,EAAE,YAAY,CAAC,OAAO;QAC5B,GAAG,EAAE,YAAY;KAClB,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,OAAO,cAAc;IACR,MAAM,CAAS;IACf,KAAK,CAAS;IAE/B,YAAmB,MAAc,EAAE,KAAa;QAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CA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- import type { VcsProvider, VcsProviderKind } from './types.js';
2
- /** Builds a `VcsProvider` for the given platform. Only `gitlab` is implemented today. */
3
- export declare function getVcsProvider(kind: VcsProviderKind, apiUrl: string, token: string): VcsProvider;
4
- export type { VcsBranch, VcsCommit, VcsMergeRequest, VcsProject, VcsProjectVariable, VcsProvider, VcsProviderKind, } from './types.js';
1
+ export { createVcsProvider, listVcsProviderKinds, registerVcsProvider } from './registry.js';
2
+ export { GitHubProvider } from './github.js';
3
+ export { GitLabProvider } from './gitlab.js';
4
+ export type { VcsBranch, VcsCiContext, VcsCommit, VcsMergeRequest, VcsProject, VcsProjectRef, VcsProjectVariable, VcsProvider, VcsProviderFactory, VcsProviderKind, VcsProviderOptions, VcsTerminology, } from './types.js';
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
2
+ * Copyright (c) 2026, Clay Chipps.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,14 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { GitHubProvider } from './github.js';
16
17
  import { GitLabProvider } from './gitlab.js';
17
- /** Builds a `VcsProvider` for the given platform. Only `gitlab` is implemented today. */
18
- export function getVcsProvider(kind, apiUrl, token) {
19
- switch (kind) {
20
- case 'gitlab':
21
- return new GitLabProvider(apiUrl, token);
22
- default:
23
- throw new Error(`VCS provider "${kind}" is not yet supported.`);
24
- }
25
- }
18
+ import { registerVcsProvider } from './registry.js';
19
+ registerVcsProvider('gitlab', (options) => new GitLabProvider(options));
20
+ registerVcsProvider('github', (options) => new GitHubProvider(options));
21
+ export { createVcsProvider, listVcsProviderKinds, registerVcsProvider } from './registry.js';
22
+ export { GitHubProvider } from './github.js';
23
+ export { GitLabProvider } from './gitlab.js';
26
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/vcs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,IAAqB,EAAE,MAAc,EAAE,KAAa;IACjF,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC3C;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAc,yBAAyB,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/vcs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,mBAAmB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AACxE,mBAAmB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { VcsProvider, VcsProviderFactory, VcsProviderKind, VcsProviderOptions } from './types.js';
2
+ /**
3
+ * Registers a platform implementation. Built-in providers register themselves when `./index.js` is
4
+ * imported; call this directly to add a platform without modifying this package.
5
+ */
6
+ export declare function registerVcsProvider(kind: VcsProviderKind, factory: VcsProviderFactory): void;
7
+ /** The platforms currently registered, for flag options and error messages. */
8
+ export declare function listVcsProviderKinds(): VcsProviderKind[];
9
+ /** Builds a provider for the given platform and instance. */
10
+ export declare function createVcsProvider(kind: VcsProviderKind, options: VcsProviderOptions): VcsProvider;
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright (c) 2026, Clay Chipps.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ const factories = new Map();
17
+ /**
18
+ * Registers a platform implementation. Built-in providers register themselves when `./index.js` is
19
+ * imported; call this directly to add a platform without modifying this package.
20
+ */
21
+ export function registerVcsProvider(kind, factory) {
22
+ factories.set(kind, factory);
23
+ }
24
+ /** The platforms currently registered, for flag options and error messages. */
25
+ export function listVcsProviderKinds() {
26
+ return [...factories.keys()].sort();
27
+ }
28
+ /** Builds a provider for the given platform and instance. */
29
+ export function createVcsProvider(kind, options) {
30
+ const factory = factories.get(kind);
31
+ if (!factory) {
32
+ const known = listVcsProviderKinds().join(', ');
33
+ throw new Error(`VCS provider "${kind}" is not supported. Registered providers: ${known}.`);
34
+ }
35
+ return factory(options);
36
+ }
37
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/common/vcs/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuC,CAAC;AAEjE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAqB,EAAE,OAA2B;IACpF,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACtC,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,iBAAiB,CAAC,IAAqB,EAAE,OAA2B;IAClF,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAc,6CAA6C,KAAK,GAAG,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,8 +1,13 @@
1
1
  /** The set of source-control-hosting platforms `simply-cicd` knows how to talk to. */
2
- export type VcsProviderKind = 'gitlab';
2
+ export type VcsProviderKind = 'gitlab' | 'github';
3
3
  /** A repository/project, normalized across VCS platforms. */
4
4
  export type VcsProject = {
5
5
  id: number;
6
+ /**
7
+ * How this provider addresses the project in its own API: the numeric ID for GitLab,
8
+ * `owner/repo` for GitHub. Prefer this over `id` when passing a project to provider methods.
9
+ */
10
+ key: string;
6
11
  name: string;
7
12
  pathWithNamespace: string;
8
13
  defaultBranch?: string;
@@ -12,6 +17,11 @@ export type VcsProject = {
12
17
  /** The raw, platform-specific API response this was derived from. */
13
18
  raw: unknown;
14
19
  };
20
+ /**
21
+ * A project as accepted by `VcsProvider` methods: either a normalized `VcsProject` or a bare
22
+ * provider-native key (a GitLab numeric ID, a GitHub `owner/repo`).
23
+ */
24
+ export type VcsProjectRef = string | number | Pick<VcsProject, 'key'>;
15
25
  /** A branch, normalized across VCS platforms. */
16
26
  export type VcsBranch = {
17
27
  name: string;
@@ -22,7 +32,10 @@ export type VcsCommit = {
22
32
  id?: string;
23
33
  raw: unknown;
24
34
  };
25
- /** A merge/pull request, normalized across VCS platforms. */
35
+ /**
36
+ * A merge/pull request, normalized across VCS platforms. `iid` is the number the platform shows
37
+ * users and accepts in its per-request endpoints — GitLab's `iid`, GitHub's PR `number`.
38
+ */
26
39
  export type VcsMergeRequest = {
27
40
  id: number;
28
41
  iid: number;
@@ -40,30 +53,69 @@ export type VcsProjectVariable = {
40
53
  raw: unknown;
41
54
  };
42
55
  /**
43
- * A source-control-hosting platform client, abstracted so that platforms beyond GitLab (e.g.
44
- * GitHub) can be added later without changing any command that consumes a `VcsProvider`.
56
+ * What a platform calls a proposed change, for user-facing log and message text. GitLab says
57
+ * "merge request"/"MR"; GitHub says "pull request"/"PR".
58
+ */
59
+ export type VcsTerminology = {
60
+ changeRequest: string;
61
+ changeRequestShort: string;
62
+ /** What the platform calls the repo-scoped CI variables read by `getProjectVariables`. */
63
+ projectVariable: string;
64
+ };
65
+ /** The upstream repository identity, as read from the platform's own CI environment variables. */
66
+ export type VcsCiContext = {
67
+ projectPath?: string;
68
+ projectId?: string;
69
+ };
70
+ /** Everything a provider needs to talk to a specific instance of its platform. */
71
+ export type VcsProviderOptions = {
72
+ /** The instance hostname, e.g. `gitlab.com` or `github.com`. */
73
+ host?: string;
74
+ token: string;
75
+ /** Overrides the provider's derived API base URL. Rarely needed outside self-hosted instances. */
76
+ apiUrl?: string;
77
+ };
78
+ /**
79
+ * A source-control-hosting platform client, abstracted so that commands never encode one
80
+ * platform's API shape, URL scheme, or vocabulary.
45
81
  */
46
82
  export interface VcsProvider {
47
- /** Lists all projects/repos under a group/org, including subgroups, paginating as needed. */
48
- getGroupProjects(groupId: string | number): Promise<VcsProject[]>;
83
+ readonly kind: VcsProviderKind;
84
+ /** The platform's vocabulary, for composing user-facing text. */
85
+ readonly terminology: VcsTerminology;
86
+ /** The instance hostname this provider was built for. */
87
+ readonly host: string;
88
+ /** The API base URL this provider talks to, derived from the host unless overridden. */
89
+ readonly apiUrl: string;
90
+ /** Reads the upstream repository's identity from this platform's CI environment variables. */
91
+ getCiContext(): VcsCiContext;
92
+ /** Lists all projects/repos under a group/org, including subgroups where the platform has them. */
93
+ listProjects(groupId: string | number): Promise<VcsProject[]>;
49
94
  /** Fetches the raw content of a file from a project at a given ref. */
50
- getFileContent(projectId: string | number, filePath: string, ref: string): Promise<string>;
95
+ getFileContent(project: VcsProjectRef, filePath: string, ref: string): Promise<string>;
51
96
  /** Returns whether a branch exists in a project. */
52
- branchExists(projectId: string | number, branchName: string): Promise<boolean>;
97
+ branchExists(project: VcsProjectRef, branchName: string): Promise<boolean>;
53
98
  /** Creates a branch from a reference point (usually the project's default branch). */
54
- createBranch(projectId: string | number, branchName: string, ref: string): Promise<VcsBranch>;
99
+ createBranch(project: VcsProjectRef, branchName: string, ref: string): Promise<VcsBranch>;
55
100
  /** Commits new content for a single file to a branch. */
56
- commitFile(projectId: string | number, branchName: string, commitMessage: string, filePath: string, content: string): Promise<VcsCommit>;
101
+ commitFile(project: VcsProjectRef, branchName: string, commitMessage: string, filePath: string, content: string): Promise<VcsCommit>;
57
102
  /** Finds an existing open merge/pull request with the given source and target branch, if any. */
58
- findOpenMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string): Promise<VcsMergeRequest | undefined>;
103
+ findOpenMergeRequest(project: VcsProjectRef, sourceBranch: string, targetBranch: string): Promise<VcsMergeRequest | undefined>;
59
104
  /** Creates a new merge/pull request. */
60
- createMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
105
+ createMergeRequest(project: VcsProjectRef, sourceBranch: string, targetBranch: string, title: string, description: string, labels?: string[]): Promise<VcsMergeRequest>;
61
106
  /** Updates an existing merge/pull request's title, description, and labels. */
62
- updateMergeRequest(projectId: string | number, mergeRequestId: number, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
107
+ updateMergeRequest(project: VcsProjectRef, mergeRequest: VcsMergeRequest, title: string, description: string, labels?: string[]): Promise<VcsMergeRequest>;
63
108
  /** Fetches project/repo-level CI variables. Returns an empty array if unreadable. */
64
- getProjectVariables(projectId: string | number): Promise<VcsProjectVariable[]>;
109
+ getProjectVariables(project: VcsProjectRef): Promise<VcsProjectVariable[]>;
110
+ /**
111
+ * Builds the browser URL for a merge/pull request, given the project's own web URL. The path
112
+ * differs per platform — GitLab nests it under `/-/merge_requests/`, GitHub under `/pull/`.
113
+ */
114
+ buildChangeRequestUrl(projectUrl: string, changeRequestIid: string | number): string;
65
115
  /** Builds a token-authenticated remote URL suitable for push/tag operations (e.g. `git remote add`). */
66
- buildAuthenticatedRemoteUrl(host: string, token: string, projectPath: string): string;
116
+ buildAuthenticatedRemoteUrl(token: string, projectPath: string): string;
67
117
  /** Builds a CI-job-token-authenticated remote URL suitable for a read-only `git clone`. */
68
- buildCiCloneUrl(host: string, ciJobToken: string, projectPath: string): string;
118
+ buildCiCloneUrl(ciJobToken: string, projectPath: string): string;
69
119
  }
120
+ /** Constructs a provider for one instance of a platform. */
121
+ export type VcsProviderFactory = (options: VcsProviderOptions) => VcsProvider;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
2
+ * Copyright (c) 2026, Clay Chipps.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
2
+ * Copyright (c) 2026, Clay Chipps.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
2
+ * Copyright (c) 2026, Clay Chipps.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
2
+ * Copyright (c) 2026, Clay Chipps.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,11 +1,13 @@
1
1
  # summary
2
2
 
3
- Generate a FlexiPage delta between two commits and post the results to the merge request.
3
+ Generate a Flexipage delta between two commits and post the results to the change request.
4
4
 
5
5
  # description
6
6
 
7
- Runs the upstream `flexipage-delta` binary to diff `**/*.flexipage-meta.xml` files between `--from` and `--to`, then `flexipage-delta-gitlab` to post the results back to the GitLab merge request. Both binaries are GitLab-specific, so this command isn't routed through the VCS provider abstraction. Failures are logged, not thrown — a diff-posting step shouldn't fail the build.
7
+ Runs the upstream `flexipage-delta` binary to diff `**/*.flexipage-meta.xml` files between `--from` and `--to`, then the reporter binary for the platform `--vcs-provider` selects — `flexipage-delta-gitlab` or `flexipage-delta-github` — to post the results back to the merge or pull request. Failures are logged, not thrown — a diff-posting step shouldn't fail the build.
8
8
 
9
9
  # examples
10
10
 
11
11
  - <%= config.bin %> <%= command.id %> --ci-project-id 123 --ci-merge-request-iid 45 --from abc123 --to def456 --project-access-token glpat-...
12
+
13
+ - <%= config.bin %> <%= command.id %> --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
@@ -1,11 +1,13 @@
1
1
  # summary
2
2
 
3
- Generate a Flow delta between two commits and post the results to the merge request.
3
+ Generate a Flow delta between two commits and post the results to the change request.
4
4
 
5
5
  # description
6
6
 
7
- Runs the upstream `flow-delta` binary to diff `**/*.flow-meta.xml` files between `--from` and `--to`, then `flow-delta-gitlab` to post the results back to the GitLab merge request. Both binaries are GitLab-specific, so this command isn't routed through the VCS provider abstraction. Failures are logged, not thrown — a diff-posting step shouldn't fail the build.
7
+ Runs the upstream `flow-delta` binary to diff `**/*.flow-meta.xml` files between `--from` and `--to`, then the reporter binary for the platform `--vcs-provider` selects — `flow-delta-gitlab` or `flow-delta-github` — to post the results back to the merge or pull request. Failures are logged, not thrown — a diff-posting step shouldn't fail the build.
8
8
 
9
9
  # examples
10
10
 
11
11
  - <%= config.bin %> <%= command.id %> --ci-project-id 123 --ci-merge-request-iid 45 --from abc123 --to def456 --project-access-token glpat-...
12
+
13
+ - <%= config.bin %> <%= command.id %> --vcs-provider github --ci-repository my-org/my-repo --ci-pull-request-number 45 --ci-run-id 987 --from abc123 --to def456 --project-access-token ghp-...
@@ -52,11 +52,31 @@ The VCS platform hosting this project.
52
52
 
53
53
  # flags.diff-ci-project-id.summary
54
54
 
55
- GitLab CI project ID.
55
+ GitLab only: numeric CI project ID of the project to post the diff to.
56
56
 
57
57
  # flags.diff-ci-merge-request-iid.summary
58
58
 
59
- GitLab CI merge request internal ID.
59
+ GitLab only: internal ID of the merge request to post the diff to.
60
+
61
+ # flags.diff-ci-repository.summary
62
+
63
+ GitHub only: repository to post the diff to, as owner/repo.
64
+
65
+ # flags.diff-ci-pull-request-number.summary
66
+
67
+ GitHub only: number of the pull request to post the diff to.
68
+
69
+ # flags.diff-ci-run-id.summary
70
+
71
+ GitHub only: Actions run ID, used to build links back to the run's artifacts.
72
+
73
+ # flags.diff-ci-server-url.summary
74
+
75
+ GitHub only: server URL, for instances other than github.com.
76
+
77
+ # flags.diff-ci-commit-sha.summary
78
+
79
+ Commit SHA to attribute the posted diff to.
60
80
 
61
81
  # flags.diff-from.summary
62
82
 
@@ -1,11 +1,11 @@
1
- # summary
2
-
3
- Run the deploy-unpackaged stage of a happy-soup deployment.
4
-
5
- # description
6
-
7
- Runs the `bin/unpackagedDeploy.sh` script (if present) for each configured deployment that participates in this stage, cloning each repo fresh and resuming from the deployment progress file unless --start-from is given.
8
-
9
- # examples
10
-
11
- - <%= config.bin %> <%= command.id %> --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat
1
+ # summary
2
+
3
+ Run the deploy-unpackaged stage of a happy-soup deployment.
4
+
5
+ # description
6
+
7
+ Runs the `bin/unpackagedDeploy.sh` script (if present) for each configured deployment that participates in this stage, cloning each repo fresh and resuming from the deployment progress file unless --start-from is given.
8
+
9
+ # examples
10
+
11
+ - <%= config.bin %> <%= command.id %> --ci-job-token $CI_JOB_TOKEN --alias my-org --source-branch-name release/uat