From 56e12e9140b5a7ec41aa7215588685b1ca8db889 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Thu, 6 Oct 2022 18:40:02 -0700 Subject: [PATCH 01/12] Add new install plugin from server function --- sdk/go/auto/example_test.go | 7 +++++++ sdk/go/auto/local_workspace.go | 9 +++++++++ sdk/go/auto/workspace.go | 2 ++ sdk/nodejs/automation/localWorkspace.ts | 12 ++++++++++++ sdk/nodejs/tests/automation/localWorkspace.spec.ts | 1 + sdk/python/lib/pulumi/automation/_local_workspace.py | 3 +++ 6 files changed, 34 insertions(+) diff --git a/sdk/go/auto/example_test.go b/sdk/go/auto/example_test.go index ea41b1b5465b..9cd9e7f3f0be 100644 --- a/sdk/go/auto/example_test.go +++ b/sdk/go/auto/example_test.go @@ -368,6 +368,13 @@ func ExampleLocalWorkspace_InstallPlugin() { w.InstallPlugin(ctx, "aws", "v3.2.0") } +func ExampleLocalWorkspace_InstallPluginFromServer() { + ctx := context.Background() + // create a workspace from a local project + w, _ := NewLocalWorkspace(ctx, WorkDir(filepath.Join(".", "program"))) + w.InstallPluginFromServer(ctx, "scaleway", "v1.2.0", "github://api.github.com/lbrlabs") +} + func ExampleNewLocalWorkspace() { ctx := context.Background() // WorkDir sets the working directory for the LocalWorkspace. The workspace will look for a default diff --git a/sdk/go/auto/local_workspace.go b/sdk/go/auto/local_workspace.go index 15aae0f6c44c..ac6f27b0293c 100644 --- a/sdk/go/auto/local_workspace.go +++ b/sdk/go/auto/local_workspace.go @@ -381,6 +381,15 @@ func (l *LocalWorkspace) InstallPlugin(ctx context.Context, name string, version return nil } +// InstallPluginFromServer acquires the plugin matching the specified name and version from a third party server. +func (l *LocalWorkspace) InstallPluginFromServer(ctx context.Context, name string, version string, server string) error { + stdout, stderr, errCode, err := l.runPulumiCmdSync(ctx, "plugin", "install", "resource", name, version, "--server", server) + if err != nil { + return newAutoError(errors.Wrap(err, "failed to install plugin"), stdout, stderr, errCode) + } + return nil +} + // RemovePlugin deletes the plugin matching the specified name and verision. func (l *LocalWorkspace) RemovePlugin(ctx context.Context, name string, version string) error { stdout, stderr, errCode, err := l.runPulumiCmdSync(ctx, "plugin", "rm", "resource", name, version, "--yes") diff --git a/sdk/go/auto/workspace.go b/sdk/go/auto/workspace.go index 201f2a437bb7..877553cd235a 100644 --- a/sdk/go/auto/workspace.go +++ b/sdk/go/auto/workspace.go @@ -92,6 +92,8 @@ type Workspace interface { ListStacks(context.Context) ([]StackSummary, error) // InstallPlugin acquires the plugin matching the specified name and version. InstallPlugin(context.Context, string, string) error + // InstallPluginFromServer acquires the plugin matching the specified name and version. + InstallPluginFromServer(context.Context, string, string, string) error // RemovePlugin deletes the plugin matching the specified name and version. RemovePlugin(context.Context, string, string) error // ListPlugins lists all installed plugins. diff --git a/sdk/nodejs/automation/localWorkspace.ts b/sdk/nodejs/automation/localWorkspace.ts index 829f1fdb3c80..b4504b737090 100644 --- a/sdk/nodejs/automation/localWorkspace.ts +++ b/sdk/nodejs/automation/localWorkspace.ts @@ -495,6 +495,17 @@ export class LocalWorkspace implements Workspace { async installPlugin(name: string, version: string, kind = "resource"): Promise { await this.runPulumiCmd(["plugin", "install", kind, name, version]); } + /** + * Installs a plugin in the Workspace, from a third party server. + * + * @param name the name of the plugin. + * @param version the version of the plugin e.g. "v1.0.0". + * @param kind the kind of plugin, defaults to "resource" + * @param server the server to install the plugin from + */ + async installPluginFromServer(name: string, version: string, kind = "resource", server: string): Promise { + await this.runPulumiCmd(["plugin", "install", kind, name, version, "--server", server]); + } /** * Removes a plugin from the Workspace matching the specified name and version. * @@ -514,6 +525,7 @@ export class LocalWorkspace implements Workspace { args.push("--yes"); await this.runPulumiCmd(args); } + /** * Returns a list of all plugins installed in the Workspace. */ diff --git a/sdk/nodejs/tests/automation/localWorkspace.spec.ts b/sdk/nodejs/tests/automation/localWorkspace.spec.ts index 95cebf85961a..9eb51d233fc4 100644 --- a/sdk/nodejs/tests/automation/localWorkspace.spec.ts +++ b/sdk/nodejs/tests/automation/localWorkspace.spec.ts @@ -57,6 +57,7 @@ describe("LocalWorkspace", () => { it(`adds/removes/lists plugins successfully`, asyncTest(async () => { const ws = await LocalWorkspace.create({}); await ws.installPlugin("aws", "v3.0.0"); + await ws.installPluginFromServer("scaleway", "v1.2.0", "resource", "github://api.github.com/lbrlabs"); await ws.removePlugin("aws", "3.0.0"); await ws.listPlugins(); })); diff --git a/sdk/python/lib/pulumi/automation/_local_workspace.py b/sdk/python/lib/pulumi/automation/_local_workspace.py index 84e68373da67..b71fa701bba9 100644 --- a/sdk/python/lib/pulumi/automation/_local_workspace.py +++ b/sdk/python/lib/pulumi/automation/_local_workspace.py @@ -301,6 +301,9 @@ def list_stacks(self) -> List[StackSummary]: def install_plugin(self, name: str, version: str, kind: str = "resource") -> None: self._run_pulumi_cmd_sync(["plugin", "install", kind, name, version]) + + def install_plugin_from_server(self, name: str, version: str, kind: str = "resource", server: str) -> None: + self._run_pulumi_cmd_sync(["plugin", "install", kind, name, version, "--server", server]) def remove_plugin( self, From cd442d1e2294797432ede001d6761969a80b56e7 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 11 Oct 2022 07:51:32 -0700 Subject: [PATCH 02/12] remove default kind from plugin commands --- sdk/nodejs/automation/localWorkspace.ts | 13 ++++++------- sdk/nodejs/tests/automation/localWorkspace.spec.ts | 2 +- .../lib/pulumi/automation/_local_workspace.py | 11 +++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/sdk/nodejs/automation/localWorkspace.ts b/sdk/nodejs/automation/localWorkspace.ts index b4504b737090..7f73991468c8 100644 --- a/sdk/nodejs/automation/localWorkspace.ts +++ b/sdk/nodejs/automation/localWorkspace.ts @@ -492,8 +492,8 @@ export class LocalWorkspace implements Workspace { * @param version the version of the plugin e.g. "v1.0.0". * @param kind the kind of plugin, defaults to "resource" */ - async installPlugin(name: string, version: string, kind = "resource"): Promise { - await this.runPulumiCmd(["plugin", "install", kind, name, version]); + async installPlugin(name: string, version: string): Promise { + await this.runPulumiCmd(["plugin", "install", "resource", name, version]); } /** * Installs a plugin in the Workspace, from a third party server. @@ -503,8 +503,8 @@ export class LocalWorkspace implements Workspace { * @param kind the kind of plugin, defaults to "resource" * @param server the server to install the plugin from */ - async installPluginFromServer(name: string, version: string, kind = "resource", server: string): Promise { - await this.runPulumiCmd(["plugin", "install", kind, name, version, "--server", server]); + async installPluginFromServer(name: string, version: string, server: string): Promise { + await this.runPulumiCmd(["plugin", "install", "resource", name, version, "--server", server]); } /** * Removes a plugin from the Workspace matching the specified name and version. @@ -514,8 +514,8 @@ export class LocalWorkspace implements Workspace { * e.g. "1.0.0", ">1.0.0". * @param kind he kind of plugin, defaults to "resource". */ - async removePlugin(name?: string, versionRange?: string, kind = "resource"): Promise { - const args = ["plugin", "rm", kind]; + async removePlugin(name?: string, versionRange?: string): Promise { + const args = ["plugin", "rm", "resource"]; if (name) { args.push(name); } @@ -525,7 +525,6 @@ export class LocalWorkspace implements Workspace { args.push("--yes"); await this.runPulumiCmd(args); } - /** * Returns a list of all plugins installed in the Workspace. */ diff --git a/sdk/nodejs/tests/automation/localWorkspace.spec.ts b/sdk/nodejs/tests/automation/localWorkspace.spec.ts index 9eb51d233fc4..737106969fc3 100644 --- a/sdk/nodejs/tests/automation/localWorkspace.spec.ts +++ b/sdk/nodejs/tests/automation/localWorkspace.spec.ts @@ -57,7 +57,7 @@ describe("LocalWorkspace", () => { it(`adds/removes/lists plugins successfully`, asyncTest(async () => { const ws = await LocalWorkspace.create({}); await ws.installPlugin("aws", "v3.0.0"); - await ws.installPluginFromServer("scaleway", "v1.2.0", "resource", "github://api.github.com/lbrlabs"); + await ws.installPluginFromServer("scaleway", "v1.2.0", "github://api.github.com/lbrlabs"); await ws.removePlugin("aws", "3.0.0"); await ws.listPlugins(); })); diff --git a/sdk/python/lib/pulumi/automation/_local_workspace.py b/sdk/python/lib/pulumi/automation/_local_workspace.py index b71fa701bba9..fa274d9e0de0 100644 --- a/sdk/python/lib/pulumi/automation/_local_workspace.py +++ b/sdk/python/lib/pulumi/automation/_local_workspace.py @@ -299,19 +299,18 @@ def list_stacks(self) -> List[StackSummary]: stack_list.append(stack) return stack_list - def install_plugin(self, name: str, version: str, kind: str = "resource") -> None: - self._run_pulumi_cmd_sync(["plugin", "install", kind, name, version]) + def install_plugin(self, name: str, version: str) -> None: + self._run_pulumi_cmd_sync(["plugin", "install", "resource", name, version]) - def install_plugin_from_server(self, name: str, version: str, kind: str = "resource", server: str) -> None: - self._run_pulumi_cmd_sync(["plugin", "install", kind, name, version, "--server", server]) + def install_plugin_from_server(self, name: str, version: str, server: str) -> None: + self._run_pulumi_cmd_sync(["plugin", "install", "resource", name, version, "--server", server]) def remove_plugin( self, name: Optional[str] = None, version_range: Optional[str] = None, - kind: str = "resource", ) -> None: - args = ["plugin", "rm", kind] + args = ["plugin", "rm", "resource"] if name: args.append(name) if version_range: From 5ee3e547dc9c6d2a0e818d19d1a3ed578e903e3d Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 11 Oct 2022 10:53:00 -0700 Subject: [PATCH 03/12] fix linting errors --- sdk/go/auto/local_workspace.go | 3 ++- sdk/python/lib/pulumi/automation/_local_workspace.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/go/auto/local_workspace.go b/sdk/go/auto/local_workspace.go index ac6f27b0293c..cbf6a13372b0 100644 --- a/sdk/go/auto/local_workspace.go +++ b/sdk/go/auto/local_workspace.go @@ -383,7 +383,8 @@ func (l *LocalWorkspace) InstallPlugin(ctx context.Context, name string, version // InstallPluginFromServer acquires the plugin matching the specified name and version from a third party server. func (l *LocalWorkspace) InstallPluginFromServer(ctx context.Context, name string, version string, server string) error { - stdout, stderr, errCode, err := l.runPulumiCmdSync(ctx, "plugin", "install", "resource", name, version, "--server", server) + stdout, stderr, errCode, err := l.runPulumiCmdSync( + ctx, "plugin", "install", "resource", name, version, "--server", server) if err != nil { return newAutoError(errors.Wrap(err, "failed to install plugin"), stdout, stderr, errCode) } diff --git a/sdk/python/lib/pulumi/automation/_local_workspace.py b/sdk/python/lib/pulumi/automation/_local_workspace.py index fa274d9e0de0..122bd831ff15 100644 --- a/sdk/python/lib/pulumi/automation/_local_workspace.py +++ b/sdk/python/lib/pulumi/automation/_local_workspace.py @@ -301,9 +301,11 @@ def list_stacks(self) -> List[StackSummary]: def install_plugin(self, name: str, version: str) -> None: self._run_pulumi_cmd_sync(["plugin", "install", "resource", name, version]) - + def install_plugin_from_server(self, name: str, version: str, server: str) -> None: - self._run_pulumi_cmd_sync(["plugin", "install", "resource", name, version, "--server", server]) + self._run_pulumi_cmd_sync( + ["plugin", "install", "resource", name, version, "--server", server] + ) def remove_plugin( self, From 886c3230407a92ab4967c34a2547e80c361be556 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 11 Oct 2022 11:03:03 -0700 Subject: [PATCH 04/12] more linting failure fixes --- sdk/go/auto/local_workspace.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/go/auto/local_workspace.go b/sdk/go/auto/local_workspace.go index cbf6a13372b0..00e08c878509 100644 --- a/sdk/go/auto/local_workspace.go +++ b/sdk/go/auto/local_workspace.go @@ -382,7 +382,12 @@ func (l *LocalWorkspace) InstallPlugin(ctx context.Context, name string, version } // InstallPluginFromServer acquires the plugin matching the specified name and version from a third party server. -func (l *LocalWorkspace) InstallPluginFromServer(ctx context.Context, name string, version string, server string) error { +func (l *LocalWorkspace) InstallPluginFromServer( + ctx context.Context, + name string, + version string, + server string, +) error { stdout, stderr, errCode, err := l.runPulumiCmdSync( ctx, "plugin", "install", "resource", name, version, "--server", server) if err != nil { From 9f724882fab3e53b693fe0467ddbe9c75a6ccc62 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Tue, 11 Oct 2022 13:17:10 -0700 Subject: [PATCH 05/12] add GITHUB_TOKEN env var for tests --- .github/workflows/ci-run-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-run-test.yml b/.github/workflows/ci-run-test.yml index 9d8589e424b4..dc8c27976c66 100644 --- a/.github/workflows/ci-run-test.yml +++ b/.github/workflows/ci-run-test.yml @@ -305,6 +305,7 @@ jobs: env: PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Convert Node coverage data if: ${{ inputs.platform != 'windows-latest' }} run: | From a10f380056334ce63baf20ea135c6fb60cbe2d14 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Wed, 12 Oct 2022 11:16:52 -0700 Subject: [PATCH 06/12] cl entry --- .../pending/20221012--auto--pluginfromserver.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 changelog/pending/20221012--auto--pluginfromserver.yaml diff --git a/changelog/pending/20221012--auto--pluginfromserver.yaml b/changelog/pending/20221012--auto--pluginfromserver.yaml new file mode 100644 index 000000000000..41923b6cac35 --- /dev/null +++ b/changelog/pending/20221012--auto--pluginfromserver.yaml @@ -0,0 +1,10 @@ +changes: +- type: feat + scope: auto/go + description: Add InstallPluginFromServer method +- type: feat + scope: auto/nodejs + description: Add InstallPluginFromServer +- type: feat + scope: auto/python + description: Add install_plugin_from_server From 00366a158cb8657d05077133703c7995b91b102f Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Thu, 13 Oct 2022 11:20:49 -0700 Subject: [PATCH 07/12] disable local plugin test --- sdk/nodejs/tests/automation/localWorkspace.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/nodejs/tests/automation/localWorkspace.spec.ts b/sdk/nodejs/tests/automation/localWorkspace.spec.ts index 737106969fc3..89a50422ab5d 100644 --- a/sdk/nodejs/tests/automation/localWorkspace.spec.ts +++ b/sdk/nodejs/tests/automation/localWorkspace.spec.ts @@ -57,7 +57,8 @@ describe("LocalWorkspace", () => { it(`adds/removes/lists plugins successfully`, asyncTest(async () => { const ws = await LocalWorkspace.create({}); await ws.installPlugin("aws", "v3.0.0"); - await ws.installPluginFromServer("scaleway", "v1.2.0", "github://api.github.com/lbrlabs"); + // See https://github.com/pulumi/pulumi/issues/11013 for why this is disabled + //await ws.installPluginFromServer("scaleway", "v1.2.0", "github://api.github.com/lbrlabs"); await ws.removePlugin("aws", "3.0.0"); await ws.listPlugins(); })); From 145be00e4481e69b7497aeb4e1487b4d254adfdf Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Fri, 14 Oct 2022 08:12:12 -0700 Subject: [PATCH 08/12] remove trailing spaces --- sdk/nodejs/tests/automation/localWorkspace.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/nodejs/tests/automation/localWorkspace.spec.ts b/sdk/nodejs/tests/automation/localWorkspace.spec.ts index 89a50422ab5d..48a5e268db91 100644 --- a/sdk/nodejs/tests/automation/localWorkspace.spec.ts +++ b/sdk/nodejs/tests/automation/localWorkspace.spec.ts @@ -58,7 +58,7 @@ describe("LocalWorkspace", () => { const ws = await LocalWorkspace.create({}); await ws.installPlugin("aws", "v3.0.0"); // See https://github.com/pulumi/pulumi/issues/11013 for why this is disabled - //await ws.installPluginFromServer("scaleway", "v1.2.0", "github://api.github.com/lbrlabs"); + //await ws.installPluginFromServer("scaleway", "v1.2.0", "github://api.github.com/lbrlabs"); await ws.removePlugin("aws", "3.0.0"); await ws.listPlugins(); })); From bbe62900becde7b4968873be8e49b74e8e7dc4c9 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Mon, 17 Oct 2022 16:59:17 -0700 Subject: [PATCH 09/12] update superclass --- sdk/python/lib/pulumi/automation/_workspace.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/python/lib/pulumi/automation/_workspace.py b/sdk/python/lib/pulumi/automation/_workspace.py index 2b0669d363ce..4796a5e3ce1b 100644 --- a/sdk/python/lib/pulumi/automation/_workspace.py +++ b/sdk/python/lib/pulumi/automation/_workspace.py @@ -316,7 +316,7 @@ def list_stacks(self) -> List[StackSummary]: """ @abstractmethod - def install_plugin(self, name: str, version: str, kind: str = "resource") -> None: + def install_plugin(self, name: str, version: str) -> None: """ Installs a plugin in the Workspace, for example to use cloud providers like AWS or GCP. @@ -330,7 +330,6 @@ def remove_plugin( self, name: Optional[str] = None, version_range: Optional[str] = None, - kind: str = "resource", ) -> None: """ Removes a plugin from the Workspace matching the specified name and version. From 979cb865c833cbd1cf4b1938f24058486ec93018 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Fri, 21 Oct 2022 09:29:59 -0700 Subject: [PATCH 10/12] readd default resource kind to ts and python sdks --- sdk/nodejs/automation/localWorkspace.ts | 4 ++-- sdk/nodejs/automation/workspace.ts | 10 +++++++++- sdk/python/lib/pulumi/automation/_local_workspace.py | 4 ++-- sdk/python/lib/pulumi/automation/_workspace.py | 12 +++++++++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/sdk/nodejs/automation/localWorkspace.ts b/sdk/nodejs/automation/localWorkspace.ts index 7f73991468c8..44dcad318f7f 100644 --- a/sdk/nodejs/automation/localWorkspace.ts +++ b/sdk/nodejs/automation/localWorkspace.ts @@ -492,8 +492,8 @@ export class LocalWorkspace implements Workspace { * @param version the version of the plugin e.g. "v1.0.0". * @param kind the kind of plugin, defaults to "resource" */ - async installPlugin(name: string, version: string): Promise { - await this.runPulumiCmd(["plugin", "install", "resource", name, version]); + async installPlugin(name: string, version: string, kind = "resource"): Promise { + await this.runPulumiCmd(["plugin", "install", kind, name, version]); } /** * Installs a plugin in the Workspace, from a third party server. diff --git a/sdk/nodejs/automation/workspace.ts b/sdk/nodejs/automation/workspace.ts index 7088e9ac43a8..0f54ef064168 100644 --- a/sdk/nodejs/automation/workspace.ts +++ b/sdk/nodejs/automation/workspace.ts @@ -178,7 +178,15 @@ export interface Workspace { * @param version the version of the plugin e.g. "v1.0.0". * @param kind the kind of plugin e.g. "resource" */ - installPlugin(name: string, version: string, kind?: string): Promise; + installPluginFromServer(name: string, version: string, server: string): Promise; + /** + * Installs a plugin in the Workspace from a remote server, for example a third party plugin. + * + * @param name the name of the plugin. + * @param version the version of the plugin e.g. "v1.0.0". + * @param server the server to install the plugin into + */ + installPlugin(name: string, version: string, kind?: string): Promise; /** * Removes a plugin from the Workspace matching the specified name and version. * diff --git a/sdk/python/lib/pulumi/automation/_local_workspace.py b/sdk/python/lib/pulumi/automation/_local_workspace.py index 122bd831ff15..46e1f03ede4f 100644 --- a/sdk/python/lib/pulumi/automation/_local_workspace.py +++ b/sdk/python/lib/pulumi/automation/_local_workspace.py @@ -299,8 +299,8 @@ def list_stacks(self) -> List[StackSummary]: stack_list.append(stack) return stack_list - def install_plugin(self, name: str, version: str) -> None: - self._run_pulumi_cmd_sync(["plugin", "install", "resource", name, version]) + def install_plugin(self, name: str, version: str, kind: str = "resource") -> None: + self._run_pulumi_cmd_sync(["plugin", "install", kind, name, version]) def install_plugin_from_server(self, name: str, version: str, server: str) -> None: self._run_pulumi_cmd_sync( diff --git a/sdk/python/lib/pulumi/automation/_workspace.py b/sdk/python/lib/pulumi/automation/_workspace.py index 4796a5e3ce1b..58e00071c23e 100644 --- a/sdk/python/lib/pulumi/automation/_workspace.py +++ b/sdk/python/lib/pulumi/automation/_workspace.py @@ -316,7 +316,7 @@ def list_stacks(self) -> List[StackSummary]: """ @abstractmethod - def install_plugin(self, name: str, version: str) -> None: + def install_plugin(self, name: str, version: str, kind: str = "resource") -> None: """ Installs a plugin in the Workspace, for example to use cloud providers like AWS or GCP. @@ -325,6 +325,16 @@ def install_plugin(self, name: str, version: str) -> None: :param kind: The kind of plugin. """ + @abstractmethod + def install_plugin_from_server(self, name: str, version: str, server: str) -> None: + """ + Installs a plugin in the Workspace from a remote server, for example a third party plugin. + + :param name: The name of the plugin to install. + :param version: The version to install. + :param server: The server to install from. + """ + @abstractmethod def remove_plugin( self, From beca3116b62369f9a462c12261dc169d48b0c122 Mon Sep 17 00:00:00 2001 From: Lee Briggs Date: Fri, 21 Oct 2022 16:51:19 -0700 Subject: [PATCH 11/12] lint --- .github/workflows/ci-run-test.yml | 1 - sdk/nodejs/automation/workspace.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-run-test.yml b/.github/workflows/ci-run-test.yml index dc8c27976c66..9d8589e424b4 100644 --- a/.github/workflows/ci-run-test.yml +++ b/.github/workflows/ci-run-test.yml @@ -305,7 +305,6 @@ jobs: env: PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Convert Node coverage data if: ${{ inputs.platform != 'windows-latest' }} run: | diff --git a/sdk/nodejs/automation/workspace.ts b/sdk/nodejs/automation/workspace.ts index 0f54ef064168..e65f13dc20cb 100644 --- a/sdk/nodejs/automation/workspace.ts +++ b/sdk/nodejs/automation/workspace.ts @@ -186,7 +186,7 @@ export interface Workspace { * @param version the version of the plugin e.g. "v1.0.0". * @param server the server to install the plugin into */ - installPlugin(name: string, version: string, kind?: string): Promise; + installPlugin(name: string, version: string, kind?: string): Promise; /** * Removes a plugin from the Workspace matching the specified name and version. * From 662229e485cc37488f7e47f2fdf77081eb0dc62f Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Sun, 23 Oct 2022 19:34:28 +0100 Subject: [PATCH 12/12] Reinstate kind in remove_plugin for backcompat --- sdk/nodejs/automation/localWorkspace.ts | 4 ++-- sdk/python/lib/pulumi/automation/_local_workspace.py | 3 ++- sdk/python/lib/pulumi/automation/_workspace.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/nodejs/automation/localWorkspace.ts b/sdk/nodejs/automation/localWorkspace.ts index 44dcad318f7f..62d65ac6ea4c 100644 --- a/sdk/nodejs/automation/localWorkspace.ts +++ b/sdk/nodejs/automation/localWorkspace.ts @@ -514,8 +514,8 @@ export class LocalWorkspace implements Workspace { * e.g. "1.0.0", ">1.0.0". * @param kind he kind of plugin, defaults to "resource". */ - async removePlugin(name?: string, versionRange?: string): Promise { - const args = ["plugin", "rm", "resource"]; + async removePlugin(name?: string, versionRange?: string, kind = "resource"): Promise { + const args = ["plugin", "rm", kind]; if (name) { args.push(name); } diff --git a/sdk/python/lib/pulumi/automation/_local_workspace.py b/sdk/python/lib/pulumi/automation/_local_workspace.py index 46e1f03ede4f..dbdc64f64e29 100644 --- a/sdk/python/lib/pulumi/automation/_local_workspace.py +++ b/sdk/python/lib/pulumi/automation/_local_workspace.py @@ -311,8 +311,9 @@ def remove_plugin( self, name: Optional[str] = None, version_range: Optional[str] = None, + kind: str = "resource", ) -> None: - args = ["plugin", "rm", "resource"] + args = ["plugin", "rm", kind] if name: args.append(name) if version_range: diff --git a/sdk/python/lib/pulumi/automation/_workspace.py b/sdk/python/lib/pulumi/automation/_workspace.py index 58e00071c23e..9d1fa870cf2a 100644 --- a/sdk/python/lib/pulumi/automation/_workspace.py +++ b/sdk/python/lib/pulumi/automation/_workspace.py @@ -340,6 +340,7 @@ def remove_plugin( self, name: Optional[str] = None, version_range: Optional[str] = None, + kind: str = "resource", ) -> None: """ Removes a plugin from the Workspace matching the specified name and version.