Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scratch): respect apiVersion config value #656

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/org/scratchOrgCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ensureString } from '@salesforce/ts-types';
import { Messages } from '../messages';
import { Logger } from '../logger';
import { ConfigAggregator } from '../config/configAggregator';
import { OrgConfigProperties } from '../org/orgConfigProperties';
import { SfProject } from '../sfProject';
import { StateAggregator } from '../stateAggregator';
import { Org } from './org';
Expand Down Expand Up @@ -152,6 +153,8 @@ export const scratchOrgResume = async (jobId: string): Promise<ScratchOrgCreateR

const scratchOrg = await Org.create({ aliasOrUsername: username });

const configAggregator = await ConfigAggregator.create();

await emit({ stage: 'deploy settings', scratchOrgInfo: soi });
const settingsGenerator = new SettingsGenerator();
settingsGenerator.extract({ ...soi, ...definitionjson });
Expand All @@ -161,7 +164,7 @@ export const scratchOrgResume = async (jobId: string): Promise<ScratchOrgCreateR
scratchOrg,
settingsGenerator,
apiVersion ??
(new ConfigAggregator().getPropertyValue('apiVersion') as string) ??
configAggregator.getPropertyValue(OrgConfigProperties.ORG_API_VERSION) ??
(await scratchOrg.retrieveMaxApiVersion())
),
]);
Expand Down Expand Up @@ -283,13 +286,15 @@ export const scratchOrgCreate = async (options: ScratchOrgCreateOptions): Promis

await emit({ stage: 'deploy settings', scratchOrgInfo: soi });

const configAggregator = await ConfigAggregator.create();

const [authInfo] = await Promise.all([
resolveUrl(scratchOrgAuthInfo),
deploySettings(
scratchOrg,
settingsGenerator,
apiversion ??
(new ConfigAggregator().getPropertyValue('org-api-version') as string) ??
configAggregator.getPropertyValue(OrgConfigProperties.ORG_API_VERSION) ??
(await scratchOrg.retrieveMaxApiVersion())
),
]);
Expand Down