Clean room versioning¶

Note

This topic is for clean room creators. Clean room consumers don’t need to think about clean room versioning.

Clean room version numbering¶

Snowflake clean rooms are versioned. The initial version of a clean room without any Python code is 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 Iceberg tables. Snowflake creates a new version only if the security scan triggered by this action passes. Actions that might create a new version will mention this in the procedure response. Actions that fail the security scan will not generate a new version. Only provider actions can result in a new clean room version; consumer actions cannot.

Snowflake increments only the patch number (the last digit) with each new version. So version numbers for three successive versions would be V1.0.0, V1.0.1, and V1.0.2.

Note

Clean rooms are versioned because they are implemented as native application packages. In Snowflake’s native application framework, the convention is that for version V1.0.2, “V1.0” (a string) is the version number and 2 (an integer) is the patch number. Clean room documentation typically uses the term “version” to indicate the entire number (V1.0.1) rather than simply the “V1.0” prefix (as sometimes used in the native app framework).

You can see the version history for a given clean room by calling SHOW VERSIONS IN APPLICATION PACKAGE samooha_cleanroom_CLEANROOM_ID; with the ID of the clean room.

Default release directive¶

Each clean room is assigned a default release directive by the clean room creator. The default release directive specifies which version of the clean room should be installed in the user’s account. Consumers cannot specify which version of a clean room to install. Updates are handled automatically by Snowflake as as available resources dictate, and there may be some delay before the new version is installed on the user’s account.

A clean room provider must specify the default release directive of a clean room before the clean room can be shared initially (either internally or externally) or whenever the provider uploads code and the security scan passes. If a new version of the clean room is generated but the default release directive is not updated, consumers will continue to be served the last default version.

A clean room provider can roll the default release directive back to an earlier release if desired.

Specify the default release directive for a clean room by calling provider.set_default_release_directive.

Note

A provider must set the default release directive only when creating or modifying a clean room in code. Versioning is handled automatically when using the web application.

Relatively few provider calls might generate a new clean room version. Only if the security scan passes will Snowflake generate a new version. 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 served to users if you do not update it.

Examples

List all clean room packages (clean rooms) created in this Snowflake account:

SHOW APPLICATION PACKAGES STARTS WITH 'SAMOOHA_CLEANROOM_';
Copy

List all versions of the clean room MY_FIRST_CLEANROOM:

SHOW VERSIONS IN APPLICATION PACKAGE SAMOOHA_CLEANROOM_MY_FIRST_CLEANROOM;
Copy

You must always set the default release directive before first publishing a clean room. If you have not added Python code, it should be V1.0.0:

CALL samooha_by_snowflake_local_db.provider.set_default_release_directive(
  $cleanroom_name, 'V1_0', '0');
Copy

Check the scan review status before setting the version if this is a clean room that you just made external, or if this is already external and the version changed:

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>>');
Copy