-
Notifications
You must be signed in to change notification settings - Fork 245
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
Added support for SkipHandlers #3802
base: main
Are you sure you want to change the base?
Changes from 1 commit
4dad612
20b567a
2816d19
99cb50e
7d1cdab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,8 @@ class UpgradeType(StrEnum): | |
DEPRECATE_ONLY = "deprecate-only" | ||
MIXED = "mixed" | ||
|
||
class SkipHandlers(StrEnum): | ||
FEATURE_ENFORCEMENT = "FeatureEnforcement" | ||
|
||
class PackageInstallOptions(CCIModel): | ||
"""Options governing installation behavior for a managed or unlocked package.""" | ||
|
@@ -62,6 +64,7 @@ class PackageInstallOptions(CCIModel): | |
security_type: SecurityType = SecurityType.FULL | ||
apex_compile_type: Optional[ApexCompileType] = None | ||
upgrade_type: Optional[UpgradeType] = None | ||
skip_handlers: SkipHandlers = SkipHandlers.FEATURE_ENFORCEMENT | ||
|
||
@staticmethod | ||
def from_task_options(task_options: dict) -> "PackageInstallOptions": | ||
|
@@ -86,6 +89,8 @@ def from_task_options(task_options: dict) -> "PackageInstallOptions": | |
) | ||
if "upgrade_type" in task_options: | ||
options.upgrade_type = UpgradeType(task_options["upgrade_type"]) | ||
if "skip_handlers" in task_options: | ||
options.skip_handlers = SkipHandlers(task_options["skip_handlers"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💭: Implementation note: The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a comment for future consideration. |
||
except ValueError as e: | ||
raise TaskOptionsError(f"Invalid task options: {e}") | ||
|
||
|
@@ -111,6 +116,9 @@ def from_task_options(task_options: dict) -> "PackageInstallOptions": | |
"upgrade_type": { | ||
"description": "For Unlocked Package upgrades only, whether to deprecate removed components (`deprecate-only`), delete them (`delete-only`), or delete and deprecate based on safety (`mixed`). `mixed` is the default behavior." | ||
}, | ||
"skip_handlers": { | ||
"description": "Specifies the handlers that are skipped when the package is installed. There's only one valid value:`FeatureEnforcement`: For package installs in scratch orgs only. Available in API version 61.0 and later." | ||
}, | ||
} | ||
|
||
DEFAULT_PACKAGE_RETRY_OPTIONS = { | ||
|
@@ -171,6 +179,7 @@ def _install_package_by_version_id( | |
"SubscriberPackageVersionKey": version_id, | ||
"UpgradeType": options.upgrade_type, | ||
"ApexCompileType": options.apex_compile_type, | ||
"SkipHandlers": options.skip_handlers, | ||
} | ||
) | ||
poll(functools.partial(_wait_for_package_install, tooling, request)) | ||
|
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.
±: We don't want to silently change behavior, so it shouldn't be a default. Instead, it should be an optional
Option
set toNone
.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.
Updated to
None