[BUG]: sf package version create always warns about org-capitalize-record-types, even when it's set
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, nodejs
- 领域
- cli
调研方向
The cause sits in the dependency @salesforce/packaging: the settings generator is built at lib/package/packageVersionCreate.js:339 and packageConvert.js:185 without capitalizeRecordTypes. Read the ScratchOrgSettingsGenerator constructor in @salesforce/core (lib/org/scratchOrgSettingsGenerator.js:200), which warns when that option is undefined. Done when the org-capitalize-record-types value from ConfigAggregator is passed at both call sites and the warning no longer appears when the setting is set. The fix may belong in the packaging repository rather than this one.
由索引模型根据 Issue 内容生成。
描述
Before You Submit
- I'm using the latest version of Salesforce CLI
- I've searched the existing issues
- I've run
sf doctorto diagnose common issues
Related Issue
No response
Command
sf package version create
Org Type
Developer Edition
Did this work before?
Yes, this is a regression
Last Working Version
No response
Summary
sf package version create prints this warning on every run:
Warning: 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.
Setting the config var doesn't stop it, because package creation never reads the config var. The same happens when the definitionfile has no objectSettings or record types at all.
Repository to Reproduce
No response
Steps to reproduce
- sf config set org-capitalize-record-types=true (or set SF_CAPITALIZE_RECORD_TYPES=true)
- Use any scratch org definition file, even one with no objectSettings
- sf package version create -p -v -x -w 60
Expected Result
No warning when org-capitalize-record-types is set. The setting should also apply to how the build org is created, as it does for sf org create scratch.
Actual Result
The warning appears every time, and the setting is ignored. The build org always uses the hardcoded fallback (true).
System Information
- @salesforce/cli/2.152.14 win32-x64 node-v24.20.0
- @salesforce/plugin-packaging 3.0.7
- @salesforce/packaging 5.0.12
- @salesforce/core 9.2.0
- Windows 11, PowerShell 7
Additional Information
Cause
@salesforce/packaging creates the settings generator without passing the setting:
// @salesforce/packaging 5.0.12 — lib/package/packageVersionCreate.js:339
const settingsGenerator = new core_1.ScratchOrgSettingsGenerator({ asDirectory: true });
packageConvert.js:185 does the same thing. In @salesforce/core, the ScratchOrgSettingsGenerator constructor warns whenever capitalizeRecordTypes is undefined:
// @salesforce/core 9.2.0 — lib/org/scratchOrgSettingsGenerator.js:200
if (options?.capitalizeRecordTypes === undefined) {
void Lifecycle.getInstance().emitWarning(messages.getMessage('noCapitalizeRecordTypeConfigVar'));
this.capitalizeRecordTypes = true;
}
Suggested fix: in both packaging call sites, read org-capitalize-record-types from the ConfigAggregator and pass it as capitalizeRecordTypes, the same way scratch org creation does.
Related: #2633 introduced the config var; #2970 shows the warning in an unrelated package version create report.
Screenshots or Log Files
No response
- 主要语言
- 没有语言数据
- 星标
- 571
- 派生
- 80
- 平均合并
- 14 小时 43 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
forcedotcom/cli 的其他 Issue
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShape可能已有人在做 @konkonrong-lgtm 于 71 天前认领。 未关闭area:afdx bug investigating owned by another team validated
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3625 · 4 条评论 ·
-
area:afdx bug owned by another team
难度 2/5 1-3 小时 新手友好度 78/100
forcedotcom/cli#3608 · 2 条评论 ·
-
announcement
难度 1/5 1 小时以内 新手友好度 1/100
forcedotcom/cli#3668 ·
-
bug investigating validated
难度 3/5 1-2 天 新手友好度 66/100
forcedotcom/cli#3667 · 5 条评论 ·
-
[BUG]: NavigationMenu SourceMember name mismatch prevents source-tracked retrieve from completing未关闭bug investigating validated
难度 4/5 3-5 天 新手友好度 52/100
forcedotcom/cli#3660 · 3 条评论 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
code-yeongyu/oh-my-openagent#10974 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
objectionary/phino#2059 ·
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 84/100
anandkaranubc/git-into-gsoc#343 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
natecraddock/zf#89 ·