@salesforce/plugin-release-management 3.11.2 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,98 @@
1
+ import { Operation } from 'just-diff';
2
+ import { SfCommand } from '@salesforce/sf-plugins-core';
3
+ import { JsonMap } from '@salesforce/ts-types';
4
+ import { Interfaces } from '@oclif/core';
5
+ export type ArtifactsCompareResult = {
6
+ [plugin: string]: {
7
+ current: {
8
+ version: string;
9
+ snapshot: CommandSnapshot[];
10
+ schemas: Record<string, JsonMap>;
11
+ };
12
+ previous: {
13
+ version: string;
14
+ snapshot: CommandSnapshot[];
15
+ schemas: Record<string, JsonMap>;
16
+ };
17
+ snapshotChanges: SnapshotChanges;
18
+ schemaChanges: SchemaChanges;
19
+ };
20
+ };
21
+ type CommandSnapshot = {
22
+ command: string;
23
+ plugin: string;
24
+ flags: string[];
25
+ alias: string[];
26
+ args?: string[];
27
+ };
28
+ type SnapshotChanges = {
29
+ commandAdditions: string[];
30
+ commandRemovals: string[];
31
+ commands: Array<{
32
+ command: string;
33
+ aliasAdditions: string[];
34
+ aliasRemovals: string[];
35
+ flagAdditions: string[];
36
+ flagRemovals: string[];
37
+ hasChanges: boolean;
38
+ hasBreakingChanges: boolean;
39
+ }>;
40
+ hasChanges: boolean;
41
+ hasBreakingChanges: boolean;
42
+ };
43
+ type SchemaChanges = Array<{
44
+ op: Operation;
45
+ path: Array<string | number>;
46
+ value: unknown;
47
+ }>;
48
+ export declare class SnapshotComparator {
49
+ current: CommandSnapshot[];
50
+ previous: CommandSnapshot[];
51
+ constructor(current: CommandSnapshot[], previous: CommandSnapshot[]);
52
+ getChanges(): SnapshotChanges;
53
+ getCommandAdditions(): string[];
54
+ getCommandRemovals(): string[];
55
+ getFlagAdditions(cmd: string): string[];
56
+ getFlagRemovals(cmd: string): string[];
57
+ getAliasAdditions(cmd: string): string[];
58
+ getAliasRemovals(cmd: string): string[];
59
+ }
60
+ export declare class SchemaComparator {
61
+ private current;
62
+ private previous;
63
+ constructor(current: Record<string, JsonMap>, previous: Record<string, JsonMap>);
64
+ static makeReadable(current: Record<string, JsonMap>, previous: Record<string, JsonMap>, changes: SchemaChanges): Record<string, string[]>;
65
+ static hasBreakingChange(changes: SchemaChanges): boolean;
66
+ private static isMeaningless;
67
+ getChanges(): SchemaChanges;
68
+ }
69
+ export default class ArtifactsTest extends SfCommand<ArtifactsCompareResult> {
70
+ static readonly summary: string;
71
+ static readonly examples: string[];
72
+ static readonly flags: {
73
+ plugin: Interfaces.OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
74
+ previous: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
75
+ current: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
76
+ };
77
+ private octokit;
78
+ private currentPlugins;
79
+ private previousPlugins;
80
+ private flags;
81
+ private packageJson;
82
+ private versions;
83
+ private current;
84
+ private previous;
85
+ run(): Promise<ArtifactsCompareResult>;
86
+ private showResults;
87
+ private showRemovedPlugins;
88
+ private showAddedPlugins;
89
+ private resolveVersions;
90
+ private getCurrentPlugins;
91
+ private getPluginsForVersion;
92
+ private filterPlugins;
93
+ private getVersions;
94
+ private getSchemas;
95
+ private getSnapshot;
96
+ private getTags;
97
+ }
98
+ export {};
@@ -0,0 +1,453 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.SchemaComparator = exports.SnapshotComparator = void 0;
10
+ const fs = require("fs");
11
+ const child_process_1 = require("child_process");
12
+ const node_util_1 = require("node:util");
13
+ const chalk = require("chalk");
14
+ const semver = require("semver");
15
+ const got_1 = require("got");
16
+ const just_diff_1 = require("just-diff");
17
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
18
+ const core_1 = require("@salesforce/core");
19
+ const kit_1 = require("@salesforce/kit");
20
+ const core_2 = require("@octokit/core");
21
+ const plugin_paginate_rest_1 = require("@octokit/plugin-paginate-rest");
22
+ const ts_types_1 = require("@salesforce/ts-types");
23
+ const MyOctokit = core_2.Octokit.plugin(plugin_paginate_rest_1.paginateRest);
24
+ const exec = (0, node_util_1.promisify)(child_process_1.exec);
25
+ core_1.Messages.importMessagesDirectory(__dirname);
26
+ const messages = core_1.Messages.load('@salesforce/plugin-release-management', 'cli.artifacts.compare', [
27
+ 'summary',
28
+ 'examples',
29
+ 'error.BreakingChanges',
30
+ 'error.VersionNotFound',
31
+ 'error.InvalidVersions',
32
+ 'error.InvalidRepo',
33
+ 'flags.plugins.summary',
34
+ 'flags.current.summary',
35
+ 'flags.previous.summary',
36
+ ]);
37
+ async function getOwnerAndRepo(plugin) {
38
+ const result = await exec(`npm view ${plugin} repository.url --json`);
39
+ const parsed = JSON.parse(result.stdout)
40
+ .replace('git+https://github.com/', '')
41
+ .replace('.git', '')
42
+ .split('/');
43
+ return { owner: parsed[0], repo: parsed[1] };
44
+ }
45
+ async function getNpmVersions(plugin) {
46
+ const versions = await exec(`npm view ${plugin} versions --json`);
47
+ return semver.rsort(JSON.parse(versions.stdout));
48
+ }
49
+ function verifyCurrentIsNewer(current, previous) {
50
+ if (!current || !previous)
51
+ return;
52
+ if (semver.lt(current, previous)) {
53
+ throw new Error(messages.getMessage('error.InvalidVersions', [current, previous]));
54
+ }
55
+ }
56
+ class SnapshotComparator {
57
+ constructor(current, previous) {
58
+ this.current = current;
59
+ this.previous = previous;
60
+ }
61
+ getChanges() {
62
+ const commandAdditions = this.getCommandAdditions();
63
+ const commandRemovals = this.getCommandRemovals();
64
+ const commands = this.current
65
+ .map((cmd) => cmd.command)
66
+ .map((cmd) => {
67
+ const aliasAdditions = this.getAliasAdditions(cmd);
68
+ const aliasRemovals = this.getAliasRemovals(cmd);
69
+ const flagAdditions = this.getFlagAdditions(cmd);
70
+ const flagRemovals = this.getFlagRemovals(cmd);
71
+ return {
72
+ command: cmd,
73
+ aliasAdditions,
74
+ aliasRemovals,
75
+ flagAdditions,
76
+ flagRemovals,
77
+ hasChanges: Boolean(aliasAdditions.length || aliasRemovals.length || flagAdditions.length || flagRemovals.length),
78
+ hasBreakingChanges: Boolean(aliasRemovals.length || flagRemovals.length),
79
+ };
80
+ });
81
+ const hasRemovals = commands.find((cmd) => cmd.aliasRemovals.length > 0 || cmd.flagRemovals.length > 0);
82
+ const hasAdditions = commands.find((cmd) => cmd.aliasAdditions.length > 0 || cmd.flagAdditions.length > 0);
83
+ const hasChanges = Boolean(commandAdditions.length || commandRemovals.length || hasRemovals || hasAdditions);
84
+ const hasBreakingChanges = Boolean(commandRemovals.length || hasRemovals);
85
+ return {
86
+ commandAdditions: this.getCommandAdditions(),
87
+ commandRemovals: this.getCommandRemovals(),
88
+ commands,
89
+ hasChanges,
90
+ hasBreakingChanges,
91
+ };
92
+ }
93
+ getCommandAdditions() {
94
+ return this.current
95
+ .filter((cmd) => !this.previous.find((snapshot) => snapshot.command === cmd.command))
96
+ .map((cmd) => cmd.command);
97
+ }
98
+ getCommandRemovals() {
99
+ return this.previous
100
+ .filter((cmd) => !this.current.find((snapshot) => snapshot.command === cmd.command))
101
+ .map((cmd) => cmd.command);
102
+ }
103
+ getFlagAdditions(cmd) {
104
+ const current = this.current.find((snapshot) => snapshot.command === cmd);
105
+ const previous = this.previous.find((snapshot) => snapshot.command === cmd);
106
+ if (!current || !previous) {
107
+ return [];
108
+ }
109
+ return current.flags.filter((flag) => !previous.flags.includes(flag));
110
+ }
111
+ getFlagRemovals(cmd) {
112
+ const current = this.current.find((snapshot) => snapshot.command === cmd);
113
+ const previous = this.previous.find((snapshot) => snapshot.command === cmd);
114
+ if (!current || !previous) {
115
+ return [];
116
+ }
117
+ return previous.flags.filter((flag) => !current.flags.includes(flag));
118
+ }
119
+ getAliasAdditions(cmd) {
120
+ const current = this.current.find((snapshot) => snapshot.command === cmd);
121
+ const previous = this.previous.find((snapshot) => snapshot.command === cmd);
122
+ if (!current || !previous) {
123
+ return [];
124
+ }
125
+ return current.alias.filter((alias) => !previous.alias.includes(alias));
126
+ }
127
+ getAliasRemovals(cmd) {
128
+ const current = this.current.find((snapshot) => snapshot.command === cmd);
129
+ const previous = this.previous.find((snapshot) => snapshot.command === cmd);
130
+ if (!current || !previous) {
131
+ return [];
132
+ }
133
+ return previous.alias.filter((alias) => !current.alias.includes(alias));
134
+ }
135
+ }
136
+ exports.SnapshotComparator = SnapshotComparator;
137
+ class SchemaComparator {
138
+ constructor(current, previous) {
139
+ this.current = current;
140
+ this.previous = previous;
141
+ }
142
+ static makeReadable(current, previous, changes) {
143
+ const humanReadableChanges = {};
144
+ for (const change of changes) {
145
+ const lastPathElement = change.path[change.path.length - 1];
146
+ if (SchemaComparator.isMeaningless(lastPathElement))
147
+ continue;
148
+ const objPath = change.path.join('.');
149
+ const existing = (0, ts_types_1.get)(previous, objPath);
150
+ const latest = (0, ts_types_1.get)(current, objPath);
151
+ const [commandId] = objPath.split('.definitions');
152
+ const readablePath = objPath.replace(`${commandId}.`, '');
153
+ if (!humanReadableChanges[commandId]) {
154
+ humanReadableChanges[commandId] = [];
155
+ }
156
+ const lastElementIsNum = (0, ts_types_1.isNumber)(lastPathElement);
157
+ const basePath = lastElementIsNum ? readablePath.replace(`.${lastPathElement}`, '') : readablePath;
158
+ switch (change.op) {
159
+ case 'replace':
160
+ humanReadableChanges[commandId].push(`❌ ${chalk.underline(readablePath)} was ${chalk.red.bold('changed')} from ${chalk.cyan(existing)} to ${chalk.cyan(latest)}`);
161
+ break;
162
+ case 'add':
163
+ humanReadableChanges[commandId].push(lastElementIsNum
164
+ ? `- Array item at ${chalk.underline(basePath)} was ${chalk.cyan('added')} to current schema`
165
+ : `- ${chalk.underline(readablePath)} was ${chalk.cyan('added')} to current schema`);
166
+ break;
167
+ case 'remove':
168
+ humanReadableChanges[commandId].push(lastElementIsNum
169
+ ? `❌ Array item at ${chalk.underline(basePath)} was ${chalk.red.bold('not found')} in current schema`
170
+ : `❌ ${chalk.underline(readablePath)} was ${chalk.red.bold('not found')} in current schema`);
171
+ break;
172
+ default:
173
+ break;
174
+ }
175
+ }
176
+ return humanReadableChanges;
177
+ }
178
+ static hasBreakingChange(changes) {
179
+ return changes.some((change) => change.op === 'remove' || change.op === 'replace');
180
+ }
181
+ static isMeaningless(n) {
182
+ const meaninglessKeys = ['$comment', '__computed'];
183
+ return meaninglessKeys.includes(n);
184
+ }
185
+ getChanges() {
186
+ return (0, just_diff_1.diff)(this.previous, this.current);
187
+ }
188
+ }
189
+ exports.SchemaComparator = SchemaComparator;
190
+ class ArtifactsTest extends sf_plugins_core_1.SfCommand {
191
+ async run() {
192
+ const { flags } = await this.parse(ArtifactsTest);
193
+ this.flags = flags;
194
+ const auth = (0, ts_types_1.ensureString)(kit_1.env.getString('GH_TOKEN') ?? kit_1.env.getString('GITHUB_TOKEN'), 'The GH_TOKEN env var is required.');
195
+ this.octokit = new MyOctokit({ auth });
196
+ const fileData = await fs.promises.readFile('package.json', 'utf8');
197
+ this.packageJson = (0, kit_1.parseJson)(fileData);
198
+ if (!['@salesforce/cli', 'sfdx-cli'].includes(this.packageJson.name)) {
199
+ throw messages.createError('error.InvalidRepo');
200
+ }
201
+ this.versions = await getNpmVersions(this.packageJson.name);
202
+ this.resolveVersions();
203
+ verifyCurrentIsNewer(this.current, this.previous);
204
+ this.currentPlugins = await this.getCurrentPlugins();
205
+ this.previousPlugins = await this.getPluginsForVersion(this.previous);
206
+ const promises = Object.keys(this.currentPlugins).map(async (plugin) => {
207
+ const { owner, repo } = await getOwnerAndRepo(plugin);
208
+ const { current, previous } = await this.getVersions(plugin, owner, repo);
209
+ const currentSnapshot = await this.getSnapshot(owner, repo, current);
210
+ const previousSnapshot = await this.getSnapshot(owner, repo, previous);
211
+ const currentSchemas = await this.getSchemas(owner, repo, current);
212
+ const previousSchemas = await this.getSchemas(owner, repo, previous);
213
+ const schemaChanges = new SchemaComparator(currentSchemas, previousSchemas).getChanges();
214
+ return {
215
+ [plugin]: {
216
+ current: {
217
+ version: current,
218
+ snapshot: currentSnapshot,
219
+ schemas: currentSchemas,
220
+ },
221
+ previous: {
222
+ version: previous,
223
+ snapshot: previousSnapshot,
224
+ schemas: previousSchemas,
225
+ },
226
+ snapshotChanges: new SnapshotComparator(currentSnapshot, previousSnapshot).getChanges(),
227
+ schemaChanges,
228
+ },
229
+ };
230
+ });
231
+ const results = (await Promise.all(promises)).reduce((acc, result) => ({ ...acc, ...result }), {});
232
+ const summary = this.showResults(results);
233
+ this.styledHeader('Summary');
234
+ for (const [plugin, logs] of Object.entries(summary)) {
235
+ if (logs.length === 0)
236
+ this.log('✅', plugin, chalk.dim(`(${this.previousPlugins[plugin]} -> ${this.currentPlugins[plugin]})`));
237
+ else {
238
+ this.log();
239
+ this.log('❌', plugin, chalk.dim(`(${this.previousPlugins[plugin]} -> ${this.currentPlugins[plugin]})`));
240
+ for (const log of logs)
241
+ this.log(' -', log);
242
+ this.log();
243
+ }
244
+ }
245
+ this.log();
246
+ const removedPlugins = this.showRemovedPlugins();
247
+ this.log();
248
+ this.showAddedPlugins();
249
+ this.log();
250
+ const hasBreakingSnapshotChanges = Object.values(results).some((result) => result.snapshotChanges.hasBreakingChanges);
251
+ const hasBreakingSchemaChanges = Object.values(results).some((result) => SchemaComparator.hasBreakingChange(result.schemaChanges));
252
+ if (hasBreakingSnapshotChanges || hasBreakingSchemaChanges || removedPlugins.length > 0) {
253
+ throw messages.createError('error.BreakingChanges');
254
+ }
255
+ return results;
256
+ }
257
+ showResults(results) {
258
+ const summary = {};
259
+ for (const [plugin, result] of Object.entries(results)) {
260
+ summary[plugin] = [];
261
+ this.styledHeader(plugin);
262
+ this.log('Current:', result.current.version);
263
+ this.log('Previous:', result.previous.version);
264
+ this.log();
265
+ this.log(chalk.underline.cyan('Snapshot Changes'));
266
+ if (result.snapshotChanges.commandAdditions.length) {
267
+ this.log(chalk.dim('New Commands:'), result.snapshotChanges.commandAdditions);
268
+ }
269
+ if (result.snapshotChanges.commandRemovals.length) {
270
+ summary[plugin].push(`Removed commands: ${result.snapshotChanges.commandRemovals.join(', ')}`);
271
+ this.log(chalk.red('❌ Removed Commands:'), result.snapshotChanges.commandRemovals);
272
+ }
273
+ for (const cmd of result.snapshotChanges.commands) {
274
+ this.log(cmd.command, !cmd.hasChanges ? chalk.dim('No Changes') : '');
275
+ if (cmd.flagAdditions.length)
276
+ this.log(chalk.dim(' Flag Additions:'), cmd.flagAdditions);
277
+ if (cmd.flagRemovals.length) {
278
+ summary[plugin].push(`${cmd.command} flag removals: ${cmd.flagRemovals.join(', ')}`);
279
+ this.log(chalk.red(' ❌ Flag Removals:'), cmd.flagRemovals);
280
+ }
281
+ if (cmd.aliasAdditions.length)
282
+ this.log(chalk.dim(' Alias Additions:'), cmd.aliasAdditions);
283
+ if (cmd.aliasRemovals.length) {
284
+ summary[plugin].push(`${cmd.command} alias removals: ${cmd.aliasRemovals.join(', ')}`);
285
+ this.log(chalk.red(' ❌ Alias Removals:'), cmd.aliasRemovals);
286
+ }
287
+ }
288
+ this.log();
289
+ this.log(chalk.underline.cyan('Schema Changes'));
290
+ const humanReadableChanges = SchemaComparator.makeReadable(result.current.schemas, result.previous.schemas, result.schemaChanges);
291
+ if (Object.keys(humanReadableChanges).length === 0) {
292
+ this.log(chalk.dim('No changes have been detected.'));
293
+ }
294
+ for (const [commandId, readableChanges] of Object.entries(humanReadableChanges)) {
295
+ this.log();
296
+ this.log(commandId);
297
+ for (const change of readableChanges) {
298
+ if (change.startsWith('❌'))
299
+ summary[plugin].push(change.replace('❌', ''));
300
+ this.log(` ${change}`);
301
+ }
302
+ }
303
+ this.log();
304
+ }
305
+ return summary;
306
+ }
307
+ showRemovedPlugins() {
308
+ const removedPlugins = Object.keys(this.previousPlugins).filter((p) => !this.currentPlugins[p]);
309
+ if (removedPlugins.length > 0) {
310
+ this.styledHeader(chalk.red('Removed Plugins'));
311
+ for (const plugin of removedPlugins) {
312
+ this.log(plugin);
313
+ }
314
+ }
315
+ return removedPlugins;
316
+ }
317
+ showAddedPlugins() {
318
+ const addedPlugins = Object.keys(this.currentPlugins).filter((p) => !this.previousPlugins[p]);
319
+ if (addedPlugins.length > 0) {
320
+ this.styledHeader(chalk.green('Added Plugins'));
321
+ for (const plugin of addedPlugins) {
322
+ this.log(plugin);
323
+ }
324
+ }
325
+ return addedPlugins;
326
+ }
327
+ resolveVersions() {
328
+ this.current = this.flags.current || this.packageJson.version;
329
+ this.previous = this.flags.previous ?? this.versions[this.versions.indexOf(this.current) + 1];
330
+ this.log('Current Version:', this.current);
331
+ this.log('Previous Version:', this.previous);
332
+ if (this.flags.current && !this.versions.includes(this.flags.current)) {
333
+ throw messages.createError('error.VersionNotFound', [this.flags.current]);
334
+ }
335
+ if (this.flags.previous && !this.versions.includes(this.flags.previous)) {
336
+ throw messages.createError('error.VersionNotFound', [this.flags.previous]);
337
+ }
338
+ }
339
+ async getCurrentPlugins() {
340
+ return this.flags.current ? this.getPluginsForVersion(this.current) : this.filterPlugins(this.packageJson);
341
+ }
342
+ async getPluginsForVersion(version) {
343
+ const [owner, repo] = this.packageJson.repository.split('/');
344
+ const response = await this.octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
345
+ owner,
346
+ repo,
347
+ path: 'package.json',
348
+ accept: 'application/vnd.github.json',
349
+ ref: version,
350
+ });
351
+ // @ts-expect-error octokit doesn't have a type for this
352
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
353
+ const pJson = JSON.parse(Buffer.from(response.data.content ?? '', 'base64').toString());
354
+ return this.filterPlugins(pJson);
355
+ }
356
+ filterPlugins(packageJson) {
357
+ const pluginNames = [...(packageJson.oclif?.plugins || []), ...Object.keys(packageJson.oclif?.jitPlugins ?? {})];
358
+ const filtered = (this.flags.plugin ? pluginNames.filter((plugin) => this.flags.plugin?.includes(plugin)) : pluginNames).filter((plugin) => !plugin.startsWith('@oclif'));
359
+ return filtered.reduce((acc, plugin) => ({ ...acc, [plugin]: packageJson.dependencies[plugin] ?? packageJson.oclif.jitPlugins[plugin] }), {});
360
+ }
361
+ async getVersions(plugin, owner, repo) {
362
+ const tags = await this.getTags(owner, repo);
363
+ return {
364
+ current: this.currentPlugins[plugin]
365
+ ? tags.includes(this.currentPlugins[plugin])
366
+ ? this.currentPlugins[plugin]
367
+ : `v${this.currentPlugins[plugin]}`
368
+ : null,
369
+ previous: this.previousPlugins[plugin]
370
+ ? tags.includes(this.previousPlugins[plugin])
371
+ ? this.previousPlugins[plugin]
372
+ : `v${this.previousPlugins[plugin]}`
373
+ : null,
374
+ };
375
+ }
376
+ async getSchemas(owner, repo, ref) {
377
+ if (!ref)
378
+ return {};
379
+ try {
380
+ const schemas = await this.octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
381
+ owner,
382
+ repo,
383
+ path: 'schemas',
384
+ accept: 'application/vnd.github.json',
385
+ ref,
386
+ });
387
+ const schemaFiles = schemas.data.filter((f) => f.type === 'file');
388
+ const hasHookFiles = schemas.data.find((f) => f.name === 'hooks' && f.type === 'dir');
389
+ if (hasHookFiles) {
390
+ const hooks = await this.octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
391
+ owner,
392
+ repo,
393
+ path: 'schemas/hooks',
394
+ accept: 'application/vnd.github.json',
395
+ ref,
396
+ });
397
+ schemaFiles.push(...hooks.data.filter((f) => f.type === 'file'));
398
+ }
399
+ const files = schemaFiles.reduce((acc, file) => ({ ...acc, [file.name]: file.download_url }), {});
400
+ const promises = Object.entries(files).map(async ([name, url]) => {
401
+ const contents = await got_1.default.get(url, { followRedirect: true, responseType: 'json' });
402
+ return { [name.replace(/-/g, ':').replace(/__/g, '-').replace('.json', '')]: contents.body };
403
+ });
404
+ return (await Promise.all(promises)).reduce((acc, result) => ({ ...acc, ...result }), {});
405
+ }
406
+ catch {
407
+ this.warn(`No schemas found for ${owner}/${repo}@${ref}`);
408
+ return {};
409
+ }
410
+ }
411
+ async getSnapshot(owner, repo, ref) {
412
+ if (!ref)
413
+ return [];
414
+ const response = await this.octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
415
+ owner,
416
+ repo,
417
+ path: 'command-snapshot.json',
418
+ accept: 'application/vnd.github.json',
419
+ ref,
420
+ });
421
+ // @ts-expect-error octokit doesn't have a type for this
422
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
423
+ return JSON.parse(Buffer.from(response.data.content ?? '', 'base64').toString());
424
+ }
425
+ async getTags(owner, repo) {
426
+ const response = await this.octokit.paginate('GET /repos/{owner}/{repo}/tags', {
427
+ owner,
428
+ repo,
429
+ // eslint-disable-next-line camelcase
430
+ per_page: 100,
431
+ });
432
+ return response.map((tag) => tag.name);
433
+ }
434
+ }
435
+ exports.default = ArtifactsTest;
436
+ ArtifactsTest.summary = messages.getMessage('summary');
437
+ ArtifactsTest.examples = messages.getMessages('examples');
438
+ ArtifactsTest.flags = {
439
+ plugin: sf_plugins_core_1.Flags.string({
440
+ char: 'p',
441
+ multiple: true,
442
+ summary: messages.getMessage('flags.plugins.summary'),
443
+ }),
444
+ previous: sf_plugins_core_1.Flags.string({
445
+ char: 'r',
446
+ summary: messages.getMessage('flags.previous.summary'),
447
+ }),
448
+ current: sf_plugins_core_1.Flags.string({
449
+ char: 'c',
450
+ summary: messages.getMessage('flags.current.summary'),
451
+ }),
452
+ };
453
+ //# sourceMappingURL=compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../../../src/commands/cli/artifacts/compare.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,iDAAiD;AACjD,yCAAsC;AACtC,+BAA+B;AAC/B,iCAAiC;AACjC,6BAAsB;AACtB,yCAA4C;AAC5C,iEAA+D;AAC/D,2CAA4C;AAC5C,yCAAiD;AACjD,wCAAwC;AACxC,wEAAgF;AAChF,mDAA4E;AAI5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AE,uBAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KACvD,CAAC;IACF,OAAO,EAAE,uBAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;KACtD,CAAC;CACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type GithubCheckClosedResult = {
3
+ issueUrl: string;
4
+ status: string;
5
+ workItem: string;
6
+ };
7
+ export default class GithubCheckClosed extends SfCommand<GithubCheckClosedResult[]> {
8
+ static readonly summary: string;
9
+ static readonly description: string;
10
+ static readonly examples: string[];
11
+ static readonly flags: {
12
+ gus: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
+ 'github-token': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ };
15
+ run(): Promise<GithubCheckClosedResult[]>;
16
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023, salesforce.com, inc.
4
+ * All rights reserved.
5
+ * Licensed under the BSD 3-Clause license.
6
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
10
+ const core_1 = require("@salesforce/core");
11
+ const core_2 = require("@octokit/core");
12
+ const plugin_throttling_1 = require("@octokit/plugin-throttling");
13
+ const ts_types_1 = require("@salesforce/ts-types");
14
+ core_1.Messages.importMessagesDirectory(__dirname);
15
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'github.check.closed');
16
+ class GithubCheckClosed extends sf_plugins_core_1.SfCommand {
17
+ async run() {
18
+ const { flags } = await this.parse(GithubCheckClosed);
19
+ const ThrottledOctokit = core_2.Octokit.plugin(plugin_throttling_1.throttling);
20
+ const octokit = new ThrottledOctokit({
21
+ auth: flags['github-token'],
22
+ throttle: {
23
+ onRateLimit: () => true,
24
+ onSecondaryRateLimit: () => true,
25
+ },
26
+ });
27
+ // search open issues for W- in any comments
28
+ const issues = await octokit.request('GET /search/issues', {
29
+ q: 'is:open is:issue repo:forcedotcom/cli W- in:comments',
30
+ });
31
+ // get all comments for those issues
32
+ const commentsWithWI = (await Promise.all(issues.data.items.map((issue) => octokit.request('GET /repos/{owner}/{repo}/issues/{issue_number}/comments', {
33
+ // eslint-disable-next-line camelcase
34
+ issue_number: issue.number,
35
+ owner: 'forcedotcom',
36
+ repo: 'cli',
37
+ }))))
38
+ // comment includes W-
39
+ .map((issueComments) => issueComments.data.find((comment) => comment.body.includes('W-')))
40
+ .filter(ts_types_1.isObject)
41
+ // extract url and WI number
42
+ .map((comment) => ({ issueUrl: comment.issue_url, workItem: comment.body.match(/W-[0-9]{8,9}/g) }))
43
+ .filter((item) => item.workItem?.length)
44
+ .map((item) => ({ issueUrl: item.issueUrl, workItem: item.workItem[0] }));
45
+ const wiToQuery = commentsWithWI.map((item) => item.workItem);
46
+ // query all those WI in GUS, and turn into a Map
47
+ const wiQueryResult = new Map((await flags.gus
48
+ .getConnection()
49
+ .sobject('ADM_Work__c')
50
+ .find({ Name: { $in: wiToQuery } })).map((item) => [item.Name, item.Status__c]));
51
+ // join GH and GUS results
52
+ const results = commentsWithWI
53
+ .map((item) => ({
54
+ ...item,
55
+ status: wiQueryResult.get(item.workItem),
56
+ issueUrl: item.issueUrl.replace('api.', '').replace('repos/', ''),
57
+ }))
58
+ .filter((item) => item.status);
59
+ this.table(results, {
60
+ issueUrl: { header: 'github issue' },
61
+ workItem: { header: 'work item' },
62
+ status: { header: 'status' },
63
+ }, { sort: 'status' });
64
+ return results;
65
+ }
66
+ }
67
+ exports.default = GithubCheckClosed;
68
+ GithubCheckClosed.summary = messages.getMessage('summary');
69
+ GithubCheckClosed.description = messages.getMessage('description');
70
+ GithubCheckClosed.examples = messages.getMessages('examples');
71
+ GithubCheckClosed.flags = {
72
+ gus: sf_plugins_core_1.Flags.requiredOrg({
73
+ summary: messages.getMessage('flags.gus'),
74
+ }),
75
+ 'github-token': sf_plugins_core_1.Flags.string({
76
+ summary: messages.getMessage('flags.github-token'),
77
+ env: 'GITHUB_TOKEN',
78
+ required: true,
79
+ }),
80
+ };
81
+ //# sourceMappingURL=closed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closed.js","sourceRoot":"","sources":["../../../../src/commands/github/check/closed.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAA+D;AAC/D,2CAA4C;AAC5C,wCAAwC;AACxC,kEAAwD;AACxD,mDAAgD;AAEhD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,uCAAuC,EAAE,qBAAqB,CAAC,CAAC;AAQvG,MAAqB,iBAAkB,SAAQ,2BAAoC;IAgB1E,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACtD,MAAM,gBAAgB,GAAG,cAAO,CAAC,MAAM,CAAC,8BAAU,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;YACnC,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC;YAC3B,QAAQ,EAAE;gBACR,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI;gBACvB,oBAAoB,EAAE,GAAG,EAAE,CAAC,IAAI;aACjC;SACF,CAAC,CAAC;QAEH,4CAA4C;QAC5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE;YACzD,CAAC,EAAE,sDAAsD;SAC1D,CAAC,CA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;IACF,cAAc,EAAE,uBAAK,CAAC,MAAM,CAAC;QAC3B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,GAAG,EAAE,cAAc;QACnB,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "summary": "Look for breaking changes in artifacts (schemas and snapshots) from plugins. Must be run in CLI directory.",
3
+ "examples": ["<%= config.bin %> <%= command.id %>"],
4
+ "error.BreakingChanges": "Breaking changes found in artifacts",
5
+ "flags.plugins.summary": "List of plugins to check for breaking changes.",
6
+ "flags.previous.summary": "Previous CLI version to compare against. Defaults to the last published version.",
7
+ "flags.current.summary": "Current CLI version to compare against. Defaults to the version on the CLI in the current directory.",
8
+ "error.VersionNotFound": "Version not found: %s.",
9
+ "error.InvalidVersions": "Current version %s must be newer than previous version %s.",
10
+ "error.InvalidRepo": "This command must be run from the root directory of @salesforce/cli or sfdx-cli."
11
+ }
@@ -0,0 +1,23 @@
1
+ # summary
2
+
3
+ Show open Github issues with GUS WI
4
+
5
+ # description
6
+
7
+ Description of a command.
8
+
9
+ # flags.name.summary
10
+
11
+ Description of a flag.
12
+
13
+ # examples
14
+
15
+ - <%= config.bin %> <%= command.id %> -o me@gus.com
16
+
17
+ # flags.gus
18
+
19
+ Username/alias of your GUS org connection
20
+
21
+ # flags.github-token
22
+
23
+ Github token--store this in the environment as GITHUB_TOKEN
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.11.2",
2
+ "version": "3.12.1",
3
3
  "commands": {
4
4
  "channel:promote": {
5
5
  "id": "channel:promote",
@@ -501,6 +501,49 @@
501
501
  },
502
502
  "args": {}
503
503
  },
504
+ "cli:artifacts:compare": {
505
+ "id": "cli:artifacts:compare",
506
+ "summary": "Look for breaking changes in artifacts (schemas and snapshots) from plugins. Must be run in CLI directory.",
507
+ "strict": true,
508
+ "pluginName": "@salesforce/plugin-release-management",
509
+ "pluginAlias": "@salesforce/plugin-release-management",
510
+ "pluginType": "core",
511
+ "aliases": [],
512
+ "examples": [
513
+ "<%= config.bin %> <%= command.id %>"
514
+ ],
515
+ "flags": {
516
+ "json": {
517
+ "name": "json",
518
+ "type": "boolean",
519
+ "description": "Format output as json.",
520
+ "helpGroup": "GLOBAL",
521
+ "allowNo": false
522
+ },
523
+ "plugin": {
524
+ "name": "plugin",
525
+ "type": "option",
526
+ "char": "p",
527
+ "summary": "List of plugins to check for breaking changes.",
528
+ "multiple": true
529
+ },
530
+ "previous": {
531
+ "name": "previous",
532
+ "type": "option",
533
+ "char": "r",
534
+ "summary": "Previous CLI version to compare against. Defaults to the last published version.",
535
+ "multiple": false
536
+ },
537
+ "current": {
538
+ "name": "current",
539
+ "type": "option",
540
+ "char": "c",
541
+ "summary": "Current CLI version to compare against. Defaults to the version on the CLI in the current directory.",
542
+ "multiple": false
543
+ }
544
+ },
545
+ "args": {}
546
+ },
504
547
  "cli:install:test": {
505
548
  "id": "cli:install:test",
506
549
  "summary": "install sf or sfdx",
@@ -946,6 +989,45 @@
946
989
  },
947
990
  "args": {}
948
991
  },
992
+ "github:check:closed": {
993
+ "id": "github:check:closed",
994
+ "summary": "Show open Github issues with GUS WI",
995
+ "description": "Description of a command.",
996
+ "strict": true,
997
+ "pluginName": "@salesforce/plugin-release-management",
998
+ "pluginAlias": "@salesforce/plugin-release-management",
999
+ "pluginType": "core",
1000
+ "aliases": [],
1001
+ "examples": [
1002
+ "<%= config.bin %> <%= command.id %> -o me@gus.com"
1003
+ ],
1004
+ "flags": {
1005
+ "json": {
1006
+ "name": "json",
1007
+ "type": "boolean",
1008
+ "description": "Format output as json.",
1009
+ "helpGroup": "GLOBAL",
1010
+ "allowNo": false
1011
+ },
1012
+ "gus": {
1013
+ "name": "gus",
1014
+ "type": "option",
1015
+ "char": "o",
1016
+ "summary": "Username/alias of your GUS org connection",
1017
+ "required": true,
1018
+ "multiple": false
1019
+ },
1020
+ "github-token": {
1021
+ "name": "github-token",
1022
+ "type": "option",
1023
+ "summary": "Github token--store this in the environment as GITHUB_TOKEN",
1024
+ "required": true,
1025
+ "multiple": false
1026
+ }
1027
+ },
1028
+ "args": {},
1029
+ "hasDynamicHelp": true
1030
+ },
949
1031
  "npm:dependencies:pin": {
950
1032
  "id": "npm:dependencies:pin",
951
1033
  "summary": "lock a list of dependencies to a target tag or default to 'latest', place these entries in 'pinnedDependencies' entry in the package.json",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-release-management",
3
3
  "description": "A plugin for preparing and publishing npm packages",
4
- "version": "3.11.2",
4
+ "version": "3.12.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "bin": {
@@ -10,10 +10,12 @@
10
10
  "dependencies": {
11
11
  "@oclif/core": "^2.0.9",
12
12
  "@octokit/core": "^4.1.0",
13
+ "@octokit/plugin-paginate-rest": "^6.0.0",
14
+ "@octokit/plugin-throttling": "^5.0.1",
13
15
  "@salesforce/core": "^3.32.12",
14
16
  "@salesforce/kit": "^1.8.2",
15
- "@salesforce/plugin-command-reference": "^2.2.8",
16
- "@salesforce/plugin-trust": "^2.2.3",
17
+ "@salesforce/plugin-command-reference": "^2.3.1",
18
+ "@salesforce/plugin-trust": "^2.4.1",
17
19
  "@salesforce/sf-plugins-core": "^2.0.1",
18
20
  "@salesforce/ts-types": "^1.7.3",
19
21
  "agent-base": "^6.0.2",
@@ -24,6 +26,7 @@
24
26
  "conventional-commits-parser": "^3.2.2",
25
27
  "fast-glob": "^3.2.12",
26
28
  "got": "^11.8.6",
29
+ "just-diff": "^5.2.0",
27
30
  "proxy-agent": "^5.0.0",
28
31
  "proxy-from-env": "^1.1.0",
29
32
  "semver": "^7.3.8",
@@ -44,7 +47,7 @@
44
47
  "@types/semver": "^7.3.9",
45
48
  "@types/shelljs": "^0.8.8",
46
49
  "@typescript-eslint/eslint-plugin": "^5.40.1",
47
- "@typescript-eslint/parser": "^5.49.0",
50
+ "@typescript-eslint/parser": "^5.52.0",
48
51
  "aws-sdk-mock": "^5.8.0",
49
52
  "chai": "^4.3.7",
50
53
  "eslint": "^8.31.0",
@@ -117,23 +120,26 @@
117
120
  },
118
121
  "schemas": {
119
122
  "description": "utilities for comparing command schemas"
123
+ },
124
+ "artifacts": {
125
+ "description": "utilities for comparing plugin artifacts"
120
126
  }
121
127
  }
122
128
  },
123
129
  "channel": {
124
130
  "description": "interact with aws channels for clis"
125
131
  },
126
- "circleci": {
127
- "description": "interact with circleci api",
128
- "subtopics": {
129
- "envvar": {
130
- "description": "update and set environment variables in circleci"
131
- }
132
- }
133
- },
134
132
  "dependabot": {
135
133
  "description": "interact with dependabot PRs"
136
134
  },
135
+ "github": {
136
+ "subtopics": {
137
+ "check": {
138
+ "description": "check github status"
139
+ }
140
+ },
141
+ "description": "interact with github issues"
142
+ },
137
143
  "npm": {
138
144
  "description": "release npm packages",
139
145
  "subtopics": {
@@ -276,7 +282,7 @@
276
282
  }
277
283
  },
278
284
  "sfdx": {
279
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/3.11.2.crt",
280
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/3.11.2.sig"
285
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/3.12.1.crt",
286
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-release-management/3.12.1.sig"
281
287
  }
282
288
  }