Commit graph

5381 commits

Author SHA1 Message Date
stack72 4c4a4733e8 Fixing up the go deps as this was breaking the publish step 2020-12-08 14:30:21 +00:00
stack72 7393f80b43 DEBUG when trying to understand why master sdks are classed as dirty for dev builds 2020-12-08 13:20:46 +00:00
Paul Stack 4f5b3c8522
Ensure we have an import error before using in import path (#5884)
Without this, we can panic
2020-12-08 00:43:35 +00:00
Vivek Lakshmanan f81a4d28a5
Merge pull request #5886 from pulumi/vl/WindowsBuild
Fix windows publish
2020-12-07 16:05:45 -08:00
Vivek Lakshmanan 3ec7dbeded Fix windows build 2020-12-07 15:58:30 -08:00
Vivek Lakshmanan aba03b8594
Merge pull request #5874 from pulumi/vl/Windows
Shim python interpreter for windows if interpreter uses reparse points
2020-12-07 15:13:21 -08:00
Vivek Lakshmanan 4e144e666c Add changelog entry 2020-12-07 14:17:45 -08:00
Vivek Lakshmanan 3ea87776a0 Add copyright notice 2020-12-07 14:17:45 -08:00
Vivek Lakshmanan 77f2e0fa3f go mod 2020-12-07 14:17:45 -08:00
Vivek Lakshmanan ed0d427958 Add a python shim script to work around https://github.com/golang/go/issues/42919 2020-12-07 14:17:45 -08:00
Vivek Lakshmanan 0aa4ba4d44 Check for python among execution aliases on Windows 2020-12-07 14:17:38 -08:00
Paul Stack 8396030578
Enable command dispatch workflow for dealing with PRs (#5851)
There are a few things happening here:

- Rename the command dispatch release events to be prefixed with trigger-
- Introduce a new command-dispatch event

  This new event listens for a trigger term in a comment e.g. /run-acceptance-tests

  This trigger term is *only* needed when the PR is from a fork! When the trigger term is posted
  then the run-build-and-acceptance-tests.yml event is fired

- run-build-and-acceptance-tests.yml

  If the user runs the code from a pulumi based branch, then the tests and builds will work as normal
  If this file is being run via respository_dispatch then it will be able to run the test and builds
  and also post a comment back to the PR with the link to the test run

It's important to say that PRs affecting the codegen and resource docs paths will only fire from a
pulumi based branch - there is currently no command dispatch events for these codegen and resource PRs!
2020-12-07 19:29:04 +00:00
stack72 890a81ac4f Prepare for v2.15.3 release 2020-12-07 18:34:46 +00:00
Luke Hoban df8f01dba7
Revert #5857 (#5880)
Fixes #5879.
2020-12-07 10:06:41 -08:00
stack72 223f6501eb Prepare for v2.15.2 release 2020-12-07 12:48:25 +00:00
Vivek Lakshmanan 3377978a1d Use os.Lstat instead of os.Stat 2020-12-06 22:49:25 -08:00
Joe Duffy a5c30f1547
Properly resize arrays when adding (#5872)
* Properly resize arrays when adding

The current logic attempts to update the array but, because
append may need to allocate a new array with adequate space,
the code can currently leave dest referring to the old,
under-sized array. The solution is to use the set(dest)
logic that already exists and is used for the IsNull case.

Added a test case that would fail before this fix and now passes.

This fixes pulumi/pulumi#5871.

* Add CHANGELOG entry
2020-12-06 21:23:50 +00:00
stack72 a70cb41731 Prepare for v2.15.1 release 2020-12-04 20:06:10 +00:00
Sean Fausett 15941d58d9
Bump Grpc NuGet packages to 2.34.0 (#5862)
* Bump Grpc NuGet packages to 2.34.0

https://github.com/grpc/grpc/releases/tag/v1.34.0

* Remove redundant package reference

Transitive via project reference.
2020-12-04 16:58:18 +01:00
Paul Stack 12dd0767ac
Ensure we can rotate pulumi passphrase secrets providers (#5865)
Fixes: #5452

When the user is requesting to change the secrets provider to a
passphrase provider, we now calculate that has been requested.

This means, we will prompt for a new passphrase for use in encrypting
the stack.

```
pulumi stack change-secrets-provider passphrase
Enter your passphrase to unlock config/secrets
    (set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Enter your new passphrase to protect config/secrets:
Re-enter your new passphrase to confirm:
Migrating old configuration and state to new secrets provider
Enter your passphrase to unlock config/secrets
    (set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
```
2020-12-04 15:21:51 +00:00
Justin Van Patten 5ab051cd97
Implement GetRequiredPlugins for Python (#5787)
Implement GetRequiredPlugins for Python, which determines the plugins
required by the program.

Also, if the `virtualenv` runtime option is set, and the specified
virtual directory is missing or empty, automatically create it and
install dependencies into it.
2020-12-03 19:22:16 -08:00
Luke Hoban 9e955241fc
Make credentials.json file writes concurrency safe (#5857)
Running `pulumi` operations in parallel could occasionally result in truncating the `~/.pulumi/credentials.json` file and reading that truncated file from another process before the content could be written.

Instead, use `os.Rename` to atomically replace the file contents.

Concurrent `pulumi` operations could still compete for who gets to write the file first, and could lead to surprising results in some extreme cases.   But we should not see the corrupted file contents any longer.

Fixes #3877.
2020-12-03 15:07:55 -08:00
Justin Van Patten 260620430c
[codegen/(nodejs|python)] package/module registration with version info (#5839)
Generate ResourcePackage and ResourceModule implementations and
registrations. A ResourcePackage is generated for any module that
includes a provider resource (which should be the root module only), and
a ResourceModule is generated for any module that includes a resource.

And add version info to Python registrations.
2020-12-02 13:45:25 -08:00
stack72 911eec4d55 Prepare for v2.15.0 release 2020-12-02 20:15:29 +00:00
Justin Van Patten ea1b962999
Revert "Enable resource reference feature by default" (#5850)
To de-risk the Pulumi v2.15.0 release, temporarily revert 679d40950f. Use of resource references will require `PULUMI_EXPERIMENTAL_RESOURCE_REFERENCES=1` to be set until the feature has been enabled by default.
2020-12-02 08:39:21 -08:00
Joe Duffy 01d0d64e84
Correctly rename stack files during a rename (#5812)
* Correctly rename stack files during a rename

This fixes pulumi/pulumi#4463, by renaming a stack's configuration
file based on its stack-part, and ignoring the owner-part. Our
workspace system doesn't recognize configuration files with fully
qualified names. That, by the way, causes problems if we have
multiple stacks in different organizations that share a stack-part.

The fix here is simple: propagate the new StackReference from the
Rename operation and rely on the backend's normalization to a
simple name, and then use that the same way we are using a
StackReference to determine the path for the origin stack.

An alternative fix is to recognize fully qualified config files,
however, there's a fair bit of cleanup we will be doing as part of
https://github.com/pulumi/pulumi/issues/2522 and
https://github.com/pulumi/pulumi/issues/4605, so figured it is best
to make this work the way the system expects first, and revisit it
as part of those overall workstreams. I also suspect we may want to
consider changing the default behavior here as part of
https://github.com/pulumi/pulumi/issues/5731.

Tests TBD; need some advice on how best to test this since it
only happens with our HTTP state backend -- all integration tests
appear to use the local filestate backend at the moment.

* Add a changelog entry for bug fix

* Add some stack rename tests

* Fix a typo

* Address CR feedback

* Make some logic clearer

Use "parsedName" instead of "qn", add a comment explaining why
we're doing this, and also explicitly ignore the error rather
than implicitly doing so with _.
2020-12-01 16:55:48 -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
Levi Blackstone 679d40950f
Enable resource reference feature by default (#5848)
Unless the PULUMI_DISABLE_RESOURCE_REFERENCES flag
is explicitly set to a truthy value, the resource reference feature is now
enabled by default.
2020-12-01 16:58:49 -07:00
Levi Blackstone c3814a240c
Delete unused GCP creds (#5847)
These creds were previously used for TravisCI and
are no longer needed.
2020-12-01 21:39:46 +00:00
Levi Blackstone 948a9cc27d
[codegen/docs] Exclude eks package API links (#5843) 2020-12-01 12:03:08 -07: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
Levi Blackstone aec5ada15d
[sdk/go]: Add support for getResource to Go SDK (#5823)
- Clean up resourceOptions and associated methods
- Add URN field and setter function
- Invoke getResource if URN set
2020-12-01 11:03:47 -07:00
Paul Stack eee053cb4c
Ensure EncryptionKey is regenerated when changing secrets provider (#5842)
Fixes: #5835

when rotating a key in the Azure KeyVault secrets provider, we had
the following error:

```
error: secrets (code=InvalidArgument): keyvault.BaseClient#Decrypt: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadParameter" Message="The parameter is incorrect.\r\n"
```

This was because we were not regenerating the EncrytpionKey when
we were changing the secrets provider. Therefore, we now ensure
that this key is regenerated and we can successfully change the secrets provider

```
▶ pulumi stack init dev --secrets-provider="azurekeyvault://stack72kv10.vault.azure.net/keys/pulumi-secret"
Created stack 'dev'

▶ pulumi config set MyDBRootPassword Password1234! --secret

▶ pulumi config --show-secrets
KEY               VALUE
MyDBRootPassword  Password1234!

▶ pulumi stack change-secrets-provider "azurekeyvault://stack72kv20.vault.azure.net/keys/pulumi-secret"

▶ pulumi config --show-secrets
KEY               VALUE
MyDBRootPassword  Password1234!
```
2020-12-01 15:26:23 +00:00
Eric Rudder fb78d1d9dd
go 1.13 to 1.15
as above
2020-11-30 10:41:03 -08:00
Nathan Winder 0bdf73341b
Enable creation of TStack using IServiceProvider (#5723)
* Enable creation of TStack using IServiceProvider to enable dependency injection.

* fixed line endings

* update change log

* Added PR link to change log

* fixed change log

* Added integration test

* Review adjustments

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2020-11-30 16:43:18 +01:00
Justin Van Patten 06da84a752
Turn on support for resourceReferences behind feature flag (#5830) 2020-11-25 10:43:46 -08:00
Komal 600e296ee2
[codegen/python] - Enums (#5553) 2020-11-24 23:43:32 -06:00
Komal 995d3b9b6c
Remove UsesIOClasses check. (#5827) 2020-11-24 19:15:37 -06:00
Komal 48f43906f4
[sdk/python] - Support enums (#5615)
Co-authored-by: Pat Gavlin <pat@pulumi.com>
2020-11-24 19:15:11 -06:00
Pat Gavlin 4b90205f3f
[codegen/python/sdk]: package/module registration (#5806)
Generate ResourcePackage and ResourceModule implementations and
registrations. A ResourcePackage is generated for any module that
includes a provider resource (which should be the root module only), and
a ResourceModule is generated for any module that includes a resource.

Note that version information is currently omitted. We should fix this
up before enabling resource reference deserialization end-to-end.
2020-11-24 12:43:23 -08:00
Paul Stack b0580ab998
Ensure we don't panic or write import helper text on import errors (#5825)
Fixes: #5688
Fixes: #5737
2020-11-24 17:14:09 +00:00
Mikhail Shilkov 6138ee1cc7
Populate package for doc args types (#5822) 2020-11-24 11:20:25 +01:00
Lee Briggs bed7c64afb
use correct repository for actions build (#5820) 2020-11-24 02:49:09 +00:00
Paul Stack d64c58c731
Ensure the correct qualified code is emitted for Python ResourceOptions (#5824) 2020-11-24 02:21:25 +00:00
Pat Gavlin ef6da5709d
Update Python resource ref deserialization. (#5805)
There are two significant changes in this commit: one to the way
resource packages/modules are stored and retrieved, and one to resource
ref deserialization in the face of missing resource packages/modules.

Resource packages and modules no longer require an exact version match
during deserialization. Instead, the newest compatible version of the
package or module is selected. If no version was specified, the newest
version of the package or module will be chosen. As a special case, a
package or module that has no version will always be treated as the best
version for that package or module.

If a resource package or module is not found when attempting to
deserialize a resource reference, the SDK no longer emits an error, and
instead deserializes the reference as its URN or ID (if present). This
accommodates providers that have not yet been updated to include the
appropriate factory registrations.
2020-11-23 15:37:44 -08:00
Justin Van Patten a9d213107b
[codegen/(dotnet|python)]: Emit refs to provider resources (#5810) 2020-11-23 12:28:00 -08:00
Mikhail Shilkov ebb4ddb86a
Add support for getResource to the .NET SDK (#5817) 2020-11-23 20:55:03 +01:00
Pat Gavlin 807b09d6a6
Fix a few issues with resource references. (#5804)
- Differentiate between resource references that have no ID (i.e. because
  the referenced resource is not a CustomResource) and resource references
  that have IDs that are not known. This is necessary for proper
  backwards-compatible serialization of resource references.
- Fix the key that stores a resource reference's package version in the
  .NET, NodeJS, and Python SDKs.
- Ensure that the resource monitor's marshalling/unmarshalling  of inputs
  and outputs to/from calls to `Construct` retain resource references as
  appropriate.
- Fix serialization behavior for resources -> resource references in the
  Go SDK: if a resource's ID is unknown, it should still be serialized
  as a resource reference, albeit a reference with an unknown ID.
2020-11-23 11:15:10 -08:00
Paul Stack 8df7d24523
Trigger Template and Examples tests on a release (#5815)
Fixes: #5738

This will ensure we find any potential issues after a release
2020-11-23 17:47:57 +00:00
Komal 505d53421e
[codegen/python] - Include inputs import in provider.py (#5818) 2020-11-23 10:39:42 -06:00