-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add templating processor for native apps #1503
Add templating processor for native apps #1503
Conversation
@@ -37,10 +41,12 @@ | |||
|
|||
SNOWPARK_PROCESSOR = "snowpark" | |||
NA_SETUP_PROCESSOR = "native app setup" | |||
TEMPLATING_PROCESSOR = "templating" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little bikeshedding necessary for 'templating' here. How do we refer to the templates feature in public docs again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentation is being updated to refer to these as template
or templates
:
Project definition file templates
instead of Project definition file templating
.
I think we can switch to templates
for this. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or template expansion
as another option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for templates
then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial but can you update templating
to templates
in the pr description as well :')
src/snowflake/cli/_plugins/nativeapp/codegen/setup/native_app_setup_processor.py
Show resolved
Hide resolved
src/snowflake/cli/_plugins/nativeapp/codegen/templating/templating_processor.py
Outdated
Show resolved
Hide resolved
src/snowflake/cli/_plugins/nativeapp/codegen/templating/templating_processor.py
Outdated
Show resolved
Hide resolved
from tests.nativeapp.utils import CLI_GLOBAL_TEMPLATE_CONTEXT | ||
|
||
|
||
class FilesSetup(TemporaryDirectory): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does it inherit from temp dir? Seems like unnecessary coupling at first glance. I'm not even sure why this needs to be a context manager. Can you explain the thought process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked nicely in the tests, but I think I can try to separate tmp directory part from the setup part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored.
Pre-review checklist
Changes description
SNOW-1508576:
Added templating support for arbitrary files.
To do this, user has to add templates processor to their artifacts: