Skip to content

Commit 5c6c6f7

Browse files
committed
Register remote dev plugin
1 parent 255477d commit 5c6c6f7

File tree

5 files changed

+87
-0
lines changed

5 files changed

+87
-0
lines changed

src/snowflake/cli/_app/commands_registration/builtin_plugins.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from snowflake.cli._plugins.notebook import plugin_spec as notebook_plugin_spec
2626
from snowflake.cli._plugins.object import plugin_spec as object_plugin_spec
2727
from snowflake.cli._plugins.plugin import plugin_spec as plugin_plugin_spec
28+
from snowflake.cli._plugins.remote import plugin_spec as remote_plugin_spec
2829
from snowflake.cli._plugins.snowpark import plugin_spec as snowpark_plugin_spec
2930
from snowflake.cli._plugins.spcs import plugin_spec as spcs_plugin_spec
3031
from snowflake.cli._plugins.sql import plugin_spec as sql_plugin_spec
@@ -53,6 +54,7 @@ def get_builtin_plugin_name_to_plugin_spec():
5354
"init": init_plugin_spec,
5455
"workspace": workspace_plugin_spec,
5556
"plugin": plugin_plugin_spec,
57+
"remote": remote_plugin_spec,
5658
"dbt": dbt_plugin_spec,
5759
"logs": logs_plugin_spec,
5860
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2024 Snowflake Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2024 Snowflake Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from __future__ import annotations
16+
17+
import logging
18+
19+
from snowflake.cli.api.commands.snow_typer import SnowTyperFactory
20+
21+
log = logging.getLogger(__name__)
22+
app = SnowTyperFactory(
23+
name="remote",
24+
help="Manages remote development environments.",
25+
)
26+
27+
28+
@app.command("list", requires_connection=True)
29+
def list_services(**options) -> None:
30+
"""
31+
List remote development environments.
32+
33+
This is a placeholder command for the remote plugin.
34+
Full functionality will be implemented in subsequent PRs.
35+
"""
36+
log.info("Remote plugin registered successfully")
37+
log.info("Remote development environments plugin is registered.")
38+
log.info("Full functionality will be available in upcoming releases.")
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2024 Snowflake Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from snowflake.cli._plugins.remote import commands
16+
from snowflake.cli.api.plugins.command import (
17+
SNOWCLI_ROOT_COMMAND_PATH,
18+
CommandSpec,
19+
CommandType,
20+
plugin_hook_impl,
21+
)
22+
23+
24+
@plugin_hook_impl
25+
def command_spec():
26+
return CommandSpec(
27+
parent_command_path=SNOWCLI_ROOT_COMMAND_PATH,
28+
command_type=CommandType.COMMAND_GROUP,
29+
typer_instance=commands.app.create_instance(),
30+
)

tests_e2e/__snapshots__/test_installation.ambr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
| logs Retrieves logs for a given object. |
4040
| notebook Manages notebooks in Snowflake. |
4141
| object Manages Snowflake objects like warehouses and stages |
42+
| remote Manages remote development environments. |
4243
| snowpark Manages procedures and functions. |
4344
| spcs Manages Snowpark Container Services compute pools, |
4445
| services, image registries, and image repositories. |
@@ -102,6 +103,7 @@
102103
| logs Retrieves logs for a given object. |
103104
| notebook Manages notebooks in Snowflake. |
104105
| object Manages Snowflake objects like warehouses and stages |
106+
| remote Manages remote development environments. |
105107
| snowpark Manages procedures and functions. |
106108
| spcs Manages Snowpark Container Services compute pools, services, |
107109
| image registries, and image repositories. |
@@ -146,6 +148,7 @@
146148
| logs Retrieves logs for a given object. |
147149
| notebook Manages notebooks in Snowflake. |
148150
| object Manages Snowflake objects like warehouses and stages |
151+
| remote Manages remote development environments. |
149152
| snowpark Manages procedures and functions. |
150153
| spcs Manages Snowpark Container Services compute pools, |
151154
| services, image registries, and image repositories. |
@@ -229,6 +232,7 @@
229232
| logs Retrieves logs for a given object. |
230233
| notebook Manages notebooks in Snowflake. |
231234
| object Manages Snowflake objects like warehouses and stages |
235+
| remote Manages remote development environments. |
232236
| snowpark Manages procedures and functions. |
233237
| spcs Manages Snowpark Container Services compute pools, services, |
234238
| image registries, and image repositories. |

0 commit comments

Comments
 (0)