Skip to content
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

Merged
merged 10 commits into from
Aug 28, 2024

Conversation

sfc-gh-melnacouzi
Copy link
Contributor

@sfc-gh-melnacouzi sfc-gh-melnacouzi commented Aug 27, 2024

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

SNOW-1508576:
Added templating support for arbitrary files.
To do this, user has to add templates processor to their artifacts:

native_app:
  name: myapp
  artifacts:
    - src: app/*
      dest: ./
      processors:
        - templates

@sfc-gh-melnacouzi sfc-gh-melnacouzi marked this pull request as ready for review August 27, 2024 17:59
@sfc-gh-melnacouzi sfc-gh-melnacouzi requested review from a team as code owners August 27, 2024 17:59
@@ -37,10 +41,12 @@

SNOWPARK_PROCESSOR = "snowpark"
NA_SETUP_PROCESSOR = "native app setup"
TEMPLATING_PROCESSOR = "templating"
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for templates then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

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 :')

from tests.nativeapp.utils import CLI_GLOBAL_TEMPLATE_CONTEXT


class FilesSetup(TemporaryDirectory):
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored.

@sfc-gh-melnacouzi sfc-gh-melnacouzi enabled auto-merge (squash) August 28, 2024 16:23
@sfc-gh-melnacouzi sfc-gh-melnacouzi merged commit 2552334 into main Aug 28, 2024
16 checks passed
@sfc-gh-melnacouzi sfc-gh-melnacouzi deleted the melnacouzi-add-templating-processors branch August 28, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants