What you will be able to do
- Choose the right release channel (QA, ALPHA or DEFAULT) for a stage of the app lifecycle and target accounts to it
- Create a new version with REGISTER VERSION and add it to a release channel within the two-version limits
- Add patch releases with ADD PATCH FOR VERSION and keep them free of state changes
- Point default and custom release directives at a version and patch for all consumers or for named accounts
Key concept
Release directive — A release directive is a pointer inside a release channel. It names the version and patch that consumers on that channel get. Publishing and upgrading both mean changing what a directive points to, so the directive is how a provider controls which code consumers run.
1.Three release channels: QA, ALPHA and DEFAULT
A Snowflake Native App reaches consumers through release channels on its application package. Release channels are on by default when you create a package. Once they are enabled, you cannot turn them off. A package created without them can enable them later with ENABLE_RELEASE_CHANNELS=TRUE on CREATE or ALTER APPLICATION PACKAGE. To do any release work you need a role with the MANAGE RELEASES privilege. That privilege covers enabling channels, registering and adding versions and patches, and setting release directives.
The three channels match three stages of the lifecycle. Each one differs in who can install from it and whether the automated security scan runs.
| Channel | Who can install | Automated security scan | Listing pricing plan |
|---|---|---|---|
| QA | Only accounts in the provider's organization, and only those explicitly targeted | Not triggered by adding a version to QA | Not used; installs are free |
| ALPHA | Targeted accounts, including accounts outside the provider's organization | Runs. Consumers can install while it is in progress, but a version that fails can no longer be used | Not used; installs are free |
| DEFAULT | All consumers who have access to the app version or patch (the production channel) | Must pass | Used |
DEFAULT is open to every consumer who can see the listing. QA and ALPHA are not. For those two channels the package keeps a list of accounts, which you manage with MODIFY RELEASE CHANNEL ... ADD ACCOUNTS, REMOVE ACCOUNTS, or SET ACCOUNTS. SET replaces the whole list. You can test any channel yourself with CREATE APPLICATION ... FROM APPLICATION PACKAGE ... USING RELEASE CHANNEL QA. Without that clause, DEFAULT is used. Installing from QA or ALPHA also requires the CREATE PREVIEW APPLICATION privilege.
ALTER APPLICATION PACKAGE my_app_package MODIFY RELEASE CHANNEL ALPHA ADD ACCOUNTS=(ORG1.ACCOUNT1);Checkpoint 1 of 6· Check yourself
A provider wants internal testers in their own organization to try a new version before any security scan runs. Which release channel should they add the version to?
Adding a version only to QA does not start the automated security scan. Adding it to ALPHA or DEFAULT does, and QA is limited to targeted accounts in the provider's organization.
“Adding a version only to the QA release channel does not initiate the security scan.”Source: docs.snowflake.com
2.Creating a version: register it, then add it to a channel
A version usually carries major changes and new features. Every version has its own manifest file and setup script. With release channels, creating one takes two steps. First, REGISTER VERSION builds the version from staged files and creates patch 0 for it. A registered version is not in any channel yet, and a package can hold at most two unassigned versions. If you need a third, run DEREGISTER VERSION on an old one, which also removes its patches.
ALTER APPLICATION PACKAGE my_app_package REGISTER VERSION V1 USING '@stage/path';Second, add the registered version to a release channel. Each channel holds at most two versions at a time. This limit applies per channel, not per package, so a package can have more than two versions spread across channels. If a channel is full, you remove a version with MODIFY RELEASE CHANNEL QA DROP VERSION V1. That drop is asynchronous: the version only goes away after every consumer has been upgraded off it.
If you use Snowflake CLI, snow app version create V1 uploads the project files and creates version V1 with patch 0 in one command. It also creates the package if it does not exist yet.
Checkpoint 2 of 6· Fill the gap
Complete step 2, which places registered version V1 into the QA channel.
ALTER APPLICATION PACKAGE my_app_package MODIFY RELEASE CHANNEL QA ? VERSION V1;REGISTER creates the version at package level. ADD VERSION inside MODIFY RELEASE CHANNEL assigns it to a channel so a release directive can use it.
Source: docs.snowflake.comCheckpoint 3 of 6· Check yourself
The DEFAULT channel already contains versions V1 and V2. The provider wants to add V3 to DEFAULT. What has to happen first?
Each release channel allows only two versions at once. To add a third, remove one, and that removal only completes once consumers have upgraded off it.
“each release channel only allows two versions of an app at a time”Source: docs.snowflake.com
3.Patch releases
A patch is a smaller update to an existing version, such as a security fix. A version can have up to 130 patches. You create one with ADD PATCH FOR VERSION. If you leave out the patch number, Snowflake uses the previous number plus 1. You can also supply your own number. A patch belongs to the channel its version is in: once a version has been added to a channel, its later patches are bound to that channel. A patch added to a version that is already in ALPHA or DEFAULT triggers the security scan. Unlike versions, patches cannot be dropped.
ALTER APPLICATION PACKAGE <name> ADD PATCH [<patch_number>] FOR VERSION [<version_identifier>]
USING <path_to_version_directory> [ LABEL = '<display_label>' ]Snowflake keeps only two versions active at once, but it does not limit how many patches of a version can run at the same time. Different consumers can be on different patches, so every patch's code has to work against the same tables and columns.
Checkpoint 4 of 6· Check yourself
A provider needs to fix a bug in V2 and also wants to add a column to a consumer-facing table. How should they ship this?
Patches should not change state, because many patches can be active at once. State changes such as new columns belong in a new version, and patches cannot be dropped.
“Patches should focus on bug fixes or minor feature additions without involving state modifications.”Source: docs.snowflake.com
4.Release directives: default and custom
With release channels enabled, each channel has its own release directives. A directive can only point at a version or patch that has already been added to that channel. The default release directive covers every consumer on the channel who is not named in a custom directive. A custom release directive has a name and a list of ACCOUNTS. You can use one to give a pilot group a newer version or patch while everyone else stays on the default.
ALTER APPLICATION PACKAGE my_app_package
MODIFY RELEASE CHANNEL ALPHA
SET RELEASE DIRECTIVE my_custom_release_directive
VERSION=V1 PATCH=11 ACCOUNTS=(ORG1.ACCOUNT1);To change the account list of an existing custom directive, use MODIFY RELEASE DIRECTIVE with ADD ACCOUNTS or REMOVE ACCOUNTS. You do not need to recreate the directive. The syntax also accepts an optional FORCE keyword on ADD ACCOUNTS. In Snowflake CLI, snow app publish --version v1 --patch 2 --channel ALPHA --directive customers_group_1 adds the version to the channel and points the named directive at it.
ALTER APPLICATION PACKAGE <name>
[ MODIFY RELEASE CHANNEL <release_channel_name> ]
MODIFY RELEASE DIRECTIVE <release_directive>
ADD ACCOUNTS = ( <organization_name>.<account_name> [ , <organization_name>.<account_name> , ... ] )
[ VERSION = <version_identifier> PATCH = <patch_num> ]
[ FORCE ]Checkpoint 5 of 6· Match them up
Match each command fragment to what it does
Tap a term, then the definition that fits it.
Channel membership decides who can install from a channel. Inside a channel, the default directive covers everyone, and custom directives override it for the accounts they list.
“When release channels are enabled for an application package, each channel has its own release directive.”Source: docs.snowflake.com
Checkpoint 6 of 6· Exam question
When a provider runs ALTER APPLICATION PACKAGE ... ADD VERSION without specifying a version identifier, what determines the version identifier that Snowflake assigns to the new version?
Correct answer: A — Snowflake reads the version identifier from the manifest.yml file bundled in the version directory.
- A. Correct: the version identifier can be omitted from the ADD VERSION command as long as it is defined in the manifest.yml for that version directory; Snowflake falls back to reading it from there.
- B. Incorrect: Snowflake does not auto-number versions sequentially. Automatic numbering applies to patches when a patch number is omitted, not to version identifiers.
- C. Incorrect: dropped version identifiers are not recycled automatically. A new identifier must come from the command or the manifest, never from a prior dropped version.
- D. Incorrect: the command does not fail outright when the identifier is left off the command, because the manifest.yml can supply the fallback value.
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.On any application package, you create a new version with ALTER APPLICATION PACKAGE ... ADD VERSION ... USING '@stage/path'.Why is that wrong?
Release channels are enabled by default, and on those packages ADD VERSION USING is not supported. You REGISTER VERSION, then add the version to a channel with MODIFY RELEASE CHANNEL ... ADD VERSION.
Covered in Creating a version: register it, then add it to a channel
2.Adding a version to any release channel, including QA, starts the automated security scan.Why is that wrong?
Only adding a version to ALPHA or DEFAULT, or a patch to a version already there, triggers the scan. Adding a version only to QA does not.
3.A faulty patch can be dropped the same way a version is removed from a channel.Why is that wrong?
Versions can be removed from a channel once consumers have upgraded off them, but patches can never be dropped. You fix a bad patch by releasing another one.
Covered in Patch releases
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“To use release channels, you must use a role that has been granted the MANAGE RELEASES privilege.”
↩︎ Three release channels: QA, ALPHA and DEFAULT“you must use a role that has been granted the CREATE PREVIEW APPLICATION privilege”
↩︎ Three release channels: QA, ALPHA and DEFAULT“There is a maximum of two unassigned versions (not added to any release channels) allowed in the application package.”
↩︎ Creating a version: register it, then add it to a channel“Dropping a version from a release channel is asynchronous and will only be truly dropped once all consumers have been upgraded off that version.”
↩︎ Creating a version: register it, then add it to a channel“subsequent patches for that version are also bound to that release channel”
↩︎ Patch releases“Providers must add a version or patch to a specific release channel before they can be used by release directives inside a release channel.”
↩︎ Release directives: default and custom“is not supported for application packages that have release channels enabled”
↩︎ Exam trap 1“is not supported for application packages that have release channels enabled”
↩︎ Prediction“When release channels are enabled for an application package, each channel has its own release directive.”
↩︎ Checkpoint - 2.
“if you create an application package with release channels enabled, you cannot disable them later.”
↩︎ Three release channels: QA, ALPHA and DEFAULT“The two-version limit applies to each release channel instead of per application package.”
↩︎ Creating a version: register it, then add it to a channel“If no patch number is provided, Snowflake automatically increments the patch version by 1.”
↩︎ Patch releases“To trigger the security scan, a version must be added to the ALPHA or DEFAULT release channel.”
↩︎ Exam trap 2“Patches cannot be dropped.”
↩︎ Exam trap 3“Adding a version only to the QA release channel does not initiate the security scan.”
↩︎ Checkpoint“each release channel only allows two versions of an app at a time”
↩︎ Checkpoint - 3.
“A single version can have up to 130 patches.”
↩︎ Patch releases - 4.
“the Snowflake Native App Framework does not enforce any restrictions on the number of active patches running.”
↩︎ Patch releases“Snowflake automatically upgrades all installed instances of the current version of the app to the version specified by the release directive”
↩︎ Key concept - 5.https://docs.snowflake.com/en/developer-guide/snowflake-cli/command-reference/native-apps-commands/publish-appOfficial docs
“This command adds the specified version to the release channel.”
↩︎ Release directives: default and custom
Also cited
“Patches should focus on bug fixes or minor feature additions without involving state modifications.”
↩︎ Checkpoint