Commit graph

2184 commits

Author SHA1 Message Date
Chris Smith df1b07b9dc
Add support for a PULUMI_CONSOLE_DOMAIN env var (#4410)
* Add support for a PULUMI_CONSOLE_DOMAIN env var

* Fix typo

* Update CHANGELOG.md

* Fix tests

* Address PR feedback
2020-04-17 11:50:00 -07:00
Chris Smith 2c03c158e2
Annotate .ctor args in docs (#4385)
* Annotate .ctor args in docs

* Update pkg/codegen/docs/gen.go

Co-Authored-By: Praneet Loke <1466314+praneetloke@users.noreply.github.com>

* Mark ctor params as required/optional

* Address PR feedback

* Address PR feedback

Co-authored-by: Praneet Loke <1466314+praneetloke@users.noreply.github.com>
2020-04-17 11:46:02 -07:00
Praneet Loke 78e9621379
[codegen/docs] Allow specifying the languages to show in the lang chooser (#4426)
* Add auto-generated disclaimer for the resource.tmpl as well.

* Allow specifying the languages to show in the lang chooser. Hide the go language for k8s overlay resources.

* Add another exclusion for generating the C# constructor param for k8s overlay resources.

* Replace hard-coded exclusions for skipping input properties with checking for ConstValue attribute of input properties.
2020-04-17 11:45:06 -07:00
Sean Holung 854a1d5758
Add version to package details (#4433) 2020-04-17 11:39:19 -07:00
Pat Gavlin f081d98a39
HCL2: support for tolerating missing variables. (#4430)
When this tolerance is enabled, diagnostics will not be emitted for
missing variables.
2020-04-17 08:24:44 -07:00
Pat Gavlin 398878de31
Various codegen updates. (#4424)
- Define `null` in Pulumi HCL2
- Bind Pulumi HCL2 in topological order s.t. variable types can be
  properly computed
- Fix resources that range over bools and numbers
- Add element, length, lookup, readFile, and split functions
- Do not rewrite function signatures with input types during binding
- Fix splat expression binding for non-lists
- Add support for evaluating expressions
- Add support for operator precedence to code generators
- Add support for constants to the HCL2 IR
- Add support for generating ranged resources in Python
- Add support for generating conditional resource in Node and Python
- Fix various naming issues in Python
2020-04-16 16:44:34 -07:00
stack72 b7da2d8d81 Update pkg/v2 to use sdk/v2.0.0 release 2020-04-16 17:56:05 +01:00
Justin Van Patten 9b0c10c181
Fix number of args expected for policy disable (#4415)
It expects one arg. Currently, we panic if no arg is specified. This fixes that.
2020-04-16 08:56:14 -07:00
Justin Van Patten 7f27618e2d
Avoid replace on second update with import applied (#4403)
After importing some resources, and running a second update with the
import still applied, an unexpected replace would occur. This wouldn't
happen for the vast majority of resources, but for some it would.

It turns out that the resources that trigger this are ones that use a
different format of identifier for the import input than they do for the
ID property.

Before this change, we would trigger an import-replacement when an
existing resource's ID property didn't match the import property, which
would be the case for the small set of resources where the input
identifier is different than the ID property.

To avoid this, we now store the `importID` in the statefile, and
compare that to the import property instead of comparing the ID.
2020-04-15 18:52:40 -07:00
Sean Holung 7834f2fcb2
Generate links for primitive types. (#4386) 2020-04-15 12:56:28 -07:00
Praneet Loke c830017383
[codegen/docs] Cleanup generating links for Pulumi types (#4395)
* Add a method to the DocLanguageHelper interface to get the API doc link for Pulumi types.

* Add a test for Go API doc link methods.

* Use GetDocLinkForPulumiType in gen_function as well.
2020-04-15 11:58:08 -07:00
Mikhail Shilkov 91dce426b2
Use Config.Get for string-based token types in .NET code gen (#4399) 2020-04-15 19:59:02 +02:00
Luke Hoban 39eeaef92d
[codegen] Generate correct links to v>=2 of Go packages (#4346) 2020-04-14 13:59:23 -07:00
Sean Holung dd413723ad
Remove display of optional type identifiers. (#4374) 2020-04-14 13:34:53 -07:00
Mikhail Shilkov 9077292d14
Fix the namespace capitalization in C# codegen (#4392) 2020-04-14 19:53:43 +01:00
stack72 74df34be75 Re-enabling dockerfile latest, docs and homebrew publishing
These had previously been disabled due to the beta releases. Also
fixes an import path for finding an executable
2020-04-14 09:40:11 +01:00
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls (#3750)

* Switch away from native grpc impl. (#3728)

* Remove usage of the 'deasync' library from @pulumi/pulumi. (#3752)

* Only retry as long as we get unavailable back.  Anything else continues. (#3769)

* Handle all errors for now. (#3781)


* Do not assume --yes was present when using pulumi in non-interactive mode (#3793)

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes (#4288)

Adjust C# generation

* Replace IDeployment with a sealed class (#4318)

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty (#4320)

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen (#4379)
2020-04-14 09:30:25 +01:00
Evan Boyle 90ced9574d
fix go config codegen (#4388)
* fix go config codegen

* changelog
2020-04-14 09:24:32 +01:00
Pat Gavlin 51588ede49
Fix various printing issues. (#4378)
- Parentheses were not handled properly
- Literals inside of template control sequences were not handled
  properly

These changes also improve test coverage for the printers.
2020-04-13 19:11:56 -07:00
Praneet Loke 931da8f109
[codegen/docs] Fix Kubernetes resource links for NodeJS and C# constructor params (#4384)
* Fix k8s input type links for constructor args.

* Skip using property case maps for k8s Python.

* Fix the namespace of C# constructor args type and resource type.
2020-04-13 17:27:38 -07:00
Erin Krengel 562d1298f2
fix link to be lowercase (#4382) 2020-04-13 15:48:36 -07:00
stack72 69c804a4e7 Adding system namespace for Dotnet code gen
This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```
2020-04-12 21:37:52 +01:00
Praneet Loke 563233d16c
[codegen/docs] Use the correct module names for languages. (#4367)
* Use the correct module names for languages.

* Add Kubernetes to the title lookup map.

* Add output properties to the map only if filtered output properties is non-zero length.
2020-04-10 18:28:14 -07:00
Sean Holung f28bf6acf5
Remove input props from output properties list (#4360)
* Remove input properties from displaying in output props list
2020-04-10 16:12:05 -07:00
Praneet Loke 729ae08c9d
Handle k8s cases in the resource doc generator (#4337)
* Add a check for the Python code gen to prevent infinte recursion. Remove the custom logic for k8s for generating Python property case maps.

* Fix bug with C# links for k8s constructor resources.

* Apply a style on the deprecation message.

* Use the display name when rendering a property type that does not have a link.

* Fix the python type string generator for docs to inspect union types.

* Update cleanTypeString to account for nodejs package names.

* Add missing lookup names for packages.
2020-04-10 14:07:52 -07:00
Harrison Heck 01d22680d9 fix: error when setting config without value in non-interactive mode 2020-04-10 19:23:32 +01:00
Harrison Heck 5dd669168b fix: remove --show-* as persistent flags 2020-04-10 17:01:12 +01:00
Harrison Heck 7f3ea52202 fix: logging out with filestate when url is deleted 2020-04-10 15:02:24 +01:00
Harrison Heck 43d310ee6d fix: up with refresh with targets not limiting refresh 2020-04-10 15:00:54 +01:00
Pat Gavlin 71aa0f020f
Fix treatment of trivia in template expressions. (#4352)
And improve test coverage for the same.
2020-04-09 16:37:52 -07:00
Evan Boyle c3b2439094
Automate execution of go mod download for pulumi new Go templates (#4353) 2020-04-09 16:16:10 -07:00
Sean Holung 9cd7d7c5c0
Group required resource properties at top of list (#4351) 2020-04-09 15:57:17 -07:00
Sean Holung 7a2f020d2e
Map display names for API Reference TOC menu (#4339) 2020-04-09 09:43:38 -07:00
Levi Blackstone ca6e47277f
Handle const values in Go codegen (#4311) 2020-04-08 10:33:01 -06:00
Pat Gavlin e9d8ccd0cc
Move pulumi cmd sources into cmd/pulumi. (#4324)
Just what it says on the tin.
2020-04-07 15:53:20 -07:00
Praneet Loke efaa026196
Make sure there is a new-line between the package description and the first header on the index page. (#4312) 2020-04-07 12:27:35 -07:00
Pat Gavlin 00f1433706
HCL2/NodeJS: fix proxy apply lowering for promises (#4317)
Applies cannot be proxied when the applied value is a promise.

Fixes #4315.
2020-04-07 09:25:50 -07:00
Pat Gavlin 2f22c1c59c
HCL2 updates (#4309)
Pulumi HCL2 IR:
- Add support for invokes
- Add support for resource options, incl. ranged resources
- Allow the apply rewriter to ignore promise-typed values
- Add tests for the binder
- Add support functions for TF: entries and range

NodeJS codegen:
- Simplify for expression codegen
- Add support for invoke codegen
- Add support for entries and range functions
- Add tests

Python codegen:
- Implement codegen for most expression types
- Add support for invoke codegen
- Add tests
2020-04-06 19:43:16 -07:00
Praneet Loke 50e1086124 Make sure there is a new-line between the package description and the first header on the index page. 2020-04-06 17:43:21 -07:00
Praneet Loke 22aeaa43b1
Move resource docs index file generation to Go templates (#4308)
* Add new templates for generating index files. Remove the now irrelevant code.

* Add comment for generating index files by deduping module names. Use the path format of a module name as the link.

* Add a trailing slash for module links in the index page.

* Move the categories rendered in the index file into their own template file. Handle kubernetes provider specific module name conversion while generating parent modules.

* Fix issue with the k8s provider resource being generated as a module rather than a resource on the package-level index page.

* Show the deprecation message of a resource at the top of the document.

* Move k8s specific things to its own file.

* Add title attribute to the list items. Show the last part of a module name, in case it contains path separators

* Lookup the package name from the Go language info object for k8s then use that to lookup the C# namespace.

* Move the logic for cleaning a property type string for display names to a separate function.

* Export the title function from go and dotnet code generators for use in the resource doc generator. Use the title function from the respective lang code gens to match the correct title case used there. Fix issue with the Kubernetes namespace not being stripped for C# property type strings.

* Skip including apiVersion and kind as input properties for Kubernetes until pulumi-kubernetes#1062 is merged.
2020-04-06 17:01:33 -07:00
Evan Boyle ab659aa0c1
Reimplement getRequiredPlugins for go sdk (#4297) 2020-04-06 12:30:40 -07:00
Lee Zen 4862d73186
Do not show the update version warning with --json flag (#4255)
Co-authored-by: Lee-Ming Zen <lee@pulumi.com>
2020-04-03 14:52:53 -07:00
Praneet Loke ea383991f2
Update resource docs generator to handle some k8s cases (#4270)
* Fix an issue with stripping the module name from type doc links in nodejs.

* Remove unused code that visited object types. Update the nested types code to account for types that may reference themselves. Added glog logging statements. Save the package-level language info objects, so we can use them later.

* Check if a type token has already been added as an input or an output type when collecting nested types.

* Rename appearsIn to typeUsage.

* Scan provider resource also using the special-case function if package is k8s.

* Simplify the display names for Pulumi types by removing the Pulumi prefix.
2020-04-03 11:26:52 -07:00
Pat Gavlin b02a84b8d9
Add a code generator for Python programs. (#4285)
This code generator processes a bound Pulumi program represented using
an HCL2-based IR and converts it to an equivalent Python program.
2020-04-02 23:29:05 -07:00
Pat Gavlin 4ae2867a15
Add a code generator for NodeJS programs. (#4284)
This code generator processes a bound Pulumi program represented using
an HCL2-based IR and converts it to an equivalent NodeJS program.
2020-04-02 23:27:05 -07:00
Pat Gavlin 742c047211 Remove an unused import 2020-04-02 22:09:50 -07:00
Pat Gavlin 1860b4f656 Appease the linter 2020-04-02 21:43:03 -07:00
Pat Gavlin e831ecbc0e Update package references 2020-04-02 21:25:30 -07:00
Pat Gavlin 2f5238f130 Updates to the Pulumi HCL2 projection
- config variables are now specified as `config <name> <type>`
- output variables are now specified as `output <name> <type>`
- apply arguments are assigned better names by the apply rewriters
2020-04-02 21:25:30 -07:00
Pat Gavlin 89c9401fad Appease the linter 2020-04-02 21:25:30 -07:00