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 project commands #2018

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Add project commands #2018

wants to merge 11 commits into from

Conversation

sfc-gh-turbaszek
Copy link
Contributor

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

Add snow project commands hidden behind a feature flag.

@sfc-gh-turbaszek sfc-gh-turbaszek marked this pull request as ready for review January 24, 2025 09:15
@sfc-gh-turbaszek sfc-gh-turbaszek requested review from a team as code owners January 24, 2025 09:15
sfc-gh-mraba
sfc-gh-mraba previously approved these changes Jan 24, 2025

@unique
class FeatureFlag(FeatureFlagMixin):
ENABLE_SNOWFLAKE_PROJECTS = BooleanFlag("ENABLE_NATIVE_APP_PYTHON_SETUP", False)

Choose a reason for hiding this comment

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

Is this correct with ENABLE_NATIVE_APP_PYTHON_SETUP?

cli_console.step(f"Creating stage {stage_name}")
sm.create(fqn=stage_name)

for file in project.artifacts:

Choose a reason for hiding this comment

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

Does this take care of replacing existing files on the stage with the same name? What about files already living on the stage directory used to feed the project. Are they being deleted when they don't existing in the new version?

Maybe each snow project create-version should create a subdirectory on the stage that is prefixed with a unique identifier / the version name?


@app.command(requires_connection=True)
@with_project_definition()
def create_version(

Choose a reason for hiding this comment

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

Are we gonna have an init command?

Choose a reason for hiding this comment

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

Oh I see, create_version creates project if doesn't exist.



@unique
class FeatureFlag(FeatureFlagMixin):

Choose a reason for hiding this comment

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

Can we show this feature only for PrPr customers?


@app.command(requires_connection=True)
@with_project_definition()
def create_version(
Copy link

@sfc-gh-bbeczkowski sfc-gh-bbeczkowski Jan 29, 2025

Choose a reason for hiding this comment

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

I have some doubts about this command:

  • both execute and validate commands map directly to a single project SQL command, the create_version command suggests that it maps to alter project p add version, but it does much more
  • we should have a command which maps to the basic alter project p add version. I don't see how this will work with snow-git-based projects. If we add a basic "add version" command, then it can be used by users to create a version from any stage, also a snow-git-based one. And it can be used in this more complex command.
  • Imo the name should be more explicit, like, create_version_from_local_files or something like that.

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.

5 participants