Commit graph

4322 commits

Author SHA1 Message Date
evanboyle fba783caf9 move pkg/resource -> sdk/go/common/resource, but leave nested resource packages 2020-03-18 13:36:19 -07:00
evanboyle 7ea547a14d move sdk/go/pulumi-language-go -> pkg/cmd/pulumi-language-go 2020-03-18 12:49:56 -07:00
evanboyle b7ea8198de move sdk/dotnet/cmd/pulumi-language-dotnet -> pkg/cmd/pulumi-language-dotnet 2020-03-18 12:45:33 -07:00
evanboyle 6552df7139 fix python sdk Makefile, use common pkg/version.go 2020-03-18 12:33:18 -07:00
evanboyle a73044247e move sdk/nodejs/cmd/pulumi-language-nodejs -> pkg/cmd/pulumi-language-nodejs 2020-03-18 12:25:07 -07:00
evanboyle e2ee46fb23 move sdk/python/cmd/pulumi-language-python -> pkg/cmd/pulumi-language-python 2020-03-18 10:19:22 -07:00
evanboyle a2085dc303 move cmd -> pkg/cmd 2020-03-18 09:03:00 -07:00
Praneet Loke cfcfad2f3c
Fixes for resource docs generator (#4085)
* Generate the constructor params for Python along with other languages.

* Remove redundant py_function_param nested template. Declare a new type for defining property characteristics rather than using inlining formal params. Generate the Lookup functions for all languages similar to the constructor params with linking enabled.

* Fix bug with generating the input arg type name for Functions in Go.

* Add prefix for args param of a Go-based Resource Function.

* Input args for Go-based Functions use Lookup*Args and not Get*Args.

* Turns out that args for Go-based Functions use a different prefix based on whether the function is a package-level or module-level Function.

* Update the Python list and dictionary type names for the resource doc generator.

* Add a separate function for Python doc helper return a type string representing dictionaries that are simple maps and don't have a known nested element type.
2020-03-17 13:37:40 -07:00
Levi Blackstone 655839009a
Update Go SDK generator to support k8s (#4096)
- Add GoInfo struct to improve control of package imports and names
- Fix import recursion bug
- Add support for aliased imports
2020-03-17 14:09:43 -06:00
Levi Blackstone 66126b544e
Test PR 3893 (#4090)
Upgrade to helm 3 in the docker image

Co-authored-by: Harrison Heck <harrison.heck@gmail.com>
2020-03-17 13:35:33 -06:00
Levi Blackstone ee62f38ab9
Add ArrayMap builtin types to Go SDK (#4086)
Add support for maps of arrays of builtin types.
These types are of the form map[string][]builtin.
2020-03-16 20:41:08 -06:00
Levi Blackstone a2cbd6ea9c
Disable staticcheck linting to work around OOM errors (#4091) 2020-03-16 17:41:06 -06:00
Levi Blackstone ad1c884aad
Fix lint issue (#4088)
Linter was complaining about possibly nil dereferences,
but these are already checked with an assertion.
2020-03-16 16:45:02 -06:00
Mikhail Shilkov dbe365376d
Add Stack Transformations to .NET SDK (#4008)
Stack transformations and integration tests
2020-03-16 17:40:52 +01:00
Luke Hoban fdd9a57ff8
Implement GetSchema in dynamic providers (#4083)
It's not entirely clear why gRPC doesn't already report these cleanly as unimplemented, but for now we'll explicitly implement them to avoid any spurious warnings.

Fixes #4028.
2020-03-15 15:36:08 -07:00
Tasia Halim b6e5d2737d
Update Go logging to use LogArgs (#4078) 2020-03-13 13:30:05 -07:00
Pat Gavlin 8111d33438
Shorten Python package descriptions. (#4068)
These descriptions should only be one line, and should not contain markdown.
2020-03-12 21:43:54 -07:00
Luke Hoban 9da774e180
Fix Python mocks (#4074)
The original version of this code caused inconsistencies in the event
loop associated with a given thread. These changes elimintate the event
loop shenanigans the mocks were trying to play by updating _sync_await
to create an event loop if none exists in the current thread.

It's possible that this will cause problems if the tests run on a
different thread than the original program, as the tests are likely to
end up waiting on outputs created by the program, which is not supported
in Python.

Also adds test coverage of the mocking/testing support in Python.
2020-03-12 21:09:47 -07:00
Tasia Halim ef6f0d4de4
Expose engine logging to Go SDK (#4069)
* expose engine logging to Go SDK

* added comments
2020-03-12 16:00:59 -07:00
Praneet Loke 9abc65d3c6
Remove hard-coded Bucket examples from the schema-based docs generator. (#4067)
* Also remove the Examples property from the resourceDocArgs type since the resource Comment will contain the multi-lang examples on their surrounded by a shortcode.
2020-03-12 13:16:08 -07:00
metral aac1fabb13
Merge pull request #4059 from pulumi/metral/fix-login
Improve documentation of URL formats for `pulumi login`
2020-03-12 11:20:04 -07:00
Luke Hoban 2050f64322
Support "link" style dependencies in Go tests (#4063)
The integration test framework currently supports using `dep` for dependency management.

However, `dep` has no native ability to manage "yarn link"-style dependencies on locally available packages.

This is a necessary scenario for testing in most repos though, as (e.g.) examples in the Kubernetes repo need to test against the locally available version of `pulumi-kubernetes`.

The best we can do is a trick of (a) deleting the vendored copy of the locally available dependency (b) copying the locally available dependency into the vendor folder (c) deleting the nested vendor folder in the new copy of the locally available dependency.
2020-03-12 08:49:52 -07:00
Mike Metral cf7169125d
Improve documentation of URL formats for pulumi login 2020-03-11 18:26:47 -07:00
Praneet Loke 40f17faa73
Updates to resource doc generator for generating docs for Functions (#4055)
* Added a new template for Functions. Implement the genFunction method for generating the docs for Functions.

* Rename type resourceArgs to resourceDocArgs. Minor updates the resource template.

* Generate nested types for Functions.

* Unexport types that don't need to be exported. Create the doc language helper objects in an init function and reuse them rather than recreating them every time. Update genNestedTypes to work with schema functions or resources.

* Fixed bug in nested type generation for Functions. Fixed bug in generating input and output doc links for nested types.
2020-03-11 17:58:12 -07:00
Pat Gavlin cbd5f862c3 Update the CHANGELOG for v1.12.1 2020-03-11 15:43:37 -07:00
Pat Gavlin 622cac4dd4
Stabilize Python codegen. (#4056)
Make sure all property casing conversions are computed prior to codegen.
2020-03-11 15:42:15 -07:00
Mikhail Shilkov a95a4d1195
Unit testing in .NET (#3696)
Mock-based testing in .NET
2020-03-11 23:10:01 +01:00
Mikhail Shilkov f01208af3b
Fix terminal keypad mode (#4042)
Fix terminal keypad mode
2020-03-11 08:55:36 +01:00
Luke Hoban 74ffbfd9ba
Ensure new provider is registered when provider diff is unknown (#4051)
The changes in #4004 caused old provider configuration to be used even when a provider was different between inputs and outputs, in the case that the diff returned DiffUnkown.

To better handle that case, we compute a more accurate (but still conservative) DiffNone or DiffSome so that we can ensure we conservatively update to a new provider when needed, but retain the performance benefit of not creating and configuring a new provider as much as possible.

Part of https://github.com/pulumi/pulumi-aws/issues/814.
2020-03-10 19:40:25 -07:00
Paul Stack e229492d8f
Merge pull request #4005 from pulumi/dep-ensure-go-project
Run Dep Ensure when testing Go integration projects
2020-03-10 10:52:58 +02:00
stack72 f11b7129a0 Run Dep Ensure when testing Go integration projects
Fixes: #3939
2020-03-10 03:11:44 +02:00
Paul Stack 4ec9667a9f
Merge pull request #4043 from pulumi/fix-pygen-overlays
Ensure python overlays work as expected
2020-03-10 00:44:11 +02:00
stack72 b100f8494e Ensure python overlays work as expected
Fixes: https://github.com/pulumi/pulumi-terraform-bridge/issues/119

This allows us to specify an overlays block e.g.

```
Overlay: &tfbridge.OverlayInfo{
	DestFiles: []string{
		"pulumi_docker/docker.py",
		"pulumi_docker/image.py",
	},
},
```

The overlays files are treated differently to normal module files
as they are not generated. This structure means that we will emit
the correct entries in the __init__.py file

Without this structure (ie. pulumi_pkgname), the generator actually
copies the file (i.e. docker.py) to the root of the Python SDK. This
is because the structure of the Python SDK has a sub-folder than that
of the NodeJS SDK

I tested this using PR https://github.com/pulumi/pulumi-docker/pull/141
and this now works as expected and we can take advantage of the new
Python overlays for Docker
2020-03-10 00:03:41 +02:00
Praneet Loke edbb05dddd
Update schema-based docs generator (#4035)
* Update properties.tmpl to render property comment as-is. WIP splitting out properties to lang-specific tables.

* Generate the constructor dynamically from the resource per language.

* Add doc functions in each language generator package for getting doc links for types..and later other functions too.

* Render the constructor params in the Go code and inject into the template.

* Generate nodejs types using the nodejs lang generator.

* Add a templates bundler. Added a new Make target for autogenerating a static bundle for the resource docs generator.

* Generate type links for all languages based on their schema type. Render the property type with a link if the underlying elements have a supporting type. Fix word-breaks for Python type names.

* Various changes including the introduction of an interface type under the codegen package to help with generating some language-specific information for the resource docs generator.

* Add a function to explicitly generate links for input types of nested types. Fix the resource doc link generator for Go. Don't replace the module name from the nodejs language type.

* Fix bug with C# property type html encoding.

* Fix some template formatting. Pass the state inputs for Python to generate the lookup function for it.
* Do not generate the examples section if there are none.

* Generating the property types per language.

* Formatting. Rename function for readability.

* Add comments. Update README.

* Use relative URLs for doc links within the main site
2020-03-09 10:35:20 -07:00
Paul Stack 2a24470135
Merge pull request #4030 from pulumi/stack72/allow-go-run-windows
Windows requires applications to have exe extension
2020-03-09 17:36:10 +02:00
Mikhail Shilkov 8f1534c895
Mention mocks in the missing project error (#4041) 2020-03-09 16:23:49 +01:00
Justin Van Patten 80f6c61310
Initial support for configuring policies (#4015) 2020-03-08 14:11:55 -07:00
Evan Boyle 81b6afa3c7
Revert "GetRequiredPlugins for Go (#3830)" (#4034)
This reverts commit 3a2890c0cd.
2020-03-06 17:50:18 -08:00
Pat Gavlin 3a2890c0cd
GetRequiredPlugins for Go (#3830)
These changes implement `GetRequiredPlugins` for Go using a registry
mechanism and an alternate entry point for `pulumi.Run`. Packages that
require plugins are expected to register themselves with the Pulumi SDK.
When `pulumi.Run` is used and the `PULUMI_PLUGINS` envvar is truthy, the
program will dump a JSON-encoded description of its required plugins to
stdout. The language host then uses this description to respond to
`GetRequiredPlugins`.
2020-03-06 14:30:43 -08:00
Evan Boyle e75dca1207
fix reflect panic (#4027) 2020-03-06 11:01:21 -08:00
stack72 7f86842c68 Windows requires applications to have exe extension
We need to ensure that if the pulumi application is prebuild on
Windows then it will have the exe extension otherwise it's not
a valid windows program

https://github.com/golang/go/wiki/WindowsCrossCompiling
2020-03-06 19:58:57 +02:00
Paul Stack d9acfc3190
Merge pull request #4022 from pulumi/stack72/gh-4013
Stop new projects starting with the word Pulumi
2020-03-05 18:22:17 +02:00
stack72 3863c6de1a Stop new projects starting with the word Pulumi
Fixes: #4013

Without this, we are in a situation where we have a cyclic import
2020-03-05 17:43:42 +02:00
Mikhail Shilkov 8e87b2b893
Relax the type check to accomodate what YAML parser returns (#4023)
Relax the type check to accomodate what YAML parser returns
2020-03-05 16:41:31 +01:00
Pat Gavlin dbb5b04d2f Update the CHANGELOG for v1.12.0 2020-03-04 13:35:45 -08:00
Luke Hoban 094df2b794
Merge pull request #4016 from Carlangueitor/fix-typehint-output
Python SDK fix type annotations for `Output.all` and `Output.concat`
2020-03-03 20:32:55 -08:00
Charly Román 560f1f130e Python SDK fix type annotations for Output.all and Output.concat 2020-03-03 22:00:37 -06:00
Evan Boyle 3b8ffd5731
Go SDK fix panic when dest is struct and input is ptr (#3986) 2020-03-03 09:07:06 -08:00
Erin Krengel e9ea78cabb
remove UpdatePolicyPackConfig from UpdatePolicyGroupRequest (#4011) 2020-03-02 15:40:54 -08:00
Justin Van Patten acd6a5e753
Don't mark policy and watch commands as experimental (#4001) 2020-03-02 14:23:40 -08:00