-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support project definition v2 in "app version" and "app run" (#1353)
* run tests * version tests * add unit tests * project name tests
- Loading branch information
1 parent
b3e91ea
commit 9cd6096
Showing
32 changed files
with
432 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
tests/test_data/projects/integration_external_v2/app/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# README | ||
|
||
This is the v2 version of the "integration_external" project definition |
16 changes: 16 additions & 0 deletions
16
tests/test_data/projects/integration_external_v2/app/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This is the v2 version of the "integration_external" project definition | ||
|
||
manifest_version: 1 | ||
|
||
version: | ||
name: dev | ||
label: "Dev Version" | ||
comment: "Default version used for development. Override for actual deployment." | ||
|
||
artifacts: | ||
setup_script: setup.sql | ||
readme: README.md | ||
|
||
configuration: | ||
log_level: INFO | ||
trace_level: ALWAYS |
19 changes: 19 additions & 0 deletions
19
tests/test_data/projects/integration_external_v2/app/setup.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
create application role app_public; | ||
create or alter versioned schema core; | ||
|
||
create or replace procedure core.echo(inp varchar) | ||
returns varchar | ||
language sql | ||
immutable | ||
as | ||
$$ | ||
begin | ||
return inp; | ||
end; | ||
$$; | ||
|
||
grant usage on procedure core.echo(varchar) to application role app_public; | ||
|
||
create or replace view core.shared_view as select * from my_shared_content.shared_table; | ||
|
||
grant select on view core.shared_view to application role app_public; |
5 changes: 5 additions & 0 deletions
5
tests/test_data/projects/integration_external_v2/package/001-shared.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- package script (1/2) | ||
|
||
create schema if not exists {{ package_name }}.my_shared_content; | ||
grant usage on schema {{ package_name }}.my_shared_content | ||
to share in application package {{ package_name }}; |
12 changes: 12 additions & 0 deletions
12
tests/test_data/projects/integration_external_v2/package/002-shared.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- package script (2/2) | ||
|
||
create or replace table {{ package_name }}.my_shared_content.shared_table ( | ||
col1 number, | ||
col2 varchar | ||
); | ||
|
||
insert into {{ package_name }}.my_shared_content.shared_table (col1, col2) | ||
values (1, 'hello'); | ||
|
||
grant select on table {{ package_name }}.my_shared_content.shared_table | ||
to share in application package {{ package_name }}; |
4 changes: 4 additions & 0 deletions
4
tests/test_data/projects/integration_external_v2/snowflake.local.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This is the v2 version of the "integration_external" project definition | ||
entities: | ||
pkg: | ||
distribution: external |
14 changes: 14 additions & 0 deletions
14
tests/test_data/projects/integration_external_v2/snowflake.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This is the v2 version of the "integration_external" project definition | ||
definition_version: 2 | ||
entities: | ||
pkg: | ||
type: application package | ||
name: integration_external_pkg_<% ctx.env.USER %> | ||
artifacts: | ||
- src: app/* | ||
dest: ./ | ||
manifest: app/manifest.yml | ||
meta: | ||
post_deploy: | ||
- sql_script: package/001-shared.sql | ||
- sql_script: package/002-shared.sql |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This is a manifest.yml file, a required component of creating a native application. | ||
# This file defines properties required by the application package, including the location of the setup script and version definitions. | ||
# Refer to https://docs.snowflake.com/en/developer-guide/native-apps/creating-manifest for a detailed understanding of this file. | ||
|
||
manifest_version: 1 | ||
|
||
version: | ||
name: dev | ||
label: "Dev Version" | ||
comment: "Default version used for development. Override for actual deployment." | ||
|
||
artifacts: | ||
setup_script: setup.sql | ||
readme: README.md | ||
|
||
configuration: | ||
log_level: INFO | ||
trace_level: ALWAYS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
create application role if not exists app_public; | ||
create or alter versioned schema core; | ||
|
||
create or replace procedure core.echo(inp varchar) | ||
returns varchar | ||
language sql | ||
immutable | ||
as | ||
$$ | ||
begin | ||
return inp; | ||
end; | ||
$$; | ||
|
||
grant usage on procedure core.echo(varchar) to application role app_public; | ||
|
||
create or replace view core.shared_view as select * from my_shared_content.shared_table; | ||
|
||
grant select on view core.shared_view to application role app_public; |
5 changes: 5 additions & 0 deletions
5
tests/test_data/projects/integration_v2/package/001-shared.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- package script (1/2) | ||
|
||
create schema if not exists {{ package_name }}.my_shared_content; | ||
grant usage on schema {{ package_name }}.my_shared_content | ||
to share in application package {{ package_name }}; |
12 changes: 12 additions & 0 deletions
12
tests/test_data/projects/integration_v2/package/002-shared.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- package script (2/2) | ||
|
||
create or replace table {{ package_name }}.my_shared_content.shared_table ( | ||
col1 number, | ||
col2 varchar | ||
); | ||
|
||
insert into {{ package_name }}.my_shared_content.shared_table (col1, col2) | ||
values (1, 'hello'); | ||
|
||
grant select on table {{ package_name }}.my_shared_content.shared_table | ||
to share in application package {{ package_name }}; |
Oops, something went wrong.