-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat(scratch): add org-capitalize-record-types
#1020
Conversation
# noCapitalizeRecordTypeConfigVar | ||
|
||
Record types defined in the scratch org definition file will stop being capitalized by default in a future release. | ||
Set the `org-capitalize-record-types` config var to `true` to enforce capitalization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this warning will be visible to both projects using sfdx-core and the CLI.
For lib users, I wanted to make this an object option rather than the config (that way the config var would live in plugin-org) but decided against it (more about that below).
|
||
async function getCapitalizeRecordTypesConfig(): Promise<boolean | undefined> { | ||
const configAgg = await ConfigAggregator.create(); | ||
const value = configAgg.getInfo('org-capitalize-record-types').value as string | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type of value
is AnyJson | undefined
, at runtime we have 2 possible options:
- a string containing
true
orfalse
. NOTE this is always a string, not a boolean
2undefined
if it's undefined
then we want to return that so SettingsGenerator
knows there's no config var and emits the warning.
if not undefined we cast it to boolean
and return it.
businessProcessName = upperFirst(defaultRecordType) + 'Process'; | ||
businessProcessName = capitalizeBusinessProcess | ||
? `${upperFirst(defaultRecordType)}Process` | ||
: `${defaultRecordType}Process`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wasn't in the scope of the inv. we got but it's the same behavior (for the listed 4 objects above) so I made this follow the config var too.
QA: |
What does this PR do?
Adds a new
org-capitalize-record-types
config var to allow to users to choose whether to capitalize record types defined in a scratch org definition file when creating the org.If the config var isn't set it will still capitalize record types but will emit a warning for users to set the config var to true (we'll stop capitalization in a next major release of sfdx-core, will sync with CLI deprecation policy).
Testing
Expected behaviour:
also, try making
org create scratch
timeout when org is ready but before it deploy settings to confirmsf org resume scratch
also respects the config var.Setup
yarn link
it intoplugin-org
andplugin-settings
Turn off record type capitalization
sf config set org-capitalize-record-types=false -g
sf org create scratch -d -f config/project-scratch-def.json -a dreamhouse --duration-days 1
svc_Technical_Support
record type isn't capitalized:UI
sf org open --path lightning/setup/ObjectManager/Case/RecordTypes/view
:CLI
sf sobject describe --sobject Case --json | jq '.result.recordTypeInfos'
NUTs
There are some NUTs in plugin-org:
salesforcecli/plugin-org#935
a few try to run
config unset org-capitalize-record-types
using the globalsf
installed in the NUT job, so those will fail until:plugin-org
andplugin-settings
get sfdx-core bumped to include this changenightly
channel (NUT jobs get nightly sf).What issues does this PR fix or reference?
forcedotcom/cli#2633
@W-14750427@