@W-22247284@ feat: add DistributionType to package create and update - #926
Merged
Conversation
…247284) Add an optional distribution type to 2GP package create and update. The value is gated at API version 68.0 and, when supplied from the CLI, must be either PublicSecure or Limited; Public and Private are backend-only states. When omitted on create, the backend defaults the distribution type based on the package type. - DistributionType / SettableDistributionType types + SETTABLE_DISTRIBUTION_TYPES and DISTRIBUTION_TYPE_MIN_API_VERSION constants - Package2.DistributionType field; distributionType on PackageCreateOptions and DistributionType on PackageUpdateOptions - validateDistributionType() enforces the API-version gate and CLI-settable allow-list from both createPackage and Package.update - DistributionType included in getPackage2Fields only at API 68.0+ - messages + unit tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sibling prerelease branches have already published spi.2 through spi.5. Bumping this branch's version so the release action computes the next free version (5.0.9-spi.6) instead of colliding on an existing tag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Private is not a selectable distribution type today. Removing it from the DistributionType union keeps it out of the generated plugin schemas while leaving the CLI-settable subset (PublicSecure, Limited) unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
btrn11
approved these changes
Sep 3, 2026
sshyamala-sfdc
deleted the
prerelease/t/packaging-distribution/w-22247284/package-distribution-type
branch
September 3, 2026 20:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds an optional distribution type to 2GP
package createandpackage update(W-22247284).The distribution type controls install-time security of a package. This PR is the library half of the feature; the
plugin-packagingPR adds the--distribution-typeflag and pins the prerelease this branch publishes.Behavior
PublicSecureandLimitedonly on both create and update.PublicandPrivateare backend-only states (Publicis the legacy default;Privateis not yet selectable) and are rejected with a clear error.DistributionTypefield is only queried/sent at 68.0+.Changes
DistributionType/SettableDistributionTypetypes,SETTABLE_DISTRIBUTION_TYPES, andDISTRIBUTION_TYPE_MIN_API_VERSIONconstants (in the interfaces leaf module to avoid an import cycle).Package2.DistributionTypefield;distributionType?onPackageCreateOptions;DistributionType?onPackageUpdateOptions.validateDistributionType()enforces the API-version gate and the CLI-settable allow-list from bothcreatePackageandPackage.update.DistributionTypeincluded ingetPackage2Fieldsonly at API 68.0+.🤖 Generated with Claude Code