Clean Roomのバージョン管理¶
注釈
このトピックはclean roomの作成者向けです。Clean roomのコンシューマーは、clean roomのバージョン管理について考える必要はありません。
Clean roomのバージョンナンの番号付け¶
Snowflakeclean 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は、新しいバージョンが作成されるたびにパッチ番号(最後の桁)のみをインクリメントします。つまり、3つの連続したバージョンでは、番号がV1.0.0、V1.0.1、V1.0.2となります。
Clean roomがバージョン管理されるのは、 ネイティブアプリケーションパッケージ として実装されているからです。SnowflakeのNativeアプリケーションフレームワークでは、バージョンV1.0.2の場合、「V1.0」(文字列)がバージョン番号で、「2」(整数)がパッチ番号になります。Clean roomのドキュメントでは通常、(Native Apps Frameworkで使用されることがあるような)単に「V1.0」というプレフィックスではなく、番号全体(V1.0.1)を示す「バージョン」という用語を使用します。
クリーンルームの ID を使用して SHOW VERSIONS IN APPLICATION PACKAGE samooha_cleanroom_CLEANROOM_ID; を呼び出すことで、指定したクリーンルームのバージョン履歴とレビューステータスを見ることができます。
デフォルトリリースディレクティブ¶
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のデフォルトリリースディレクティブを指定します。
プロバイダーは、コードでクリーンルームを作成または変更する場合にのみ、デフォルトのリリースディレクティブを設定する必要があります。クリーンルーム 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.
エラーのあるクリーンルーム¶
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>>');