Commit graph

1060 commits

Author SHA1 Message Date
Luke Hoban d68eee6632 Fix test 2020-07-15 15:17:05 -07:00
Luke Hoban b8c864a559 Fix test_custom_resource test
Adapt the test to the (current) breaking change in this PR.
2020-07-15 15:17:05 -07:00
Luke Hoban 9d6edeac1c pylint clean 2020-07-15 15:17:05 -07:00
Luke Hoban 5eda91bb9e More narrowly marshal rich Resources
Only use richer Resource marshalling on the return values from Resource Monitor invokes - to avoid changing behaviour for other cases that may not yet support richer Resources.

Also ensure working directory for `node` process is based on the location of the library being loaded so that modules load correctly.
2020-07-15 15:17:05 -07:00
Luke Hoban e5d6d950a5 Move ProxyComponentResource into Python SDK 2020-07-15 15:16:44 -07:00
Luke Hoban 94f7efcf54 Move ProxyComponentResource into Node SDK 2020-07-15 15:16:44 -07:00
Luke Hoban 8f6a02920e Move some shared pieces into the Node SDK 2020-07-15 15:16:44 -07:00
Luke Hoban c3587ecded Minor code cleanup 2020-07-15 15:16:44 -07:00
Luke Hoban e2d6058d2e Support returning inner resource references 2020-07-15 15:16:44 -07:00
Luke Hoban b3a20dfe47 Remote resource construction working! 2020-07-15 15:16:44 -07:00
Luke Hoban 19c3268f7b Add 'urn' resource option to Python
Initial support for `get_resource`
2020-07-15 15:15:35 -07:00
Luke Hoban 033924efa9 Fix support for returning resources
Remove compatibility fallback for first-class Resources.
2020-07-15 15:10:28 -07:00
Luke Hoban 0c53db0587 Switch to real gRPC interface between host and guest
Introduce a new gRPC service for `runtime`.

Support a single `construct` method on the new gRPC service.

Spawn a separate Node.js process to run the gRPC service, and remote calls to it from the host language runtime `construct` API.
2020-07-15 15:09:34 -07:00
Luke Hoban ddc222d236 Introduce a first class Resource PropertyValue
Wraps a URN, but as a placeholder for a resource that should be re-hydrated on demarshaling.
2020-07-15 15:08:11 -07:00
Luke Hoban b37e47f46f No longer need to skip urn in readStackResource result 2020-07-15 15:04:54 -07:00
Luke Hoban abab631605 Remove deserializeUrns from deserializeProperties
This is now supported in resolveProperties instead.
2020-07-15 15:04:54 -07:00
Luke Hoban 092ee049dc Support customresources as outputs 2020-07-15 15:04:03 -07:00
Luke Hoban c2942c3bcc Support components as outputs 2020-07-15 15:04:03 -07:00
Luke Hoban 0c914ebfb4 A little more cleanup 2020-07-15 14:36:01 -07:00
Luke Hoban e8242bca33 Initial example working 2020-07-15 14:36:01 -07:00
Luke Hoban a41316d5b7 WIP 2020-07-15 14:36:01 -07:00
Komal f364311064
Remove known_types decorators (#4980) 2020-07-13 12:27:00 -07:00
Levi Blackstone 736019f7ce
Add support for streamInvoke during update (#4990)
Previously, streamInvoke was only supported by
the query command. Copied the implementation
into the resource monitor, which will allow
streaming invoke commands to run during updates.

Also fixed a bug with cancellation of streaming
invokes. The check was comparing against a
hardcoded string, which did not match the actual
error string. Instead, we can rely on the error code.
2020-07-10 10:56:35 -06:00
Komal bdc86e002a
Change how submodules are imported to work with Intellisense (#4948) 2020-07-08 18:34:59 -07:00
Pat Gavlin 2119601023
Implement PropertyPath.Add. (#4976)
This function adds a property value to another property at a given path,
creating containing properties as required. If the property cannot be
added because of a mismatch between the value types required by the path
and the values present in the destination, the add will fail. If a value
already exists at the given path, the add will succeed.

Related to #1635.
2020-07-07 14:45:36 -07:00
Paul Stack 57b91d553e
Adding the ability to specify a version as a ResourceOption (#4945) 2020-07-07 20:20:01 +01:00
Pat Gavlin a8a20ecb4b
[codegen/*] Add support for explicit secrets. (#4927)
- Add a new builtin function, secret, that marks its input value as
  secret
- Add support for this function to the various code generators

Fixes #4924.
2020-06-30 11:35:24 -07:00
Levi Blackstone 8961f5b0ca
Rename RetrieveTemplate function to RetrieveGitFolder (#4912)
The new name better reflects the functionality for external
consumers of this package.
2020-06-26 15:01:51 -06:00
Evan Boyle 2351fc66cf
Go SDK interfaces should declare impl of Ptr types where appropriate (#4911) 2020-06-26 11:25:53 -07:00
Komal ed752bc384
[codegen/python] Don't use __all__ (#4873) 2020-06-24 11:41:03 -07:00
Justin Van Patten 6bad3a3620
Exclude grpcio v1.30.0, which breaks Pulumi Python programs (#4883) 2020-06-24 08:11:05 -07:00
Pat Gavlin 3e6e28af36
Fix lint errors. (#4856)
These errors appear when using golangci-lint 1.27.0.
2020-06-18 14:17:11 -07:00
Paul Stack e20e6831a0
Merge pull request #4844 from pulumi/fix-package-refs
Ensuring references to v2 pulumi packages are up to date
2020-06-18 00:35:27 +01:00
Levi Blackstone 19a113de7a
Handle invalid UTF-8 characters before RPC calls (#4816)
Several users reported cases where error messages would
cause a panic if they contained accented characters. I wasn't
able to reproduce this failure locally, but tracked down the
panic to logging gRPC calls. The Message field is typed as
a string, which requires all of the characters to be valid UTF-8.

This change runs each log string through the strings.ToValidUTF8
function, which will replace any invalid characters with the
"unknown" character. This should prevent the the logger from
panicking.
2020-06-17 13:30:59 -06:00
stack72 9e33449245 Ensuring references to v2 pulumi packages are up to date 2020-06-17 14:54:05 +03:00
Praneet Loke 2513709089
Use the GH webhook payload to parse PR details when CI system is GH Actions (#4817)
* Read the file and parse it. Also use the PR Head SHA instead of the GITHUB_REF if the build type is pull_request.

* Update changelog
2020-06-15 12:49:09 -07:00
Evan Boyle fa69a31c97
Set default namespace for go config for config-less get/try/require (#4802) 2020-06-12 16:35:06 -07:00
Justin Van Patten 9b0169be35
Fix pylint(no-member) when accessing resource.id (#4813)
Pylint currently reports `E1101: Instance of 'Bucket' has no 'id' member (no-member)` on lines in Pulumi Python programs like:

```python
pulumi.export('bucket_name', bucket.id)
```

Here's a description of this message from http://pylint-messages.wikidot.com/messages:e1101:

> Used when an object (variable, function, …) is accessed for a non-existent member.
>
> False positives: This message may report object members that are created dynamically, but exist at the time they are accessed.

This appears to be a false positive case: `id` isn't set in the constructor (it's set later in `register_resource`) and Pylint isn't able to figure this out statically. `urn` has the same problem. (Oddly, Pylint doesn't complain when accessing other resource output properties).

This change refactors `register_resource` so that `id` and `urn` can be assigned in the resource's constructor, so that Pylint can see it being assigned. The change also does the same with `read_resource`.
2020-06-12 12:41:56 -07:00
Evan Boyle 3d2df8992f
Use appropriate types for go config methods (#4800) 2020-06-10 18:24:05 -07:00
Justin Van Patten b77ec919d4
Install and use dependencies automatically for new Python projects (#4775)
Automatically create a virtual environment and install dependencies in it with `pulumi new` and `pulumi policy new` for Python templates.

This will save a new `virtualenv` runtime option in `Pulumi.yaml` (`PulumiPolicy.yaml` for policy packs):

```yaml
runtime:
  name: python
  options:
    virtualenv: venv
```

`virtualenv` is the path to a virtual environment that Pulumi will use when running `python` commands.

Existing projects are unaffected and can opt-in to using this by setting `virtualenv`, otherwise, they'll continue to work as-is.
2020-06-09 16:42:53 -07:00
Praneet Loke 407896730c
Add GitHub Actions detection and update the Pulumi CI escape hatch with more CI vars (#4758)
* Add GitHub Actions detection. Update the Pulumi CI escape hatch with more CI vars.
2020-06-08 17:24:12 -07:00
Luke Hoban 678a5a6d3e
Export the CustomTimeouts class (#4747)
This class was available in the pulumi.resource module, but was not exported from the core `pulumi` module as intended for all public APIs at this level.
2020-06-03 15:36:44 -07:00
Lee Zen 0dac22c360
Escape the path to ensure we fetch plugins correctly (#4733) 2020-05-29 14:59:25 -07:00
Paul Stack 45e1917a30
Upgrade to Go 1.14.x (#4697) 2020-05-28 12:01:33 +01:00
Tomas Jansson 1bdfd3dd41
Add F# operators for InputUnion (#4699) 2020-05-26 14:18:56 +02:00
Chris Smith f613b6917b
Download plugins from get.pulumi.com (#4692)
* Remove long-since deprecated --cloud-url flag

* Download plugins from get.pulumi.com

* Update CHANGELOG.md

* Use more straight forward TrimSuffix
2020-05-25 09:16:57 -07:00
Justin Van Patten 6b0a845cc1
Support publishing Python policy packs (#4644)
Adds support for publishing Python policy packs to the service, and downloading/using such policy packs when applied to stacks in an organization.
2020-05-22 15:01:15 -07:00
Justin Van Patten af3d4b890d
Allow pulumi.export calls from unit tests (#4670)
The previous attempt to allow this didn't actually allow it, so this is
take two. As part of the previous attempt, I thought after tweaking the
test I had observed the test failing, and then succeeding after making
the product changes, but I must have been mistaken.

It turns out that our existing mocks tests weren't running at all
because of a missing `__init__.py` file. Once the missing `__init__.py`
is added, the tests run, but other tests ("test mode" tests) fail
because the code that creates the mocks and resources will run during
test discovery, and setting the mocks modifies global state.

To address the test issue, I've moved the mocks tests into their own
`test_with_mocks` package that can be run separately from other tests.

And addressed the original issue, by creating a root Stack resource if
one isn't already present when the mocks are set.
2020-05-20 09:54:40 -07:00
Evan Boyle 20452b9cb5
fix dotnet error (#4668) 2020-05-19 12:06:24 -07:00
Mikhail Shilkov 5b0c4e162d
Fix NRE in C# mocks and include the stack to result again (#4656)
Fix NRE in C# mocks and include the stack to result again
2020-05-18 17:18:12 +02:00