Commit graph

2431 commits

Author SHA1 Message Date
Evan Boyle c9d8549ae6
[Go Program Gen] Only generate a single literal when traversing a union type (#5154) 2020-08-11 11:43:56 -07:00
stack72 d190247ede The history command should be a subcommand of stack
Fixes: #5134

This ensures that `pulumi history` has been deprecated in favor of
the new `pulumi stack history` command. The deprecated command will
be removed in v3.0.0 of Pulumi
2020-08-11 17:52:51 +01:00
Paul Stack 44a806180b
Bump version of go-cloud to v0.20.0 (#5156) 2020-08-11 17:48:56 +01:00
Albert Zhong 2cd0c000bd
[codegen] Add codegen/go/gen_crd2pulumi, clean up codegen/nodejs/gen_crd2pulumi (#5116)
* Add codegen/go/gen_crd2pulumi

* Properly generate Go CRD resources

* generate nodejs resources

* Remove nodejs/gen_crd2pulumi.go

* Remove generating funtions
2020-08-10 10:21:50 -07:00
stack72 5f4bfab192 Ensure Project Stack is not loaded and saved unnecessariliy for default secrets manager
Fixes: #5126

In the newServiceSecretsManager, we were loading and saving the project stack
without understanding if any changes had actually been made - e.g. changing the
stack to be a new secrets provider

This has now been guarded against, tests added to understand when it will
actually be saved and we no longer get unnecessary config sorting when interacting
with a default stack AND no longer get an empty config map in our config
file when we initiate a new stack with a default secrets provider
2020-08-07 21:31:57 +01:00
Komal 2f2e62e2e4
[codegen/python] - Normalize module names in program gen (#5128) 2020-08-07 09:30:07 -07:00
Mikhail Shilkov 0c9d1fdd0e
Fix C# program gen for Kubernetes examples (#5129) 2020-08-07 09:31:42 -06:00
Pat Gavlin e5f44a7b0c
Use a package map where appropriate (#5127)
* Use a package map where appropriate

* Fix imports

* handle NoneType for literal value expressions in go program gen

* add operator tests for c#, python, and node

Co-authored-by: evanboyle <evan@pulumi.com>
2020-08-06 19:09:18 -07:00
Luke Hoban 4e0b5df981
Support publishing and consuming policy packs using any runtime (#5102)
Fixes #5089.
2020-08-06 16:33:59 -07:00
Komal ff219a2381
Use input/output classes in program gen (#5086) 2020-08-06 15:09:23 -07:00
Levi Blackstone ba18683d9a
[codegen] Generate null values for model.NoneType (#5122) 2020-08-06 14:12:27 -06:00
Evan Boyle fbf391fd4b
Merge pull request #5115 from pulumi/evan/fixKubeProgramGen
[Go Program Gen] Fix various Kubernetes issues
2020-08-05 17:30:23 -07:00
Levi Blackstone 3286aae20d
[codegen] Make schema and package available to HCL2 codegen (#5114) 2020-08-05 17:27:17 -06:00
Pat Gavlin 63db7e0d46 Use the existing contexts map. 2020-08-05 16:11:12 -07:00
evanboyle 9425016521 add todos 2020-08-05 15:50:07 -07:00
evanboyle 2c350b08d8 lint 2020-08-05 15:31:12 -07:00
evanboyle 2f71fbbf2d traverse object and tuple cons expressions for imports 2020-08-05 15:23:36 -07:00
Paul Stack 0525ff5a32
Merge pull request #5110 from pulumi/fixup-passphrase-secrets-provider
Ensure Passphrase Secret Manager is available to use with new config
2020-08-05 21:49:35 +01:00
stack72 ca18028bd7 Ensure Passphrase Secret Manager is available to use with new config
Fixes: #5104

This reverts a code change that was checking initially for the
SecretsProvider of the currentStack being an empty string. When it
was an empty string, we were checking the backend type and we were
setting a serviceSecretsManager. This wasn't correct, the logic
needed to check for an empty SecretsProvider AND an empty EncryptionSalt

The important part is that it needed to check for the EncryptionSalt
to make sure it wasn't a passphrase secrets manger
2020-08-05 20:55:13 +01:00
Komal 269b537e57
[codegen/python] - Fix python resource tokens (#5107) 2020-08-05 12:50:54 -07:00
evanboyle 8af3be1e3f account for import aliases in program expressions 2020-08-05 12:44:46 -07:00
evanboyle e2e6db47f7 use import aliases in Go program gen 2020-08-05 11:42:38 -07:00
Komal d2dd990866
[codegen/python] Fix pyname bug (#4918) 2020-08-05 10:08:52 -07:00
Evan Boyle 13ee9fd4c8
tests for kubernetes program generation (#5105) 2020-08-05 09:15:36 -07:00
Albert Zhong 06fa515bf7
[codegen/nodejs] Refactor genNamespace, add crd2pulumi (#5084)
* Refractor genNamespace, add crd2pulumi

* Rename to genCRDNamespaces()

* Rename crd2pulumi genCRDNamespaces function
2020-07-31 18:29:00 -07:00
Mikhail Shilkov 044bb6bb61
Match module versions also outside the kubernetes compat flag (#5088) 2020-07-31 21:50:34 +02:00
Mikhail Shilkov 526e5264b8
Handle resource_name properties to avoid conflicts in Python codegen (#5052) 2020-07-30 16:29:36 +02:00
Justin Van Patten b364296521
Python: Improved error message when virtualenv doesn't exist (#5069) 2020-07-28 13:28:14 -07:00
Lee Briggs bad67d3242
switch os/user with luser
We make several calls to `os/user`, which uses CGO and means
cross-compilation is not possible. This replaces `os/user` with the
`luser` package, which is a drop-in replacement which does not use `CGO`
2020-07-27 14:44:08 -07:00
Paul Stack 6ff94a18cf
Add ability to create a stack based on an existing stack (#5062) 2020-07-27 19:50:33 +01:00
Paul Stack ed923a1057
Add the ability to change secrets provider (#5031) 2020-07-27 18:08:18 +01:00
Lee Briggs c9fedef887
Merge pull request #4947 from pulumi/jaxxstorm/provider-info
add plugin download url metadata to package spec
2020-07-21 12:03:09 -07:00
Sean Fausett a38bbaa221
Enable SourceLink with embedded PDB (#4967) 2020-07-21 16:55:08 +02:00
Lee Briggs 3b0462f0e0
Merge branch 'master' into jaxxstorm/provider-info 2020-07-20 17:35:47 -07:00
Gabriel Diaz ffb8c2400d
Fix semicolon in python docs (#5025) 2020-07-17 21:16:30 -07:00
Paul Stack 6d09fe32df
Add the ability to copy configs between stacks (#4971) 2020-07-17 11:14:10 +01:00
Pat Gavlin 418e2291a2
Protect against engine event mutation. (#5003)
Certain operations in `engine/diff` mutate engine events during display.
This mutation can occur concurrently with the serialization of the event
for persistence, which causes a panic in the CLI. These changes fix the
offending code and add code that copies each engine event before
persisteing it in order to guard against future issues.
2020-07-16 23:52:31 -07:00
Praneet Loke 67525ee4b1
[codegen/schema] Skip processing a line if the block position is greater than the length of the line. (#5002) 2020-07-16 16:59:06 -07:00
Pat Gavlin 00fbbb6544
[codegen/hcl2] Fix nested apply rewrites (#5013)
Rewrites that should produce nested applies due to functions that return
eventual types were instead producing a single top-level apply. These
changes fix that by considering a function that produces an eventual
value as inspecting eventual values.
2020-07-16 10:26:10 -07:00
Komal 1a10e06588
Add a helper function to clean the codegen dir (#5018) 2020-07-15 16:11:37 -07:00
Komal 6682da5fa5
[codegen/python] Add underscores to private modules to avoid exporting them. (#4959) 2020-07-15 13:10:52 -07:00
Pat Gavlin 4961567ecf
[codegen/hcl2] Add a template trivia constructor (#5009)
Just what it says on the tin. Currently it's not possible to create a
valid value of this type because the `bytes` field is unexported. This
constructor fixes that.
2020-07-14 12:07:44 -07:00
Pat Gavlin 86599a06a6
[codegen/hcl2] Fix applies on relative traversals. (#5008)
The apply rewrite for relative traversals did not consider whether or
not the receiver was eventually-typed, and did not properly check
whether or not the relative traversal itself was eventually-typed. These
changes correct those mistakes.
2020-07-14 12:07:35 -07:00
Pat Gavlin a19843f433
[codegen/{go,nodejs,python}] Normalize modules. (#5006)
In general, a package/module name in these targets is derived from the
module portion of a type token. If the type token is not already in an
expected form--namely, all lowercase--the generated package/module names
will also be in unexpected forms. These changes normalize the module
names to lowercase s.t. the generated package/module names conform to
expectations.
2020-07-14 10:58:29 -07:00
Pat Gavlin 8baee06e30
[codegen/{go,nodejs}] Minor fixes in SDK gen. (#4991)
- NodeJS: fix get + constructor generation for types with required args
  and no state type.
- Go: fix type + import generation for properties in the root module.
2020-07-14 08:55:39 -07:00
Pat Gavlin 54c5a75e34 [codegen/{go,nodejs}] Minor fixes in SDK gen.
- NodeJS: fix get + constructor generation for types with required args
  and no state type.
- Go: fix type + import generation for properties in the root module.
2020-07-10 11:23:31 -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
Paul Stack 0824fc9a8b
Revert "Narrow a few interfaces." (#4987) 2020-07-09 15:19:12 +01:00
Pat Gavlin dff1299be4
[codegen] Add a code generator for resource state. (#4982)
Add a new package, `codegen/importer`, that can generate definitions for
resource states in PCL or TS/Python/C#/Go. The pipeline is relatively
simple: given a list of resource states, generate a PCL program in
memory, bind it, and pass it to the language-specific code generator.
This builds upon the existing PCL IR, and can be used with the currently
supported code generators.

Related to #1635.
2020-07-08 19:12:37 -07:00
Komal bdc86e002a
Change how submodules are imported to work with Intellisense (#4948) 2020-07-08 18:34:59 -07:00