Clean Room 版本控制¶
备注
本主题适用于 Clean Room 创建者。Clean Room 使用者无需考虑 Clean Room 版本控制。
Clean Room 版本编号¶
Snowflake Clean Room 已进行版本控制。没有任何 Python 代码的 Clean Room 的初始版本是 V1.0.0。
Snowflake automatically creates a new version of a clean room after certain provider events, such as uploading Python code or enabling external or Apache Iceberg™ tables. Snowflake creates a new version only if the security scan triggered by this action passes. Relatively few provider actions can generate a new clean room version, and procedures that create a new version mention the new version in the procedure response.
Actions that fail the security scan don't generate a new version.
Only provider actions can result in a new clean room version; consumer actions cannot.
Snowflake 只增加每个新版本的补丁号(最后一位数字)。因此,三个连续版本的版本号将是 V1.0.0、V1.0.1 和 V1.0.2。
Clean Room 之所以进行版本控制,是因为它们是作为 原生应用程序包 实现的。在 Snowflake 的 Native Application Framework 中,惯例是,对于版本 V1.0.2,“V1.0”(字符串)是版本号,2(整数)是补丁号。Clean Room 文档通常使用术语“版本”来表示整个编号(V1.0.1),而不仅仅是“V1.0”前缀(有时在原生应用程序框架中使用)。
You can see the version history and review status for a given clean room by calling
SHOW VERSIONS IN APPLICATION PACKAGE samooha_cleanroom_CLEANROOM_ID; with the ID of the clean room.
默认发布指令¶
Each clean room is assigned a default release directive by the clean room provider. The default release directive specifies which version of the clean room should be installed or loaded in the user's account. Consumers cannot specify which version of a clean room to install. Updates are handled automatically by Snowflake as available resources dictate, and there can be a delay before the new version is installed on the user's account.
Clean Room 提供商必须在 Clean Room 可以初始共享(内部或外部)之前,或者每当提供商上传代码并且安全扫描通过时,指定 Clean Room 的默认发布指令。如果生成了新版本的 Clean Room 但未更新默认发布指令,则将继续向使用者提供最新的默认版本。
You must always set the default release directive before publishing a clean room. If you haven't added Python code, it should be V1.0.0, as shown here:
CALL samooha_by_snowflake_local_db.provider.set_default_release_directive(
$cleanroom_name, 'V1_0', '0');
如果需要,Clean Room 提供商可以将默认发布指令恢复到较早的版本。
通过调用 provider.set_default_release_directive 指定 Clean Room 的默认发布指令。
只有在代码中创建或修改 Clean Room 时,提供商才必须设置默认发布指令。使用 Clean Room UI 会自动处理版本控制。
Snowflake generates a new version only if the security scan triggered by a provider action passes. Therefore you should check the security
scan status for a clean room by calling provider.view_cleanrooom_scan_status before updating the default release directive. Not
updating the default release directive will not cause an error, but the newer version with your changes will not be published to users if you
don't update the default release directive.
Clean rooms with errors¶
If you publish a clean room with an error, which happens when the security scan fails or you upload Python code with a syntax error, a patch is generated, but you cannot use that version as a default release directive. Until you publish a fixed version, any additional patches incorporate the error from the previous failed patch and also result in a failed clean room patch.
Versioning cheat sheet¶
列出在此 Snowflake 账户中创建的所有 Clean Room 包(Clean Room):
SHOW APPLICATION PACKAGES STARTS WITH 'SAMOOHA_CLEANROOM_';
列出 Clean Room MY_FIRST_CLEANROOM 的所有版本:
SHOW VERSIONS IN APPLICATION PACKAGE SAMOOHA_CLEANROOM_MY_FIRST_CLEANROOM;
See your current default release directive:
SHOW RELEASE DIRECTIVES IN APPLICATION PACKAGE SAMOOHA_CLEANROOM_<your_clean_room_name>;
如果这是您刚刚设置为外部的 Clean Room,或者已经是外部的并且版本已更改,请在设置版本之前检查扫描审查状态:
CALL samooha_by_snowflake_local_db.provider.view_cleanroom_scan_status('MY_FIRST_CLEANROOM');
-- When REVIEW_STATUS = APPROVED, you can update the default version to the
-- latest version, if you haven't done so already.
SHOW VERSIONS IN APPLICATION PACKAGE SAMOOHA_CLEANROOM_MY_FIRST_CLEANROOM;
CALL samooha_by_snowflake_local_db.provider.set_default_release_directive(
$cleanroom_name, 'V1_0', '<<LATEST_PATCH_NUMBER>>');