Commit graph

18 commits

Author SHA1 Message Date
Justin Van Patten ba39ed9ad4
Add tests that return failures from Call (#8424)
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
- [sdk/go] - Allow specifying Call failures from the provider.
- Add tests that return failures from Call.
2021-11-16 08:58:46 -08:00
Justin Van Patten 10ceee406e
[sdk/nodejs] Unmarshal output values in component provider (#8205)
This adds support for unmarshaling output values in the Node.js provider.
2021-11-15 11:22:44 -08:00
Horace Lee a92a005d68
Use ESlint instead of TSlint (#7719)
Migrated TSlint configs to ESlint ones using [tslint-to-eslint-config](https://github.com/typescript-eslint/tslint-to-eslint-config) tool, and refined the configs to better match the current coding style.

Changes:
- [member-delimiter-style](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md#options) that as suggested default for type definition to be  with `semicolon`
- Indentation fixes that is enforced by [eslint-indent](https://eslint.org/docs/rules/indent#options)
- Added dependencies for ESlint with Typescript
- Removed TSlint
2021-08-10 11:31:59 -07:00
Anton Tayanovskyy babedf5171
Ignore logflow args in Node providers (#7644)
* Ignore logflow args in Node providers

* Add unit test, handle --tracing

* Add missing files

* Add CHANGELOG

* Lint
2021-07-26 19:52:59 -04:00
Justin Van Patten e8bd8e5e1f
Rehydrate provider resources in Construct (#7624)
Previously, any provider resource passed to multi-lang components would be instantiated as a `DependencyProviderResource` inside `Construct`, which prevents the component from being able to easily access the provider's state as an instance of of the provider (e.g. `*aws.Provider`).

This change attempts to rehydrate the provider resource in the same way that resource references are rehydrated, if it's been registered, s.t. the specific provider resource type is instantiated with its state. Otherwise falling back to returning `DependencyProviderResource`.
2021-07-23 14:10:06 -07:00
Justin Van Patten 84b574f0df
Initial support for resource methods (authoring from Node.js, calling from Python) (#7363)
Adds initial support for resource methods (via a new `Call` gRPC method similar to `Invoke`), with support for authoring methods from Node.js, and calling methods from Python.
2021-06-30 07:48:56 -07:00
Evan Boyle c37cbc998b
Fix a hang in nodejs remote components when an error is thrown within an apply (#7365) 2021-06-25 18:41:54 -07:00
Evan Boyle 634e97cd55
Include config secret info in Construct calls (#7358) 2021-06-24 15:38:01 -07:00
Justin Van Patten 48bbc28d9e
[sdk/go] Specify known when creating outputs for construct (#7343)
If an input is an unknown value or contains unknowns, specify `false` for `known` when creating the output.
2021-06-21 09:51:41 -07:00
Justin Van Patten f973fbcf58
[sdk/nodejs|python] Add GetSchema support to providers (#6892) 2021-05-19 07:11:18 -07:00
Justin Van Patten f7cc19f89d
[sdk/nodejs] Keep prompt values prompt in construct (#6522)
In order to support prompt values in multi-lang components, if an input value is prompt, keep it as-is instead of wrapping it in an Output.
2021-04-09 14:36:22 -07:00
Justin Van Patten 394f79f27f
[sdk/nodejs] Fix construct to wait for RPC operations to complete (#6452)
This change fixes the provider implementation of `Construct` for multi-lang components written in Node.js to wait for any in-flight RPCs to finish before returning the results, s.t. all registered child resources are created.

In additional, invocations of `construct` are now serialized so that each call runs one after another, avoiding concurrent runs, since `construct` modifies global state. We'll follow-up with a more general concurrency fix to allow nested `construct` calls within the same provider.
2021-04-05 11:11:27 -07:00
Justin Van Patten 4747be7b9f
[sdk/nodejs] Use log.error to log uncaught errors (#5910)
`log.error` will call the engine's `log` gRPC endpoint (if the engine is available; otherwise it will write to `console.error`) with `LogSeverity.ERROR`, which tell the engine to stop processing further resource operations.

Without this, any uncaught errors (such as input validation errors done inside `apply`) would be written to stderr, but wouldn't actually result in an update error.
2020-12-10 08:53:25 -08:00
Justin Van Patten c27d2921c1
Remove console.log call (#5845)
Remove console.log call that's adding unnecessary diagnostic messages to programs that use multi-lang components.
2020-12-01 16:35:30 -08:00
Justin Van Patten edc79325fe
Add support for getResource to Node.js SDK (#5837)
And update Node's resource ref deserialization to match Python.

Also, fixed a bug in Python resource ref deserialization that I noticed.
2020-12-01 10:58:15 -08:00
Justin Van Patten 4aab74afc7
Fix bug calling Provider.read (#5716)
The call to `read` wasn't passing the URN. Also delete a comment that doesn't apply here.
2020-11-09 08:48:19 -08:00
evanboyle 7d171917ea support inline programs for nodejs automation api 2020-10-08 12:19:01 -07:00
Pat Gavlin 2585b86aa4
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.

Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.

The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.

These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).

An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.

This is the core of #2430.
2020-09-07 19:33:55 -07:00