@simplysf/simply-cicd 0.6.0 → 0.7.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/README.md +82 -89
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.d.ts +1 -5
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +2 -5
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js.map +1 -1
- package/lib/commands/simply/cicd/build/create-scratch.d.ts +1 -5
- package/lib/commands/simply/cicd/build/create-scratch.js +2 -6
- package/lib/commands/simply/cicd/build/create-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/delete-scratch.d.ts +2 -5
- package/lib/commands/simply/cicd/build/delete-scratch.js +4 -6
- package/lib/commands/simply/cicd/build/delete-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/install-dependencies.d.ts +1 -1
- package/lib/commands/simply/cicd/build/install-dependencies.js +2 -2
- package/lib/commands/simply/cicd/build/install-dependencies.js.map +1 -1
- package/lib/commands/simply/cicd/build/push-scratch.d.ts +1 -1
- package/lib/commands/simply/cicd/build/push-scratch.js +2 -2
- package/lib/commands/simply/cicd/build/push-scratch.js.map +1 -1
- package/lib/commands/simply/cicd/build/test-scratch.d.ts +1 -1
- package/lib/commands/simply/cicd/build/test-scratch.js +2 -2
- package/lib/commands/simply/cicd/build/test-scratch.js.map +1 -1
- package/lib/common/build/cleanupScratchOrgs.d.ts +6 -7
- package/lib/common/build/cleanupScratchOrgs.js +10 -10
- package/lib/common/build/cleanupScratchOrgs.js.map +1 -1
- package/lib/common/build/createScratchOrg.d.ts +3 -3
- package/lib/common/build/createScratchOrg.js +11 -12
- package/lib/common/build/createScratchOrg.js.map +1 -1
- package/lib/common/build/deleteScratchOrg.d.ts +6 -5
- package/lib/common/build/deleteScratchOrg.js +23 -19
- package/lib/common/build/deleteScratchOrg.js.map +1 -1
- package/lib/common/build/devHubs.d.ts +9 -5
- package/lib/common/build/devHubs.js +25 -13
- package/lib/common/build/devHubs.js.map +1 -1
- package/lib/common/build/flags.d.ts +18 -5
- package/lib/common/build/flags.js +23 -16
- package/lib/common/build/flags.js.map +1 -1
- package/lib/common/build/installDependencies.d.ts +2 -1
- package/lib/common/build/installDependencies.js +2 -5
- package/lib/common/build/installDependencies.js.map +1 -1
- package/lib/common/build/pushScratch.d.ts +2 -1
- package/lib/common/build/pushScratch.js +2 -5
- package/lib/common/build/pushScratch.js.map +1 -1
- package/lib/common/build/scratchOrgAuth.d.ts +18 -0
- package/lib/common/build/scratchOrgAuth.js +52 -0
- package/lib/common/build/scratchOrgAuth.js.map +1 -0
- package/lib/common/build/scratchOrgInfo.d.ts +4 -0
- package/lib/common/build/scratchOrgInfo.js.map +1 -1
- package/lib/common/build/testScratch.d.ts +2 -1
- package/lib/common/build/testScratch.js +2 -5
- package/lib/common/build/testScratch.js.map +1 -1
- package/lib/common/sfAuth.d.ts +0 -11
- package/lib/common/sfAuth.js +0 -21
- package/lib/common/sfAuth.js.map +1 -1
- package/messages/simply.cicd.build.cleanup-scratch-orgs.md +2 -2
- package/messages/simply.cicd.build.create-scratch.md +2 -2
- package/messages/simply.cicd.build.delete-scratch.md +2 -2
- package/messages/simply.cicd.build.md +3 -15
- package/package.json +3 -3
|
@@ -18,26 +18,22 @@ import { Flags } from '@salesforce/sf-plugins-core';
|
|
|
18
18
|
import { listVcsProviderKinds } from '../vcs/index.js';
|
|
19
19
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
20
|
const messages = Messages.loadMessages('@simplysf/simply-cicd', 'simply.cicd.build');
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Flags shared by every build command that operates against one or more Dev Hubs. `simply-cicd`
|
|
23
|
+
* never authenticates Dev Hubs itself — each alias must already be authenticated (by the calling
|
|
24
|
+
* pipeline, however it chooses to do that) before the command runs.
|
|
25
|
+
*/
|
|
22
26
|
export const devHubFlags = {
|
|
23
|
-
'dev-hub
|
|
24
|
-
summary: messages.getMessage('flags.dev-hub
|
|
25
|
-
multiple: true,
|
|
26
|
-
required: true,
|
|
27
|
-
}),
|
|
28
|
-
'dev-hub-username': Flags.string({
|
|
29
|
-
summary: messages.getMessage('flags.dev-hub-username.summary'),
|
|
27
|
+
'dev-hub': Flags.string({
|
|
28
|
+
summary: messages.getMessage('flags.dev-hub.summary'),
|
|
30
29
|
multiple: true,
|
|
31
30
|
required: true,
|
|
32
31
|
}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'dev-hub-instance-url': Flags.string({
|
|
39
|
-
summary: messages.getMessage('flags.dev-hub-instance-url.summary'),
|
|
40
|
-
multiple: true,
|
|
32
|
+
};
|
|
33
|
+
/** Single-Dev-Hub variant of {@link devHubFlags}, for commands (like `delete-scratch`) that only ever target one. */
|
|
34
|
+
export const devHubFlag = {
|
|
35
|
+
'dev-hub': Flags.string({
|
|
36
|
+
summary: messages.getMessage('flags.dev-hub.summary'),
|
|
41
37
|
required: true,
|
|
42
38
|
}),
|
|
43
39
|
};
|
|
@@ -48,6 +44,17 @@ export const jwtKeyFileFlag = {
|
|
|
48
44
|
env: 'SIMPLY_CICD_JWT_KEY_FILE',
|
|
49
45
|
}),
|
|
50
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Variant of {@link jwtKeyFileFlag} for scratch-org commands that only need it conditionally — a
|
|
49
|
+
* scratch org whose Dev Hub wasn't JWT-authenticated re-authenticates via its own refresh token
|
|
50
|
+
* instead, so no key file is required in that case.
|
|
51
|
+
*/
|
|
52
|
+
export const optionalJwtKeyFileFlag = {
|
|
53
|
+
'jwt-key-file': Flags.string({
|
|
54
|
+
summary: messages.getMessage('flags.jwt-key-file.summary'),
|
|
55
|
+
env: 'SIMPLY_CICD_JWT_KEY_FILE',
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
51
58
|
export const debugFlag = {
|
|
52
59
|
debug: Flags.boolean({
|
|
53
60
|
summary: messages.getMessage('flags.debug.summary'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/common/build/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAwB,MAAM,iBAAiB,CAAC;AAE7E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;AAErF
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/common/build/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAwB,MAAM,iBAAiB,CAAC;AAE7E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;AAErF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;QACtB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACrD,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;AAEF,qHAAqH;AACrH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;QACtB,OAAO,EAAE,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
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { logger } from '../logger.js';
|
|
17
|
-
import { authenticateOrg } from '../sfAuth.js';
|
|
18
17
|
import { installPackageDependencies as installPackageDependenciesCommon } from '../sfPackages.js';
|
|
18
|
+
import { ensureScratchOrgSession } from './scratchOrgAuth.js';
|
|
19
19
|
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
20
20
|
/** Authenticates to the scratch org (recorded in `SCRATCH_ORG_INFO.json`) and installs its packaged dependencies. */
|
|
21
21
|
export async function installDependencies(options) {
|
|
22
22
|
logger.info('Installing package dependencies into scratch org...');
|
|
23
23
|
const scratchOrgInfo = await readScratchOrgInfo();
|
|
24
|
-
await
|
|
25
|
-
username: scratchOrgInfo.authFields.username,
|
|
26
|
-
clientId: scratchOrgInfo.authFields.clientId,
|
|
27
|
-
instanceUrl: scratchOrgInfo.authFields.instanceUrl,
|
|
24
|
+
await ensureScratchOrgSession(scratchOrgInfo.authFields, {
|
|
28
25
|
jwtKeyFile: options.jwtKeyFile,
|
|
29
26
|
setDefault: true,
|
|
30
27
|
debug: options.debug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installDependencies.js","sourceRoot":"","sources":["../../../src/common/build/installDependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"installDependencies.js","sourceRoot":"","sources":["../../../src/common/build/installDependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,0BAA0B,IAAI,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,qHAAqH;AACrH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAmC;IAC3E,MAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;IACnE,MAAM,cAAc,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAClD,MAAM,uBAAuB,CAAC,cAAc,CAAC,UAAU,EAAE;QACvD,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IACH,mDAAmD;IACnD,MAAM,gCAAgC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1F,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -17,7 +17,7 @@ import { execa } from 'execa';
|
|
|
17
17
|
import { getDefaultPackageDirectory, readSfdxProject } from '@simplysf/simply-core';
|
|
18
18
|
import { runSf } from '../exec/sfCli.js';
|
|
19
19
|
import { logger } from '../logger.js';
|
|
20
|
-
import {
|
|
20
|
+
import { ensureScratchOrgSession } from './scratchOrgAuth.js';
|
|
21
21
|
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
22
22
|
const INCOMPATIBLE_METADATA_PATTERNS = [
|
|
23
23
|
'*.eca-meta.xml',
|
|
@@ -37,10 +37,7 @@ async function removeIncompatibleMetadata() {
|
|
|
37
37
|
export async function pushToScratch(options) {
|
|
38
38
|
logger.info('Pushing source to scratch org...');
|
|
39
39
|
const scratchOrgInfo = await readScratchOrgInfo();
|
|
40
|
-
await
|
|
41
|
-
username: scratchOrgInfo.authFields.username,
|
|
42
|
-
clientId: scratchOrgInfo.authFields.clientId,
|
|
43
|
-
instanceUrl: scratchOrgInfo.authFields.instanceUrl,
|
|
40
|
+
await ensureScratchOrgSession(scratchOrgInfo.authFields, {
|
|
44
41
|
jwtKeyFile: options.jwtKeyFile,
|
|
45
42
|
setDefault: true,
|
|
46
43
|
debug: options.debug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pushScratch.js","sourceRoot":"","sources":["../../../src/common/build/pushScratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pushScratch.js","sourceRoot":"","sources":["../../../src/common/build/pushScratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,8BAA8B,GAAG;IACrC,gBAAgB;IAChB,yBAAyB;IACzB,qBAAqB;IACrB,yBAAyB;IACzB,oBAAoB;CACrB,CAAC;AAEF,KAAK,UAAU,0BAA0B;IACvC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC7D,KAAK,MAAM,OAAO,IAAI,8BAA8B,EAAE,CAAC;QACrD,mGAAmG;QACnG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CA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JWT-authenticated (no refresh token available). */
|
|
4
|
+
jwtKeyFile?: string;
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
setDefault?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Ensures the scratch org recorded in `SCRATCH_ORG_INFO.json` has a live session, using whichever
|
|
10
|
+
* renewable credential it actually has.
|
|
11
|
+
*
|
|
12
|
+
* A scratch org whose Dev Hub authenticated via web/SFDX auth-url gets its own `refreshToken` at
|
|
13
|
+
* creation time (Salesforce's OAuth "web server" flow always returns one) — that's used directly
|
|
14
|
+
* via `@salesforce/core`, no shell-out. A JWT-authenticated Dev Hub never produces a refresh token
|
|
15
|
+
* (JWT bearer grants don't have one), so that case still falls back to the existing
|
|
16
|
+
* `authenticateOrg()` JWT re-auth.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ensureScratchOrgSession(authFields: ScratchOrgInfo['authFields'], options: EnsureScratchOrgSessionOptions): Promise<void>;
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
import { AuthInfo, SfError } from '@salesforce/core';
|
|
17
|
+
import { authenticateOrg } from '../sfAuth.js';
|
|
18
|
+
/**
|
|
19
|
+
* Ensures the scratch org recorded in `SCRATCH_ORG_INFO.json` has a live session, using whichever
|
|
20
|
+
* renewable credential it actually has.
|
|
21
|
+
*
|
|
22
|
+
* A scratch org whose Dev Hub authenticated via web/SFDX auth-url gets its own `refreshToken` at
|
|
23
|
+
* creation time (Salesforce's OAuth "web server" flow always returns one) — that's used directly
|
|
24
|
+
* via `@salesforce/core`, no shell-out. A JWT-authenticated Dev Hub never produces a refresh token
|
|
25
|
+
* (JWT bearer grants don't have one), so that case still falls back to the existing
|
|
26
|
+
* `authenticateOrg()` JWT re-auth.
|
|
27
|
+
*/
|
|
28
|
+
export async function ensureScratchOrgSession(authFields, options) {
|
|
29
|
+
const { username, clientId, instanceUrl, refreshToken, clientSecret } = authFields;
|
|
30
|
+
if (refreshToken) {
|
|
31
|
+
const authInfo = await AuthInfo.create({
|
|
32
|
+
oauth2Options: { clientId, clientSecret, refreshToken, loginUrl: instanceUrl },
|
|
33
|
+
});
|
|
34
|
+
await authInfo.save();
|
|
35
|
+
if (options.setDefault) {
|
|
36
|
+
await authInfo.handleAliasAndDefaultSettings({ setDefault: true, setDefaultDevHub: false });
|
|
37
|
+
}
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!options.jwtKeyFile) {
|
|
41
|
+
throw new SfError(`No refresh token available for org ${username} and no --jwt-key-file was provided; cannot re-authenticate.`, 'ScratchOrgReauthError');
|
|
42
|
+
}
|
|
43
|
+
await authenticateOrg({
|
|
44
|
+
username,
|
|
45
|
+
clientId,
|
|
46
|
+
instanceUrl,
|
|
47
|
+
jwtKeyFile: options.jwtKeyFile,
|
|
48
|
+
setDefault: options.setDefault,
|
|
49
|
+
debug: options.debug,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=scratchOrgAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scratchOrgAuth.js","sourceRoot":"","sources":["../../../src/common/build/scratchOrgAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAU/C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,UAAwC,EACxC,OAAuC;IAEvC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;IAEnF,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YACrC,aAAa,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE;SAC/E,CAAC,CAAC;QACH,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,QAAQ,CAAC,6BAA6B,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO;IACT,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,OAAO,CACf,sCAAsC,QAAQ,8DAA8D,EAC5G,uBAAuB,CACxB,CAAC;IACJ,CAAC;IAED,MAAM,eAAe,CAAC;QACpB,QAAQ;QACR,QAAQ;QACR,WAAW;QACX,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -4,6 +4,10 @@ export type ScratchOrgInfo = {
|
|
|
4
4
|
clientId: string;
|
|
5
5
|
instanceUrl: string;
|
|
6
6
|
devHubUsername?: string;
|
|
7
|
+
/** Present when the owning Dev Hub wasn't JWT-authenticated. */
|
|
8
|
+
refreshToken?: string;
|
|
9
|
+
/** Present alongside `refreshToken` for a custom connected app. */
|
|
10
|
+
clientSecret?: string;
|
|
7
11
|
};
|
|
8
12
|
};
|
|
9
13
|
/** Reads and parses `SCRATCH_ORG_INFO.json` (written by `build create-scratch`) from the current directory. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scratchOrgInfo.js","sourceRoot":"","sources":["../../../src/common/build/scratchOrgInfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"scratchOrgInfo.js","sourceRoot":"","sources":["../../../src/common/build/scratchOrgInfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AAezC,+GAA+G;AAC/G,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAmB,CAAC;AAC3F,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type RunScratchApexTestsOptions = {
|
|
2
|
-
|
|
2
|
+
/** Required only when the scratch org's Dev Hub was JWT-authenticated (no refresh token available). */
|
|
3
|
+
jwtKeyFile?: string;
|
|
3
4
|
debug?: boolean;
|
|
4
5
|
/** Skips just the Apex test run, independent of the job-level --disabled flag. */
|
|
5
6
|
disableApexTests?: boolean;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { logger } from '../logger.js';
|
|
17
|
-
import { authenticateOrg } from '../sfAuth.js';
|
|
18
17
|
import { runApexTests as runApexTestsCommon } from '../sfApex.js';
|
|
18
|
+
import { ensureScratchOrgSession } from './scratchOrgAuth.js';
|
|
19
19
|
import { readScratchOrgInfo } from './scratchOrgInfo.js';
|
|
20
20
|
/**
|
|
21
21
|
* Authenticates to the scratch org and runs its Apex tests.
|
|
@@ -31,10 +31,7 @@ export async function runScratchApexTests(options) {
|
|
|
31
31
|
}
|
|
32
32
|
logger.info('Authenticating to scratch org for tests...');
|
|
33
33
|
const scratchOrgInfo = await readScratchOrgInfo();
|
|
34
|
-
await
|
|
35
|
-
username: scratchOrgInfo.authFields.username,
|
|
36
|
-
clientId: scratchOrgInfo.authFields.clientId,
|
|
37
|
-
instanceUrl: scratchOrgInfo.authFields.instanceUrl,
|
|
34
|
+
await ensureScratchOrgSession(scratchOrgInfo.authFields, {
|
|
38
35
|
jwtKeyFile: options.jwtKeyFile,
|
|
39
36
|
setDefault: true,
|
|
40
37
|
debug: options.debug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testScratch.js","sourceRoot":"","sources":["../../../src/common/build/testScratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"testScratch.js","sourceRoot":"","sources":["../../../src/common/build/testScratch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAUzD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAmC;IAC3E,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QAC3E,OAAO;IACT,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAClD,MAAM,uBAAuB,CAAC,cAAc,CAAC,UAAU,EAAE;QACvD,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,mDAAmD;IACnD,MAAM,kBAAkB,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
package/lib/common/sfAuth.d.ts
CHANGED
|
@@ -17,14 +17,3 @@ export type AuthenticateOrgResult = {
|
|
|
17
17
|
};
|
|
18
18
|
/** Authenticates to a Salesforce organization using either a JWT flow or an SFDX auth URL. */
|
|
19
19
|
export declare function authenticateOrg(options: AuthenticateOrgOptions): Promise<AuthenticateOrgResult>;
|
|
20
|
-
export type DevHubConfig = {
|
|
21
|
-
username?: string;
|
|
22
|
-
clientId?: string;
|
|
23
|
-
instanceUrl?: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Authenticates multiple Dev Hub organizations in parallel using the JWT flow. Only attempts
|
|
27
|
-
* authentication for Dev Hubs that have `username`, `clientId`, and `instanceUrl` provided.
|
|
28
|
-
* Returns the usernames of the Dev Hubs that authenticated successfully.
|
|
29
|
-
*/
|
|
30
|
-
export declare function authenticateDevHubs(devHubs: DevHubConfig[], jwtKeyFile: string, debug?: boolean): Promise<string[]>;
|
package/lib/common/sfAuth.js
CHANGED
|
@@ -75,25 +75,4 @@ export async function authenticateOrg(options) {
|
|
|
75
75
|
throw error; // Re-throw for build steps that should fail hard.
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Authenticates multiple Dev Hub organizations in parallel using the JWT flow. Only attempts
|
|
80
|
-
* authentication for Dev Hubs that have `username`, `clientId`, and `instanceUrl` provided.
|
|
81
|
-
* Returns the usernames of the Dev Hubs that authenticated successfully.
|
|
82
|
-
*/
|
|
83
|
-
export async function authenticateDevHubs(devHubs, jwtKeyFile, debug) {
|
|
84
|
-
const authPromises = devHubs.map((hub) => {
|
|
85
|
-
if (hub.username && hub.clientId && hub.instanceUrl) {
|
|
86
|
-
return authenticateOrg({
|
|
87
|
-
username: hub.username,
|
|
88
|
-
clientId: hub.clientId,
|
|
89
|
-
instanceUrl: hub.instanceUrl,
|
|
90
|
-
jwtKeyFile,
|
|
91
|
-
debug,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return Promise.resolve(undefined);
|
|
95
|
-
});
|
|
96
|
-
const results = await Promise.all(authPromises);
|
|
97
|
-
return results.filter((r) => Boolean(r?.success)).map((r) => r.username);
|
|
98
|
-
}
|
|
99
78
|
//# sourceMappingURL=sfAuth.js.map
|
package/lib/common/sfAuth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sfAuth.js","sourceRoot":"","sources":["../../src/common/sfAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuBrC,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAA+B;IACnE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IACrH,MAAM,UAAU,GAAG,KAAK,IAAI,QAAQ,IAAI,aAAa,CAAC;IACtD,MAAM,CAAC,IAAI,CAAC,0BAA0B,UAAU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AC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAiB,CAAC;QACtD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,6BAA6B,UAAU,KAAK,UAAU,CAAC,OAAO,IAAI,eAAe,EAAE,CAAC,CAAC;YAClG,uDAAuD;YACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QACnE,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,sCAAsC,UAAU,EAAE,CAAC,CAAC;QACnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,6BAA6B,UAAU,EAAE,CAAC,CAAC;QACxD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5B,MAAM,KAAK,CAAC,CAAC,kDAAkD;IACjE,CAAC;AACH,CAAC"}
|
|
@@ -4,8 +4,8 @@ Delete scratch orgs older than 3 hours from every configured Dev Hub.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
For each Dev Hub, queries `ActiveScratchOrg` records created more than 3 hours ago and bulk-deletes them. Useful for keeping a shared Dev Hub's scratch org allotment from being exhausted by abandoned CI runs.
|
|
7
|
+
For each Dev Hub, queries `ActiveScratchOrg` records created more than 3 hours ago and bulk-deletes them. Useful for keeping a shared Dev Hub's scratch org allotment from being exhausted by abandoned CI runs. Every `--dev-hub` alias must already be authenticated.
|
|
8
8
|
|
|
9
9
|
# examples
|
|
10
10
|
|
|
11
|
-
- <%= config.bin %> <%= command.id %> --dev-hub
|
|
11
|
+
- <%= config.bin %> <%= command.id %> --dev-hub my-devhub
|
|
@@ -4,7 +4,7 @@ Create a scratch org, trying each configured Dev Hub in order.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Reads the default package directory's `definitionFile` from `sfdx-project.json` (falling back to `--scratch-definition-file`), and attempts creation against each `--dev-hub
|
|
7
|
+
Reads the default package directory's `definitionFile` from `sfdx-project.json` (falling back to `--scratch-definition-file`), and attempts creation against each `--dev-hub` alias in order (each must already be authenticated). A Dev Hub that has hit its daily scratch org limit is skipped in favor of the next one. Writes the resulting org's auth fields to `SCRATCH_ORG_INFO.json` for later build steps, best-effort sets a default `CountryCode`, and assigns any permission sets/licenses declared under the default package directory's `packageMetadataAccess`.
|
|
8
8
|
|
|
9
9
|
Skipped automatically when `PACKAGE_CHANGED=FALSE` is set in the environment (see `build determine-package-changes`).
|
|
10
10
|
|
|
@@ -18,4 +18,4 @@ Duration of the scratch org in days.
|
|
|
18
18
|
|
|
19
19
|
# examples
|
|
20
20
|
|
|
21
|
-
- <%= config.bin %> <%= command.id %> --dev-hub
|
|
21
|
+
- <%= config.bin %> <%= command.id %> --dev-hub my-devhub
|
|
@@ -4,10 +4,10 @@ Delete the scratch org created by `build create-scratch`.
|
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Reads `SCRATCH_ORG_INFO.json` (written by `build create-scratch`) to
|
|
7
|
+
Reads `SCRATCH_ORG_INFO.json` (written by `build create-scratch`) to confirm `--dev-hub` is the Dev Hub that owns the scratch org, re-authenticates to it and the scratch org as needed, and deletes it. Deletion failures are logged rather than thrown, since a scratch org left behind after a failed deletion just needs manual cleanup and shouldn't fail an otherwise-successful pipeline run.
|
|
8
8
|
|
|
9
9
|
Skipped automatically when `PACKAGE_CHANGED=FALSE` is set in the environment (see `build determine-package-changes`).
|
|
10
10
|
|
|
11
11
|
# examples
|
|
12
12
|
|
|
13
|
-
- <%= config.bin %> <%= command.id %> --dev-hub
|
|
13
|
+
- <%= config.bin %> <%= command.id %> --dev-hub my-devhub
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
# flags.dev-hub
|
|
1
|
+
# flags.dev-hub.summary
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# flags.dev-hub-username.summary
|
|
6
|
-
|
|
7
|
-
Username of a Dev Hub.
|
|
8
|
-
|
|
9
|
-
# flags.dev-hub-client-id.summary
|
|
10
|
-
|
|
11
|
-
Connected app client ID for a Dev Hub.
|
|
12
|
-
|
|
13
|
-
# flags.dev-hub-instance-url.summary
|
|
14
|
-
|
|
15
|
-
Login instance URL for a Dev Hub.
|
|
3
|
+
Alias of a Dev Hub. Must already be authenticated. Repeat this flag for each Dev Hub to try, in order.
|
|
16
4
|
|
|
17
5
|
# flags.jwt-key-file.summary
|
|
18
6
|
|
|
19
|
-
Path to the JWT private key file used
|
|
7
|
+
Path to the JWT private key file used to re-authenticate the scratch org (or its Dev Hub) when it was JWT-authenticated. Not needed when the Dev Hub was authenticated via web login or an SFDX auth URL — the scratch org's own refresh token is used instead.
|
|
20
8
|
|
|
21
9
|
# flags.debug.summary
|
|
22
10
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-cicd",
|
|
3
3
|
"description": "Commands for Salesforce CI/CD pipelines",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply-node",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply-node/issues",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@salesforce/core": "^8.30.0",
|
|
61
61
|
"@salesforce/sf-plugins-core": "^12.2.16",
|
|
62
62
|
"@salesforce/ts-types": "^2.0.12",
|
|
63
|
-
"@simplysf/simply-core": "^1.
|
|
63
|
+
"@simplysf/simply-core": "^1.2.0",
|
|
64
64
|
"chalk": "^5.6.2",
|
|
65
65
|
"execa": "^8.0.1",
|
|
66
66
|
"handlebars": "^4.7.9",
|
|
@@ -211,5 +211,5 @@
|
|
|
211
211
|
"output": []
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
|
-
"gitHead": "
|
|
214
|
+
"gitHead": "fea4f3caad439a7695d9259d83db85c8558767e0"
|
|
215
215
|
}
|