Commit graph

44 commits

Author SHA1 Message Date
Anton Tayanovskyy 372ddc7e5c
Skip flaky tests for now (#8420) 2021-11-15 15:17:20 -05:00
Ian Wahbe 83e24765f3
.NET & python SDKs parity for bad pulumi versions (#8297)
* .NET & python SDKs parity for bad pulumi versions

They handle invalid Pulumi CLI version gracefully.

* Make python version property lazy

* Clarify .NET logic

* Add python test for validate_pulumi_version

* Add tests for invalid versions

* Fix python test

* Fix typo

* Fix tests

* Have _validate_pulumi_version handle parsing

* Modify python and .NET to parseAndValidate

* Modify typescript and go to parseAndValidate

* fix name
2021-10-27 20:54:23 -07:00
Josh Studt caf5fcd525
[auto/dotnet] - pulumi state delete & unprotect functionality (#8202)
Co-authored-by: Komal <komal@pulumi.com>
2021-10-18 16:26:45 -07:00
Sean Fausett 12217bd0dc
Fix async await warnings (#7537)
* Revert remove redundant async await
* Fix resharper code issues
* Update changelog
2021-07-21 18:44:10 -04:00
Hossam Barakat 3fabf45542
Set PULUMI_CONFIG_PASSPHRASE for Automation Tests (#7502) 2021-07-20 17:18:30 -07:00
Komal 373ff9f878
Turn off flakey test (#7468) 2021-07-08 12:54:02 -07:00
Josh Studt 22669d70fc
[sdk/dotnet] - Fix swallowed nested exceptions with inline program so they correctly bubble to consumer (#7323)
* resolve issue with exit code not bubbling up and inflight tasks swallowing exceptions

* update changelog

* refacter to reduce and centralize inline program exception flow complexity

* quick comments on new pulumi function return type
2021-06-21 15:45:26 -04:00
Josh Studt 2f4d10d541
[sdk/dotnet] - bug fix resources destroyed after exception thrown during inline program (#7299)
* resolve issue with resources being destroyed if an exception is thrown during an inline program dotnet sdk

* update changelog
2021-06-15 18:17:54 -04:00
Sean Fausett 7820d2c17b
Support microsoft logging extensions with inline programs (#7117)
* Demystify serilog logger messages
https://github.com/benaadams/Ben.Demystifier

* Update changelog
2021-06-10 23:06:57 -04:00
Sean Fausett 3530ba3205
[dotnet] Fix Resharper code issues (#7178)
* Fix resharper code issues for language usage opportunities

* Fix resharper code issues for common practices and code improvements

* Fix resharper code issues for potential code quality issues

* Fix resharper code issues for redundancies in code

* Fix xunit test output

* Update changelog

* Fix resharper code issues for compiler warnings

* Fix resharper code issues for inconsistent naming

* Add resharper solution settings file

* Fix resharper code issues for potential code quality issues

* Fix resharper code issues for redundancies in code

* Fix resharper code issues for redundancies in symbol declarations
2021-06-10 10:32:33 -04:00
Justin Van Patten d6b7762102
Temporarily disable config secrets warning (#7129)
Temporarily disable the new config secret warning to avoid unactionable warnings from provider `config` modules. We'll re-enable the warning when we've addressed that issue.
2021-05-24 16:06:27 -07:00
Justin Van Patten 34a40d2b10
[sdk/dotnet] Warn when a secret config is read as a non-secret (#7079) 2021-05-18 15:01:57 -07:00
Anton Tayanovskyy 908ac27219
Fix flaky test that fails on unrelated PRs (#6979) 2021-05-10 11:27:55 -04:00
Josh Studt 31fec05a24
[auto/dotnet] - Add PulumiFn implementation for runtime stack type (#6910)
* add runtime stack type pulumi fn implementation

* add exception propagation test and update changelog

* slight refactor to just bring the identical service provider code into the new PulumiFn implementation.

* get tests passing, need service to be registered as transient so that the stack is instantiated each time because pulumi internal rely on instantiation

* check version command was failing because of additional white space it wasn't accounting for
2021-05-10 11:06:25 -04:00
Komal 1ed3445ed4
[automation/*] - Optionally skip Automation API version check (#6882)
Co-authored-by: James Nugent <jen20@apple.com>
2021-04-27 20:54:27 -07:00
Ville Penttinen 52fb4c2d68
[automation/dotnet] Fix EventLogWatcher failing to read events after an exception was thrown (#6821)
* [automation/dotnet] Fix EventLogWatcher failing to read events after exception

* Update CHANGELOG_PENDING.md

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2021-04-26 16:31:55 -04:00
Ismayil 4bafeee700
Fixes #6775: Duplicated Go modules (#6800) 2021-04-19 08:24:51 -07:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Anton Tayanovskyy 0e2d918587
stack.Cancel support in dotnet Automation API (#6729)
* First cut at Cancel

* Add a racecond-based test for Cancel

* Auto-gen xml updates

* Fix code formatting

* Add CHANGELOG entry
2021-04-13 14:09:33 -04:00
Lee Zen 49241d5f74
[dotnet] Fix serialization/deserialization for StackSettings (#6752) 2021-04-12 16:45:00 -07:00
Anton Tayanovskyy 737cffc147
dotnet automation api ImportStackAsync and ExportStackAsync (#6728)
* Initial impl of import/export

* Add test

* Address PR comments

* Do not Select stack but pass it as --stack

* Add CHANGELOG entry

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

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

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

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

* Add helper methods to match node SDK

* Match project settings

* Update CHANGELOG_PENDING.md

Co-authored-by: Komal <komal@pulumi.com>

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Co-authored-by: Komal <komal@pulumi.com>
2021-04-12 17:41:51 -04:00
Josh Studt ef9a1e4e40
[sdk/dotnet] - Thread-safe concurrency-friendly global state (#6139)
* changes necessary for concurrent thread safe global deployment state

* update changelog

* backtrack resource package changes, enable test parallelization

* cleanup comment

* add copyright to new file

* resolve paralellization differences after merging automation api preview

* no longer need to null deployment instance

* Update CHANGELOG.md

* whoops - switch to CHANGELOG_PENDING

* Update CHANGELOG_PENDING.md

move note down to improvements

* attempt to exclude dynami assemblies

Co-authored-by: Anton Tayanovskyy <anton.tayanovskyy@gmail.com>
2021-04-09 15:55:34 -04:00
Anton Tayanovskyy e460ab7be5
Method renames for dotnet automation API GA (#6731)
* Method renames

* Add CHANGELOG_PENDING entry
2021-04-08 18:01:18 -04:00
Ville Penttinen d93e5acf67
[automation/dotnet] Expose WorkspaceStack.GetOutputsAsync (#6699) 2021-04-07 16:23:38 -07:00
Ville Penttinen 1f15c10b3d
[automation/dotnet] Fix GetConfigValueAsync failing to deserialize (#6698) 2021-04-06 14:10:30 -07:00
Ville Penttinen c8fd984488
[automation/dotnet] Allow null environment variables (#6687)
* [automation/dotnet] Allow null environment variables

* Update CHANGELOG_PENDING.md

* Update sdk/dotnet/Pulumi.Automation.Tests/LocalPulumiCmdTests.cs
2021-04-02 10:08:43 -04:00
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
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
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
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
Levi Blackstone 0a2452f1f5
[test] Randomize stack names for some .NET tests (#6637) 2021-03-29 13:08:41 -06:00
Komal 19c055315d
[automation/dotnet] - Implement min version checking (#6590) 2021-03-24 10:43:44 -07:00
Komal dd53f58acb
[automation/dotnet] - Isolate project and stack names, defer stack removal for tests (#6584) 2021-03-19 13:23:13 -07:00
Ville Penttinen aa79630ee3
[automation/dotnet] Add ability to capture stderr (#6513) 2021-03-15 09:11:42 -07:00
Anton Tayanovskyy 5235e0818e
Merge pull request #6523 from pulumi/fix/invalid-json-test-data
JSON does not admit trailing commas
2021-03-12 18:02:59 -05:00
Komal 794bae5fd5
Skip breaking dotnet automation api test (#6521) 2021-03-12 13:33:16 -08:00
Anton Tayanovskyy 4de8dddb91 JSON does not admit trailing commas 2021-03-12 16:32:55 -05:00
Ville Penttinen c438cad689
[automation/dotnet] Add ReadDiscard OperationType (#6493)
Co-authored-by: Komal <komal@pulumi.com>
2021-03-12 10:10:56 -08:00
Paul Stack 20e84dfe9e
Upgrading Go to 1.16.x (#6470) 2021-03-09 20:05:23 +00:00
Josh Studt c921c708e9
[sdk/dotnet] - automation api fix OnOutput (#6435) 2021-02-28 20:06:12 -08:00
Joshua Studt 2f47060f83 resolve stack manipulation test issue by not making assertions about entire stack collection, plugin manipulation test as example 2021-02-18 12:52:48 -05:00
Mikhail Shilkov 1ccfd7413e
Fix serialization tests of .NET Automation (#6375) 2021-02-18 14:03:27 +01:00
Josh Studt 963b5ab710
[Automation API] - C# Implementation (#5761)
* Init Workspace interface for C# Automation API

* fleshing out workspace interface and beginning of local workspace implementation

* initial run pulumi cmd implementation

* resolve issue with pulumi cmd cleanup wrapper task after testing

* flesh out local workspace implementation, flesh out stack implementation, cleanup run pulumi cmd implementation and make it an instance so it is mockable/testable, separate serialization in prep for custom converters

* project settings json serialization implemented

* Initial commit of language server

* Add deployment from language server

* Cleanup

* finish json serialization

* project runtime yaml serialization completed. just need stack config value yaml serialization

* Remove typed argument

* Limit concurrency

* Rename file for consistency

* final commit of a semi-working project settings & stack settings serialization so that it is in the commit history

* modify workspace API so that settings accessors aren't fully exposed since we are defering a complete serialization implementation until a later date

* yaml converters wrap any outgoing exceptions so resolve that

* getting the beginning of inline program GRPC communication set up

* stack lifecycle operations implemented, and switched to newtonsoft for JSON serialization

* change back to system.text.json with a custom object converter

* local workspace tests written, working on getting them passing

* fix the encoding on the GO files used for testing

* all tests passing except inline program, pulumi engine not available with inline

* inline program engine is now running as expecting, but inline program is not recognizing local stack config

* All tests passing, but no concurrency capability because of the singleton DeploymentInstance.

* cleanup unnecessary usings

* minor cleanup / changes after a quick review. Make sure ConfigureAwait is used where needed. Remove newtonsoft dependency from testing. Update workspace API to use existing PluginKind enum. Modify LanguageRuntimeService so that its semaphore operates process-wide.

* support for parallel execution of inline program, test included

* Update LocalWorkspaceTests.cs

remove some redundancy from the inline program parallel execution text

* flesh out some comments and make asynclocal instance readonly

* Strip out instance locking since it is no longer necessary with AsyncLocal wrapping the Deployment.Instance. Modify CreateRunner method such that we are ensuring there isn't a chance of delayed synchronous execution polluting the value of Deployment.Instance across calls to Deployment.RunAsync

* resolve conflicts with changes made to Deployment.TestAsync entrypoints

* update changelog

* write a test that fails if the CreateRunnerAndRunAsync method on Deployment is not marked async and fix test project data file ref

* make resource package state share the lifetime of the deployment so that their isn't cross deployment issues with resource packages, add support and tests for external resource packages (resource packages that aren't referenced by the executing assembly)

* enable parallel test collection execution in test suite, add some additional tests for deployment instance protection and ensuring that our first class stack exceptions are thrown when expected

* minor inline project name arg change, and re-add xunit json to build output (whoops)

* strip out concurrency changes since they are now in #6139, split automation into separate assembly, split automation tests into separate assembly

* add copyright to the top of each new file

* resolve some PR remarks

* inline program exception is now properly propagated to the caller on UpAsync and PreviewAsync

* modify PulumiFn to allow TStack and other delegate overloads without needing multiple first class delegates.

* whoops missing a copyright

* resolve getting TStack into IRunner so that outputs are registered correctly and so that there isn't 2 instances of Pulumi.Stack instantiated.

* resolve issue with propagation of TStack exceptions and add a test

* add support for a TStack PulumiFn resolved via IServiceProvider

* update automation API description

* fix comment and remove unnecessary TODOs

* disable packaging of automation api assembly

* re-name automation api documentation file appropriately

* add --limit support to dotnet automation api for stack history per #6257

* re-name XStack as WorkspaceStack

* replace --limit usage with --page-size and --page in dotnet automation api per #6292

Co-authored-by: evanboyle <evan@pulumi.com>
Co-authored-by: Josh Studt <josh.studt@figmarketing.com>
Co-authored-by: Dan Friedman <dan@thefriedmans.org>
Co-authored-by: David Ferretti <David.Ferretti@figmarketing.com>
Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2021-02-18 11:36:21 +01:00