Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[BUG]: sf package version create always warns about org-capitalize-record-types, even when it's set

Đang mở
#3,663 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, nodejs
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:packaging more information required owned by another team regression stale
Before You Submit
  • I'm using the latest version of Salesforce CLI
  • I've searched the existing issues
  • I've run sf doctor to 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
  1. sf config set org-capitalize-record-types=true (or set SF_CAPITALIZE_RECORD_TYPES=true)
  2. Use any scratch org definition file, even one with no objectSettings
  3. 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

Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
571
Fork
80
Merge trung bình
23 giờ 43 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của forcedotcom/cli

Tất cả issue của forcedotcom/cli

Issue tương tự

Thêm issue về CLI

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.