Commit Graph

8 Commits

Author SHA1 Message Date
Fraser Waters c2f55f8fd7
Clean up unused import warnings ()
There were a load of warnings such as the below, when building the
protobufs:
```
warning: Import google/protobuf/empty.proto is unused.
```

This removes the unused imports.
2024-03-04 13:01:25 +00:00
Fraser Waters eb4bec4dce
Update node sdk to use typescript definitions for grpc and protobufs. ()
Updates the node SDK to have types for the generated protobufs and grpc
services. No more `any`.

I don't think these types show up on any user facing parts of the SDK.
The two places they could show up are the mock monitor (but I've left
that as any for now) and the provider interfaces (which I've also left
alone for now).

But this fixes up most of our sdk internal code to have types, which
flagged a couple of oddities like assuming `Input<string>` was `string`
in the alias code, and a whole load of missing undefined checks.
2023-12-04 15:22:44 +00:00
Fraser Waters 9ca0fb2b8f
Fix recursive fixups in JavaScript protobuf generation ()
The proto/generate.sh script was trying to do some sed based fixups to
the generated javascript files but wasn't correctly fixing up nested
files.
2023-11-10 13:31:14 +00:00
Fraser Waters 202491bfea
Update grpc-tools and use grpc_js option rather than sed ()
The codegen and test files changed because the old sed script wasn't
correctly fixing up those files, see
https://github.com/pulumi/pulumi/pull/14424 for more on attempting to
fix those scripts. But this gets rid of one of those sed scripts
entirely.
2023-10-27 18:14:20 +00:00
Fraser Waters fd5000b32c Add schema loader service
This moves schema loading out of the language runtimes and over to the
engine host.
Language runtimes no longer need to create a plugin host, or diagnostic
sink either because of this.

All schema loading is done over grpc. This first pass is very basic, and
not expected to be performant but it moves the control of schema loading
to the engine which is necessary for matrix testing.

Testing of this is covered by the convert and code generation smoke tests.
2023-07-27 15:03:52 +01:00
Fraser Waters 8446f2208c Allow mapping requests to install plugins
Enabling fix for https://github.com/pulumi/pulumi-terraform-bridge/issues/1130

This adds two new bits of logic to the plugin mapper.

Firstly when getting a mapping request for a given package X, as well as
searching to see if we have an X plugin already installed to call it's
`GetMapping` method first, we now also try to install X if we don't
already have it. The install failing is not considered an error, we'll
just try the other plugins to see if they map and then possibly return
empty (as before).

Secondly the converter can pass a hint to what the pulumi plugin for the
ecosystem plugin is. If no hint is given we assume the pulumi plugin
name is the same as the ecosystem name. But this can be used for example
in the terraform converter to tell the engine that for example the
terraform provider "azurerm" is called "azure" in pulumi.

The hint is just a hint, if the name doesn't match all the other plugins
will be searched as before.
2023-05-29 14:53:04 +01:00
Fraser Waters 1a38eadc69 gRPC for GenerateProject/Program/Package
This changes codegen to be invoked via gRPC from pkg, rather than
invoking pkg/codegen directly.

Consider it a proof-of-concept for moving codegen to a gRPC interface
without the worries of forwards-backwards compatability (because we ship
language plugins at a fixed version side-by-side to users).
2023-05-06 13:14:59 +01:00
Fraser Waters 02489dbbb7 Add mapping service to converter 2023-03-24 17:09:17 +00:00