-
Notifications
You must be signed in to change notification settings - Fork 57
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
SNOW-1773537: Use the patch number specified in manifest.yaml in snow app create version command #1820
Comments
I tested this with an example app, and this behaviour already exists. Using an app that already has a version called > snow app version list
+--------------------------------------------------------------------------------------------------------------------------------------------+
| version | patch | label | comment | created_on | dropped_on | log_level | trace_level | state | review_status |
|---------+-------+--------------+-------------------+------------------------+------------+-----------+-------------+-------+---------------|
| V1 | 0 | FirstVersion | The first version | 2024-08-13 | None | INFO | OFF | READY | NOT_REVIEWED |
| | | | | 07:29:38.054000-07:00 | | | | | |
+--------------------------------------------------------------------------------------------------------------------------------------------+ Defining > snow app version create --skip-git-check
Version was not provided through the Snowflake CLI. Checking version in the manifest.yml instead.
This step will bundle your app artifacts to determine the location of the manifest.yml file.
Checking if stage logs_pkg_fcampbell.app_src.stage exists, or creating a new one if none exists.
Performing a diff between the Snowflake stage and your local deploy_root ('/Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy') directory.
Local changes to be deployed:
modified: app/manifest.yml -> manifest.yml
Updating the Snowflake stage from your local /Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy directory.
Validating Snowflake Native App setup script.
Version V1 already defined in application package logs_pkg_fcampbell and in release directive(s): DEFAULT.
Are you sure you want to create a new patch for version V1 in application package logs_pkg_fcampbell? Once added, this operation cannot be undone. [y/N]: y
Adding new patch to version V1 defined in application package logs_pkg_fcampbell
╭─ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 093168 (22000): 01b80975-0502-fcd6-0000-1ca10054ee9e: Version 'V1', patch 0 of application package 'LOGS_PKG_FCAMPBELL' already exists. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ Defining > snow app version create --skip-git-check
Version was not provided through the Snowflake CLI. Checking version in the manifest.yml instead.
This step will bundle your app artifacts to determine the location of the manifest.yml file.
Checking if stage logs_pkg_fcampbell.app_src.stage exists, or creating a new one if none exists.
Performing a diff between the Snowflake stage and your local deploy_root ('/Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy') directory.
Local changes to be deployed:
modified: app/manifest.yml -> manifest.yml
Updating the Snowflake stage from your local /Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy directory.
Validating Snowflake Native App setup script.
Version V1 already defined in application package logs_pkg_fcampbell and in release directive(s): DEFAULT.
Are you sure you want to create a new patch for version V1 in application package logs_pkg_fcampbell? Once added, this operation cannot be undone. [y/N]: y
Adding new patch to version V1 defined in application package logs_pkg_fcampbell
Patch 1 created for version V1 defined in application package logs_pkg_fcampbell.
Version create is now complete. Defining > snow app version create --skip-git-check
Version was not provided through the Snowflake CLI. Checking version in the manifest.yml instead.
This step will bundle your app artifacts to determine the location of the manifest.yml file.
Checking if stage logs_pkg_fcampbell.app_src.stage exists, or creating a new one if none exists.
Performing a diff between the Snowflake stage and your local deploy_root ('/Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy') directory.
Local changes to be deployed:
modified: app/manifest.yml -> manifest.yml
Updating the Snowflake stage from your local /Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy directory.
Validating Snowflake Native App setup script.
Version V1 already defined in application package logs_pkg_fcampbell and in release directive(s): DEFAULT.
Are you sure you want to create a new patch for version V1 in application package logs_pkg_fcampbell? Once added, this operation cannot be undone. [y/N]: y
Adding new patch to version V1 defined in application package logs_pkg_fcampbell
Patch 10 created for version V1 defined in application package logs_pkg_fcampbell.
Version create is now complete. Removing > snow app version create --skip-git-check
Version was not provided through the Snowflake CLI. Checking version in the manifest.yml instead.
This step will bundle your app artifacts to determine the location of the manifest.yml file.
Checking if stage logs_pkg_fcampbell.app_src.stage exists, or creating a new one if none exists.
Performing a diff between the Snowflake stage and your local deploy_root ('/Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy') directory.
Local changes to be deployed:
modified: app/manifest.yml -> manifest.yml
Updating the Snowflake stage from your local /Users/fcampbell/Software/snowflakedb/nade-experiments/apps/logs/output/deploy directory.
Validating Snowflake Native App setup script.
Version V1 already defined in application package logs_pkg_fcampbell and in release directive(s): DEFAULT.
Are you sure you want to create a new patch for version V1 in application package logs_pkg_fcampbell? Once added, this operation cannot be undone. [y/N]: y
Adding new patch to version V1 defined in application package logs_pkg_fcampbell
Patch 11 created for version V1 defined in application package logs_pkg_fcampbell.
Version create is now complete. Version info so far: > snow app version list
+--------------------------------------------------------------------------------------------------------------------------------------------+
| version | patch | label | comment | created_on | dropped_on | log_level | trace_level | state | review_status |
|---------+-------+--------------+-------------------+------------------------+------------+-----------+-------------+-------+---------------|
| V1 | 0 | FirstVersion | The first version | 2024-08-13 | None | INFO | OFF | READY | NOT_REVIEWED |
| | | | | 07:29:38.054000-07:00 | | | | | |
| V1 | 1 | FirstVersion | The first version | 2024-10-30 | None | INFO | OFF | READY | NOT_REVIEWED |
| | | | | 06:41:54.352000-07:00 | | | | | |
| V1 | 10 | FirstVersion | The first version | 2024-10-30 | None | INFO | OFF | READY | NOT_REVIEWED |
| | | | | 06:42:08.885000-07:00 | | | | | |
| V1 | 11 | FirstVersion | The first version | 2024-10-30 | None | INFO | OFF | READY | NOT_REVIEWED |
| | | | | 06:50:01.436000-07:00 | | | | | |
+--------------------------------------------------------------------------------------------------------------------------------------------+ Attempting to create a patch for a non-existent version > snow app version create --skip-git-check
Version was not provided through the Snowflake CLI. Checking version in the manifest.yml instead.
This step will bundle your app artifacts to determine the location of the manifest.yml file.
Usage: snow app version create [OPTIONS] [VERSION]
Try 'snow app version create --help' for help.
╭─ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Cannot create a custom patch when version V2 is not defined in the application package logs_pkg_fcampbell. Try again without using │
│ --patch. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ The error message should be updated, but otherwise this is supported already, unless there's a use-case I'm missing. |
I must have missed something when I was doing the testing myself. Thanks for confirming this is already supported! |
Description
Native Apps added the functionality of specifying patch number in the manifest.yaml file. This together with ALTER VERSION query syntax allows to add a patch with a specific number, not just increment the last patch by 1. AFAIK, the initial patch for each new version must always be 0 though.
We would like
snow app create version
command to utilize patch number from manifest.yaml. This would however require several validations like:snow app create version
should failContext
No response
The text was updated successfully, but these errors were encountered: