-
Notifications
You must be signed in to change notification settings - Fork 57
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
Update setup processor according to new result schema #1448
Conversation
69a3096
to
5c6f613
Compare
5c6f613
to
9414704
Compare
@@ -34,7 +36,7 @@ | |||
) | |||
|
|||
SNOWPARK_PROCESSOR = "snowpark" | |||
NA_SETUP_PROCESSOR = "native-app-setup" | |||
NA_SETUP_PROCESSOR = "native app setup" |
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.
Somehow I keep forgetting that natural strings like this are more natural in YAML.
processor_ctx = copy.copy(self._bundle_ctx) | ||
processor_subdirectory = re.sub(r"[^a-zA-Z0-9_$]", "_", processor_name) |
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.
Changed the logic so that each processor uses its own subdirectory for its artifacts, enforced by the framework. Right now each processor was responsible for doing this, so I just centralized the same logic to facilitate the implementation of new processors.
9414704
to
6460a9f
Compare
processor_ctx = copy.copy(self._bundle_ctx) | ||
processor_subdirectory = re.sub(r"[^a-zA-Z0-9_$]", "_", processor_name) | ||
processor_ctx.bundle_root = ( | ||
self._bundle_ctx.bundle_root / processor_subdirectory |
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.
if each processor gets its own directory, how do we chain processors?
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.
I only made that change for the bundle root (which is the processor's sandbox) and the generated directory, which is similarly processor-specific. The deploy root remains unchanged, as processors should always be reading and writing from/to the deploy root so they can be chained.
6460a9f
to
e22c160
Compare
@@ -40,6 +46,16 @@ | |||
DEFAULT_TIMEOUT = 30 | |||
DRIVER_PATH = Path(__file__).parent / "setup_driver.py.source" | |||
|
|||
log = logging.getLogger(__name__) |
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.
wish we had named this logger
instead of log
everywhere :')
src/snowflake/cli/_plugins/nativeapp/codegen/setup/native_app_setup_processor.py
Show resolved
Hide resolved
2788e2e
for inst in mod.get("instructions", []): | ||
if inst.get("type") == "set": | ||
payload = inst.get("payload") | ||
if payload: | ||
key = payload.get("key") | ||
value = payload.get("value") |
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.
nit: too much nesting here, would be nice to factor this out if possible.
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.
sure, I'll keep this in mind when I rework this logic in the near future.
2788e2e
to
407b5f6
Compare
407b5f6
to
3d3a52d
Compare
Pre-review checklist
Changes description
Updating the setup processor driver to match ToT in the snowflake.app package
Testing
Since the snowflake.app package is still private, this was tested manually using an env var override. Integ and E2E tests will be added when the feature is closer to PrPr.