Commit graph

5963 commits

Author SHA1 Message Date
Anton Tayanovskyy fc8262bad0
Avoid overriding dotnet proj settings accidentally (#6670)
* Add failing test

* Guard against overrding project settings accidentally

* Throw exception in case of conflct

* Update sdk/dotnet/Pulumi.Automation/DictionaryContentsComparer.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/ProjectRuntime.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/ProjectTemplateConfigValue.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/ProjectTemplate.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/ProjectRuntimeOptions.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/ProjectBackend.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/ProjectSettings.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Reduce nesting

* Make the new exception public

* Introduce a CHANGELOG entry since we add to pub API

* Stricter check before throwing

* Address PR feedback, round 1

* Use Reference.Equals check

* Move DictionaryContentsComparer out of top-level

Co-authored-by: Komal Ali <komal@pulumi.com>
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2021-04-01 15:27:24 -04:00
Pat Gavlin 55ecf7a81e
Run SDK lint jobs (#6674)
Just what it says on the tin. Fixes #6628.
2021-04-01 11:23:47 -07:00
Vivek Lakshmanan 2b75dd6027
Merge pull request #6630 from mweathers/restSerialization
Be resilient to 3rd party libraries placing a __rest function on the global object.
2021-04-01 10:33:35 -07:00
Komal 7f8985ab0f
Revert "Allow environment variables to have a null value (#6520)" (#6677)
This reverts commit 17d1ce509e.
2021-03-31 21:15:38 -07:00
Dan Friedman 17d1ce509e
Allow environment variables to have a null value (#6520) 2021-03-31 18:32:18 -07:00
Justin Van Patten a9f0aead13
[codegen/go] Fix Go resource registrations (#6641)
We've been emitting calls to `New<Resource>` for resource registrations
in Go, passing `nil` for args. However, some of those `New<Resource>`
functions actually check for `nil` args and return an error if the
resource has required arguments.

At first, I was looking for a way to check inside `New<Resource>` if
the `URN` option was specified and in that case not error on
`nil` args (like we do in other languages), but we don't provide a way
to access the resource option values outside the Go SDK), so I don't
think there is a way to do it this way for Go.

So instead, this change updates the registration code to call
`ctx.RegisterResource` directly instead of `New<Resource>`, where we can
pass a `nil` args.
2021-03-31 16:50:30 -06:00
Vivek Lakshmanan 656ed796a1
Merge pull request #6528 from pulumi/vl/Nested
[codegen/go] Support nested collection types
2021-03-31 14:37:56 -07:00
stack72 80a43e9bec [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v2.24.0 2021-03-31 21:27:02 +01:00
stack72 0a8e2e8b02 Prepare for v2.24.0 release 2021-03-31 21:11:45 +01:00
Komal 55a0c1fc8e
[automation/go,nodejs,python] - Don't roundtrip project settings if file already exists. (#6669) 2021-03-31 11:00:11 -07:00
Komal 7671e85440
[automation/go,nodejs,python] - Respect existing project settings (#6655) 2021-03-31 07:51:11 -07:00
Anton Tayanovskyy ce9ab05935
Use CliWrap for subprocess management (#6654)
* Use CliWrap for subprocess management

* Reintroduce .Stop(), fix compilation

* Sanitize command name.
2021-03-31 10:41:02 -04:00
Paul Stack 4efec0f791
[docker] allow docker container builds to pass when security advistory (#6662)
Right now, we test the container at the end of the build rather than
before publishing so while we decouple that work, we should not fail
the build step if a security advisory was found - it's too late, the
containers are released so we should instead catch the advisory and
that will allow our release pipeline to continue
2021-03-31 15:22:58 +01:00
Paul Stack bf1a8d3387
Ensure that v is passed to the ldflags as part of windows binary creation (#6659) 2021-03-31 12:46:49 +01:00
Vivek Lakshmanan 78c48d5d31 Fix comment/example handling 2021-03-30 22:24:45 -07:00
Vivek Lakshmanan fec7209d6b PR comments and some additional cleanup 2021-03-30 22:24:11 -07:00
Vivek Lakshmanan 3151d23f09 Fix to create inputs for nested collections types 2021-03-30 22:24:11 -07:00
Vivek Lakshmanan 81f35f530f Fix tests for builtins 2021-03-30 22:24:11 -07:00
Vivek Lakshmanan 05b196dc59 Avoid processing collections of primitives 2021-03-30 22:24:11 -07:00
Vivek Lakshmanan 8b5e196209 Cleanup 2021-03-30 22:24:11 -07:00
Vivek Lakshmanan a83910f46a Update builtins to support ArrayArrayMap 2021-03-30 22:24:11 -07:00
Vivek Lakshmanan 700a576b70 Support nested collection types 2021-03-30 22:24:11 -07:00
Evan Boyle d098f9181b
fix nodejs resource functions to properly propagate errors (#6644) 2021-03-30 20:16:25 -07:00
Evan Boyle 1140e9f2bf
Add provider side caching for dynamic provider deserialization (#6657) 2021-03-30 19:15:08 -07:00
Komal 7d10e8c5be
Fix mypy errors (#6656) 2021-03-30 19:11:13 -07:00
Ville Penttinen 529fe8fc51
[automation/dotnet] Expose structured logging (#6572)
* [automation/dotnet] Start implementing structured event log support

* Add Events and their models

* Introduce new IStringToEnumConverter

This is intended to be used for converting a non-standard enum names
into corresponding enum values. The converter is utilized via
StringToEnumJsonConverter with OperationType and DiffKind.

* Add event-log support to up, refresh, destroy

* Update event-log tests

* Use lock instead of semaphore in EventLogWatcher

* Add ChangeSummary to PreviewResult

* Minor update

* Add doc comments to Events

* Use PropertyDiffModel in StepEventMetadataModel

* Set Events to public

* Set properties to public

* Fix PreludeEvent.Config doc comment

* Remove TODOs

* Update Pulumi.Automation.xml

* Set PULUMI_DEBUG_COMMANDs in Workspace.

* Split Events and their models to separate files

* Rename abbreviated Events

* Remove CancelEventModel

* Rename HandlesEvents test project and stack

* Update CHANGELOG_PENDING.md

* Rename abbreviated EngineEvent properties

* Implement custom exceptions

* Move event-log setup to LocalPulumiCmd

* Update comments

* Implement polling EventLogWatcher

This replaces the previous watcher which utilized FileSystemWatcher.

* Guard against onEvent throwing

* Dispose CancellationTokenSource

* WIP: try more direct error handling in EventLogWatcher

* A bit more tests

* Reformat

* Update sdk/dotnet/Pulumi.Automation.Tests/EventLogWatcherTests.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/Events/EventLogWatcher.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/Events/EventLogWatcher.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation.Tests/EventLogWatcherTests.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/Events/EventLogWatcher.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Update sdk/dotnet/Pulumi.Automation/Events/EventLogWatcher.cs

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>

* Make race condition workaround more explicit

* Untabify

* Remove unnecessary using and change String to string

* Update doc comments on Events

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
Co-authored-by: Anton Tayanovskyy <anton.tayanovskyy@gmail.com>
2021-03-30 14:57:38 -04:00
Komal 35321159fc
[sdk/python] - Await all async tasks (#6606) 2021-03-30 10:56:17 -07:00
Levi Blackstone ff2cf701a7
Swap out YAML parser library (#6642)
Related to #423
2021-03-29 14:49:00 -06:00
Levi Blackstone 0a2452f1f5
[test] Randomize stack names for some .NET tests (#6637) 2021-03-29 13:08:41 -06:00
Pat Gavlin 7c5ec6815e
Make data sources catchable in Python (#6504)
The current logic lets unhandled errors in the RPC invocation
unahandled in the async loop, which crashes the process due to
the way we await completion of RPCs before exiting the process
in Python. Instead of doing that, we can just marshal them back
to the synchronous awaiter as part of the calling convention,
and have that awaiter (which is called by the invoke methods)
re-raise the exception. This should fix pulumi/pulumi#3611.
2021-03-29 12:07:43 -07:00
Komal e5223492c7
[automation/python] - Fix passing of extra environment variables (#6639) 2021-03-29 11:48:17 -07:00
Levi Blackstone 8cdac3e4ca
[cli] Strip Byte-order Mark (BOM) from YAML configs during load (#6636)
Some YAML parsers don't correctly handle Byte-order marks,
so automatically strip it off during load.

Related to #423

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-03-29 11:56:19 -06:00
Anton Tayanovskyy 65396a25fc
Make .old and .new nullable on StateEventMetadata (#6625) 2021-03-29 10:43:57 -04:00
Matt Weathers aed070c8e6 Be resilient to 3rd party libraries placing a __rest function on the global object. 2021-03-26 21:23:48 -05:00
Justin Van Patten 872d9cb849
[sdk/python] Fix mypy errors (#6627) 2021-03-26 15:41:08 -07:00
Levi Blackstone 80270174f4
[tests] Add test to validate generated config file (#6624) 2021-03-26 13:10:41 -06:00
stack72 f9579b0a92 Post v2.23.2 release cleanup 2021-03-25 19:01:45 +00:00
stack72 5ca9f4f57a [deps] Ensure pulumi/pulumi tests uses sdk v2.23.2 2021-03-25 17:39:55 +00:00
stack72 1c16f3bea7 [deps] Ensure pulumi/pulumi pkg uses sdk v2.23.2 2021-03-25 17:35:35 +00:00
stack72 3f768221cd Prepare for v2.23.2 release 2021-03-25 17:31:34 +00:00
James Nugent c1ce3da3e6
Make custom available to Mocks::newResource (#6551)
This commit adds a new optional parameter to the `newResource` function
of the `Mocks` interface for TypeScript. This can be useful when writing
tests which assert differing behavior between Custom and Component
resources.

Although the new parameter will always be set, the paramteter is marked
as optional in order to maintain backwards compatibility with existing
implementations of `Mocks`.

The tests are updated to verify that `custom` is set appropriately.

Co-authored-by: Luke Hoban <luke@pulumi.com>
2021-03-25 14:22:14 +11:00
Komal 60cc4be9d3
[automation/*] - Add min version test for prerelease (#6612) 2021-03-24 14:00:33 -07:00
Justin Van Patten 4c1d4f89ee
[sdk/nodejs] Mark an internal function as internal (#6615) 2021-03-24 20:00:08 +00:00
Anton Tayanovskyy 4e5828a890
Avoid double-quailfying venv folder path (#6599)
* Avoid double-quailfying venv folder path

* Replace `path` with `filepath`

* Add a Python integration test to cover venv auto-creation

* Merged

* Fix spelling

Co-authored-by: Justin Van Patten <jvp@justinvp.com>

* Make AbsPath and RelPath test variants

* Fix issue on Windows backslash paths

* Debug windows test failure: more logging and aggressive YAML escaping

* Use filepath.IsAbs instead of path.IsAbs

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-03-24 15:51:46 -04:00
Komal 19c055315d
[automation/dotnet] - Implement min version checking (#6590) 2021-03-24 10:43:44 -07:00
Levi Blackstone 7f42d42b2b
[automation/python] Fix Settings file save (#6605)
The Project and Stack save routines were erroneously
dumping the Python objects rather than the __dict__
property, which resulted in some extra annotations
in the resulting YAML files. Some parsers don't handle
these annotations correctly, and consider the resulting
YAML file to be invalid.
2021-03-23 19:26:34 -06:00
Anton Tayanovskyy 980c50c602
Remove MaybeNull from Output/Input.Create to avoid spurious warnings (#6600)
* Remove MaybeNull attr from read-only params on Input/Output constructors

* Update changelog
2021-03-23 19:34:30 -04:00
Komal 5e5c6ffb50
[automation/nodejs,go,python] - Expose pulumiVersion as string (#6604) 2021-03-23 15:09:50 -07:00
Komal b187ce18c2
[automation/python] - Implement min version checking (#6589) 2021-03-23 08:35:11 -07:00
Komal 768db3e067
[automation/nodejs] - Implement min version checking (#6580) 2021-03-22 23:04:36 -07:00