-
Notifications
You must be signed in to change notification settings - Fork 55
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
[POC] spcs project #1727
Draft
sfc-gh-sichen
wants to merge
1,048
commits into
main
Choose a base branch
from
sichen-spcs-project
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[POC] spcs project #1727
Conversation
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
Bumps [tomlkit](https://github.com/sdispater/tomlkit) from 0.12.5 to 0.13.0. - [Release notes](https://github.com/sdispater/tomlkit/releases) - [Changelog](https://github.com/python-poetry/tomlkit/blob/master/CHANGELOG.md) - [Commits](python-poetry/tomlkit@0.12.5...0.13.0) --- updated-dependencies: - dependency-name: tomlkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 70.2.0 to 70.3.0. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](pypa/setuptools@v70.2.0...v70.3.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Temporarily skip failing test due to server side issue * Add issue number to description
* create decorator * unit tests * add "app open" integration tests * teardown with v1 * add tests
Add error events to telemetry
* add v2 decorator to "app teardown" command * util to enable v2 feature flag * v2 coverage for teardown cascade integration test
* Refactor VariableOption flag * update snapshot
* Show snow init command * update release notes
Add hidden `snow app events` command that will be used to fetch events for the app from the account's event table in the future. For now, this command just validates that the account has an event table set up or prints instructions linking to the docs if it's not set up.
* run tests * version tests * add unit tests * project name tests
* Add test for Task * Add test warehouse * refactor of imports
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@8.2.2...8.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Solution + unit tests * Integration tests * test fix * test fix
As part of implementing `snow app events -f`, we want to be able to stream messages indefinitely. This PR allows commands return a StreamResult, which wraps a generator of `CommandResult` objects. When we print a `StreamResult`, we iterate over all of its values and pass them individually through the same printing process.
Fetches events from the account event table (See #1337). This does not implement filtering, timeboxing, or limiting output (these will come in a followup).
* Deprecation warning * Update readme * fix
Stop alphabetizing dict keys in `snow helpers v1-to-v2`, to keep the converted PDFs to an opinionated order.
* SNOW-1055755: scripts and resources required for building binary packages
…rectly (#1621) Now that `ApplicationPackageEntity` has a static `deploy()` method, we can just call that instead of having to pass a callback from the `NativeAppManager` to deploy the app files to the scratch stage when doing setup script validation. There's a bit of a an explosion in required params, but it's temporary and it'll be cleaned up when the v1 commands are made to operate on v2 entities directly.
We have some commands, like `snow app bundle`/`snow ws bundle` that don't even need a connection, so let's defer connecting to Snowflake until it's actually needed by the particular action being run. For now, all `snow ws` commands are still marked as requiring a connection, that will be fixed separately.
…it (#1636) Fixes bug with `snow helpers v1-to-v2` if a `snowflake.local.yml` is present. Currently, the local file isn't renamed, so a v1 local can be overlaid onto a v2 main definition file after migration, which breaks subsequent commands. Since local overrides are no longer a desired feature in PDFv2, we don't convert them unless `--migrate-local-overrides` is used.
Fixes the manifest not being found if it isn't explicitly mentioned as an artifact or as part of a glob when running `snow helpers v1-to-v2`.
cleanup
…en (#1655) * mraba/help-version-info: add version to tool description on help screen
Quick `snow ws dump` internal command to show what a snowflake.yml file will render to after defaults, templates, and mixins.
Renames `snowflake.cli._plugins.nativeapp.v2_conversions.v2_to_v1_decorator` to `snowflake.cli._plugins.nativeapp.v2_conversions.compat` since we're going to put more stuff in there.
When running `snow object create` (a command that shouldn't load `snowflake.yml`), a Pydantic validation error was still raised because the file is loaded by telemetry code to get the definition version. We shouldn't let telemetry code break the app, so let's just ignore the error in the case of an invalid project definition.
* SNOW-1694005: use pyinstaller for composing pkg content
…w WorkspaceContext (#1652) Entity classes current have lots of static methods, which were added to support the v1 to v2 migration, but they have way too many parameters, so we want to allow calling these methods on entity instances. Right now, the only instance methods are `EntityAction` implementations, which represent the top-level actions that can be performed by these entities, but the static methods we want to convert to instance methods don't need to be `EntityAction` implementations (since they don't represent top-level operations). However, it would be useful for these methods to have access to utilities in the `ActionContext`, like `ctx.default_role` for example. Since these utilities are not really part of the action, let's extract them from `ActionContext` into a new `WorkspaceContext` that gets set as a field of the entity when instantiated by the `WorkspaceManager`.
No material changes, just extracting the entity finding logic into `_find_app_and_package_entities` and the Typer options into `APP_AND_PACKAGE_OPTIONS` slim the diff in #1635.
Allows converting a v1 definition to v2 only in-memory, without saving the resultant v2 definition to `snowflake.yml`. This will be used in a future decorator added in #1667 to allow v1 commands to operate natively on v2 entities by implicitly converting the definition. Since the definition conversion process currently updates package script files in-place, we need a way to isolate those changes to a temp directory instead of touching the user's project directory. This is achieved by creating a tempdir to hold these conversions and by replacing the package script filenames in the project definition with absolute paths to those temp files, taking advantage of the (documented) fact that `Path(...) / "/tmp/foo"` ignores the first `Path` since the second is absolute, resulting in just `Path("/tmp/foo")`. Since the definition contents will never be emitted to disk to be loaded in the future, another thing we need to do is evaluate templates in the converted project definition immediately instead of returning a definition with tags in it. In addition, since we're modifying the project definition in-memory, we also need to override the template context to be used for future template expansions in other files, so this ability was added to the CLI global context manager.
… PDFv2 (#1667) We eventually want to remove `NativeAppManager` and `NativeAppProjectModel` since they're only thin wrappers around the v2 entities right now. Since the `snow app` commands can only operate on a single package or app at a time, we need to adapt the definition that the user gives us if it doesn't conform. This PR adds `@single_app_and_package()` decorator to be used on `snow app` commands to perform this conversion. If the user gives us a v1 definition, it is implicitly converted to a v2 definition with `app` and `pkg` entities using the same conversion as `snow helpers v1-to-v2`. If the user gives us a v2 definition, it is searched for a single package entity and up to one app entity using the same logic as the current `@nativeapp_definition_v2_to_v1()` decorator, including disambiguating using `--package-entity-id` and `--app-entity-id` options if necessary. With this decorator, the `snow app` commands can operate natively on v2 entities instead of having to rely on `NativeAppManager` and `NativeAppProjectModel`, which only support v1 (In this PR, we demonstrate the usage of the decorator by applying it to `snow app bundle`).
Converts `snow app diff` to operate natively on v2 models
sfc-gh-sichen
force-pushed
the
sichen-spcs-project
branch
3 times, most recently
from
October 17, 2024 17:52
11bf9d9
to
c7c3a58
Compare
sfc-gh-sichen
force-pushed
the
sichen-spcs-project
branch
from
October 25, 2024 18:30
c7c3a58
to
d01730c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-review checklist
Changes description
...