-
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
Refactor app package deploy logic from NativeAppManager to ApplicationPackageEntity #1442
Merged
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
sfc-gh-gbloom
force-pushed
the
refactor-app-package-entity-namanager
branch
from
August 19, 2024 14:54
c47fa3d
to
9f63585
Compare
sfc-gh-gbloom
force-pushed
the
refactor-app-package-entity-namanager
branch
from
August 20, 2024 15:14
0fcdcbe
to
0be7d97
Compare
sfc-gh-cgorrie
previously approved these changes
Aug 22, 2024
sfc-gh-cgorrie
approved these changes
Aug 26, 2024
sfc-gh-turbaszek
approved these changes
Aug 26, 2024
sfc-gh-sichen
pushed a commit
that referenced
this pull request
Oct 17, 2024
…nPackageEntity (#1442) * refactor app package deploy logic from NativeAppManager to ApplicationPackageEntity * remove global sql executor * get_sql_executor docstring
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
This is a preparation PR to enable
snow ws deploy
for application package entities in the following PR. The end goal is to reuse the same logic in bothNativeAppManager.deploy()
andApplicationPackageEntity
/ApplicationEntity
actions.Extracted methods
The first step is to extract the minimal logic out of
NativeAppManager
to enableApplicationPackageEntity.action_deploy()
(which will be very similar toNativeAppManager.deploy()
). The following methods were moved fromNativeAppManager
and modified to be stateless:ApplicationPackageEntity
get_existing_app_pkg_info()
get_app_pkg_distribution_in_snowflake()
verify_project_distribution()
use_package_warehouse()
apply_package_scripts()
create_app_package()
utils
generic_sql_error_handler()
ensure_correct_owner()
sync_deploy_root_with_stage()
_get_stage_paths_to_sync()
execute_post_deploy_hooks()
_execute_sql_script()
expand_script_templates()
Even though they are now just proxies, the methods in
NativeAppManager
were kept with the same signatures in order to not break the interface of the class, as other flows call them and were not refactored yet (teardown, version, etc).SqlExecutor
Added the
SqlExecutor
utility class to be able to execute SQL without having to inherit directly fromSqlExecutionMixin
.Manual tests