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

Conversation

cristiand391
Copy link
Member

@cristiand391 cristiand391 commented Sep 22, 2022

What does this PR do?

Fix scratch org create code that deploys settings not respecting the apiVersion config value by correctly instantiating the ConfigAggregator class.

Before:
even having apiVersion set locally/globally, the code always gets undefined.

After:
code respects config value.

QA:
see gh issue linked below for debug env var val

this code is used by sfdx force:org:create and sf env create scratch/sf env resume scratch.
make sure the following config values/env vars are respected:

config values:
org-api-version
apiVersion

env vars:
SFDX_API_VERSION
SF_ORG_API_VERSION

What issues does this PR fix or reference?

forcedotcom/cli#1719
@W-11798656@

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the rest of the repo for other uses of .getPropertyValue('apiVersion') and this was the only one.

@peternhale
Copy link
Contributor

Testing notes:

 sfdx config:set apiVersion=47.0 --global
=== Set Config
 
 Name       Value Success 
 ────────── ───── ─────── 
 apiVersion 47.0  true    

Before

DEBUG=sf:deploySettingsViaFolder sfdx force:org:create -s -f config/project-scratch-def.json -a foo -v na40 -w 30
WARNING: apiVersion configuration overridden at "47.0"
  sf:deploySettingsViaFolder DEBUG deploying to apiVersion: 55.0 +0ms
  sf:deploySettingsViaFolder DEBUG deploying settings id 0Af8H000007ahD6SAI +501ms
  sf:deploySettingsViaFolder DEBUG Deploy id: 0Af8H000007ahD6SAI status: InProgress +1s
  sf:deploySettingsViaFolder DEBUG Deploy id: 0Af8H000007ahD6SAI status: Succeeded +2s
Successfully created scratch org: 00D......., username: [email protected].

After

DEBUG=sf:deploySettingsViaFolder sfdx force:org:create -s -f config/project-scratch-def.json -a foo -v na40 -w 30
WARNING: apiVersion configuration overridden at "47.0"
(node:73903) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
  sf:deploySettingsViaFolder DEBUG deploying to apiVersion: 47.0 +0ms
  sf:deploySettingsViaFolder DEBUG deploying settings id 0Af8F000009m8V8SAI +520ms
  sf:deploySettingsViaFolder DEBUG Deploy id: 0Af8F000009m8V8SAI status: InProgress +1s
  sf:deploySettingsViaFolder DEBUG Deploy id: 0Af8F000009m8V8SAI status: Succeeded +2s
Successfully created scratch org: 00D8..................., username: [email protected].

@peternhale peternhale merged commit 1a29482 into main Sep 23, 2022
@peternhale peternhale deleted the cd/scratch-settings-api-version branch September 23, 2022 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants