Commit graph

6540 commits

Author SHA1 Message Date
Praneet Loke 0343a6de76
[codegen/docs] Use go:embed for templates and use DisplayName from schema for titles (#8389)
* Use the display name from the schema, if available

* Update comment on the titleLookup map

* Add examples of reserved labels that can be used with the Keywords array in the schema
2021-11-10 11:07:43 -08:00
Vivek Lakshmanan d7ec7ce06c
Merge pull request #8394 from pulumi/vl/Integration
Move AssertHTTPResultWithRetry from pulumi-eks utils
2021-11-09 16:56:25 -08:00
Vivek Lakshmanan aa9bed5508 Fix linting 2021-11-09 15:41:28 -08:00
Vivek Lakshmanan d401912902 Move AssertHTTPResultWithRetry from pulumi-eks since its usable across integration tests 2021-11-09 14:41:09 -08:00
Ian Wahbe 6057dc3362
Validate python version (#8368)
* Validate python version

Note: we do this at the language plugin level because extremely old
version of python (python2) have different syntax, and we don't want
parse errors to occlude our version message. Similarly, if we rely on a
3.7 feature during an import, we will have the same problem. 

* Set minimum python version to 3.7.0

* Fix displayed recommended version
2021-11-09 14:22:16 -08:00
Anton Tayanovskyy ac3f0a36c2
Update pkg -> sdk dependency for 3.17.1 (#8391) 2021-11-09 16:54:45 -05:00
Anton Tayanovskyy 9c707b3baf
Prepare for v3.17.1 release (#8390) 2021-11-09 16:38:21 -05:00
Fraser Waters a526db129a
Move gopls settings to .vscode from .devcontainer (#8383)
These gopls settings should apply to any vscode instance, not just ones in devcontainers.
2021-11-09 10:54:52 +00:00
Anton Tayanovskyy afcbcd3a51
7947: docgen for $fnOutput forms (#8293)
* Toward doc gen of fn.Output version signatures

* Fixup Python docgen, and reorder forms so the direct form comes firs

* Respect go opt-out flag

* Fix tempalte bug with unbalanced HTML tags

* Edit CHANGELOG_PENDING.md

* Merge codeblocks in the function template

* Accept docs changes
2021-11-08 17:07:09 -05:00
Komal 9a30f36c93
[auto/python] - Fix deserialization of event (#8375)
Fixes the deserialization for the `metadata` property on `ResourcePreEvent`, `ResOutputsEvent` and `ResOpFailedEvent`.
2021-11-08 13:05:04 -08:00
Fraser Waters b96e6a4204
Increase default go test timeout (#8380)
Our makefiles always run go test with a 1h timeout. This updates the default vscode settings to the same.
2021-11-08 18:07:24 +00:00
Anton Tayanovskyy e37892ac4a
Fix 8322 (#8339)
* Fix 8322

* Untabify

* Untabify again

* Yet More untabify

* More untabify

* Final untabify

* Add CHANGELOG_PENDING

* Apply suggestions from code review

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

* PR feedback

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-11-08 10:45:26 -05:00
Anton Tayanovskyy 99fdad0ed9
Fix python dependencies issues in GHA (#8361) 2021-11-06 00:55:17 -07:00
Fraser Waters f8a98b2a86
Fix devcontainer Dockerfile build (#8358)
Something has changed in the base image such that the directory
/etc/sudoers.d doesn't exist. Simple fix, `mkdir -p` that directory
before we write to it.
2021-11-04 21:00:32 +00:00
Justin Van Patten 414ef7e9d0
[programgen/go] Don't change imported resource names (#8353)
When importing a resource in Go, we change resource names with hyphens to snake_case. This happens because we introduced a change that converts the resource name to a valid Go identifier so it can be used as a local variable. But we were also using this converted name as the string resource name, which causes problems with import: the imported resource in the state file has the original resource name, but the generated program uses the converted name, causing Pulumi to delete and recreate the resource when adopting the generated import code.

This change fixes the issue by maintaining the original resource name, and only using the converted name for variables.
2021-11-04 09:28:48 -07:00
Fraser Waters b58c39476f
Fix cmdutil.PrintTable to handle ansi escapes and non-byte glyphs (#8344)
Fixes two bugs in how padding was calculated in PrintTable.

Firstly we remove all ANSI escape codes from the string before measuring
how wide it is. Secondly we measure glyph count (using rivo/uniseg) not
byte or rune count of the string.

Together these fix the padding/alignment issues I saw when using
PrintTable with plan output. They also slightly change the layout of
"pulumi stack", for example the below is printed with current master and
has 6 characters of space for padding between SecurityGroup and
web-secgrp:

```
Current stack resources (4):
    TYPE                                        NAME
    pulumi:pulumi:Stack                         aws-cs-webserver-test
    ├─ aws:ec2/securityGroup:SecurityGroup      web-secgrp
    ├─ aws:ec2/instance:Instance                web-server-www
    └─ pulumi:providers:aws                     default_4_25_0
```

While printed with this commit you only get 2 characters of space for
padding (which is correct, the column gap is set to "  "):
```
Current stack resources (4):
    TYPE                                    NAME
    pulumi:pulumi:Stack                     aws-cs-webserver-test
    ├─ aws:ec2/securityGroup:SecurityGroup  web-secgrp
    ├─ aws:ec2/instance:Instance            web-server-www
    └─ pulumi:providers:aws                 default_4_25_0
```
2021-11-04 10:06:20 +00:00
Anton Tayanovskyy 7dd1865575
Clean up changelog (#8351) 2021-11-03 17:17:53 -04:00
Justin Van Patten 4043137c35
Clean CHANGELOG_PENDING.md after v3.17.0 release (#8350) 2021-11-03 13:55:43 -07:00
Justin Van Patten 7e2c74d58c
Delete redundant docker step from release workflow (#8347) 2021-11-03 20:51:31 +02:00
Justin Van Patten f989e1cc9d
Update pkg -> sdk dependency (#8346) 2021-11-03 11:25:20 -07:00
Justin Van Patten 5b10c99bab
Prepare for v3.17.0 release (#8345) 2021-11-03 11:01:03 -07:00
Pat Gavlin af151b60c5
[codegen/go] Slightly simplify enum type gen. (#8341)
- Remove enumElementType, whose functionality duplicates work done in
  argsTypeImpl
- Clarify the args- vs. Go-ness of the two element types

This is prep work for #7943. These changes should not produce codegen diffs.
2021-11-02 17:41:06 -07:00
Emiliza Gutierrez 14211eea10
Updating requirements.txt to use 3.x series of pulumi (#8337) 2021-11-02 15:25:26 -07:00
Emiliza Gutierrez d243efae19
Revert "[python/sdk] - Remove python 3.6 support (#8161)" (#8332)
This reverts commit 895ae970ac.
2021-11-02 10:19:01 -07:00
Ian Wahbe e629bc32d5
Expand dependencies when marshaling output values (#8301)
* Expand dependencies when marshaling output values

[sdk/python]

* Update CHANGELOG_PENDING.md

* Use existing code

* Fix lint
2021-11-01 11:10:27 -07:00
Anton Tayanovskyy 343b4a3501
Fix #8172 (#8320)
* Fix #8172

* Accept test baselines

* Update CHANGELOG_PENDING
2021-11-01 13:21:01 -04:00
Fraser Waters 6890b9acc9
Check in default vscode settings (#8319)
Currently this is just setting go.buildTags to "all" so the language
specific tests are included in build and test commands by default.

Missing this leads to the confusing (at least to new people) behavior
of clicking run test on a test method and vscode then saying there is no
test to run.
2021-11-01 15:15:21 +00:00
Fraser Waters d39a14432f
Don't throw on type mismatches in the dotnet sdk (#8286)
* Don't throw on type mismatches in the dotnet sdk

Fixes #7329

The converter will no longer throw if resource providers return data
that does not match the expected type declared in the dotnet sdk.
Instead a warning will be logged for the resource and the value will be
set to `default(T)`.
2021-10-29 17:35:17 +01:00
Fraser Waters e71fd81fe8
Type inference for out var differs by compiler (#8312)
While our CI seems happy with this line of code on master, my machine
with the 3.1 sdk is resolving it to non-nullable type and complaining
about the "= null" line later.

```
LocalWorkspace.cs(389,27): error CS8600: Converting null literal or
possible null value to non-nullable type.
[/workspaces/pulumi/sdk/dotnet/Pulumi.Automation/Pulumi.Automation.csproj]
```

Quick fix to just not use "var" here.
2021-10-29 16:29:45 +01:00
Ian Wahbe e38876f7af
[sdk/go] Respect default parent in go aliases. (#8288)
* Respect default parent in go aliases.

* Update changelog

* Handle empty parrents correctly

* Allow specifying no parent

* clarify variable name

* Improve `Unparent` ergonomics

* Take t0yv0's suggestion

* Adopt @t0yv0's tests and doc comments.

* Make NoParent,Parent,ParentURN mutually exclusive
2021-10-28 17:25:31 -07:00
Fraser Waters 470893a980
Fix module names to match paths (#8304) 2021-10-28 16:18:15 +01: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
Praneet Loke 9a78ca1ca4
[codegen/schema] Add DisplayName and Publisher to the schema (#8276) 2021-10-27 12:53:09 -07:00
Komal 895ae970ac
[python/sdk] - Remove python 3.6 support (#8161) 2021-10-27 10:35:46 -07:00
Justin Van Patten fbf62399ca
[sdk/go] Fix regression marshaling assets/archives (#8290)
This change fixes a regression marshaling assets/archives that was introduced after adding support for marshaling output values.

For example, when setting an `Asset` on a field typed as `AssetOrAchiveInput`, in `marshalInput`, the input was being converted into an `AssetOrArchiveOutput` via the `ToAssetOrArchiveOutputWithContext`. Awaiting the output returns an `*asset` struct, which is itself an `AssetInput`, which causes infinite recursion when passed recursively to `marshalInput`.

The fix is to skip the `Input` checks in recursive calls, which is equivalent to the previous behavior before the regression was introduced.

Another issue was that when the input is converted to an output, this would result in `marshalInput` always returning an output value, even if the original passed-in value was not an output. To address this, if the output's value is known, not a secret, and has no dependencies, we can return the value itself rather than wrapping it as an output.
2021-10-27 08:44:42 -07:00
Ian Wahbe 530641576d
[codegen/go] allow plain default types (#8254)
* Respect `plain` when generating default values.

* Add new test

* Simplify test case

* Add indirection to allow taking references

* Reflect indirection problem in tests

* Remove Plain fields. Base off of primitive type

* Reenable docs

* Update changelog

* Implement always default solution

* Fix test by pulling in master

* Add enum test and cleanup

* Fix const handling

* Clarify the changelog
2021-10-26 17:18:48 -07:00
Komal 2f433d64b7
[cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07:00
Ian Wahbe c8e117a37d
Handle invalid Pulumi CLI version (#8289)
* Handle invalid Pulumi CLI version

* Add clarifying comments and improve error message.

* Update go version of `validatePulumiVersion`
2021-10-26 16:20:45 -07:00
Fraser Waters a199ba8bb5
Fix race condition in TaskMonitoringHelper (#8294)
* Fix race condition in TaskMonitoringHelper

Fixes #8163

TaskMonitoringHelper was using two seperate trackers for Idle and
FirstException and then calling WhenAny on both to see which state
happened first. This was racy as you could end up completing a task with
an exception but getting the idle tracker fire first, resulting in
TaskMonitoringHelper thinking no exception had happened.

I've combined the two trackers into TaskMonitoringHelper now. At each
task completion we check for exceptions and then idleness.

* Add changelog
2021-10-26 22:37:47 +01:00
Ben Schiborr df61004e3f
Ability to require minimum Python version (#8296)
Co-authored-by: Komal <komalsali@gmail.com>
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-10-26 14:33:21 -07:00
Carlos Tadeu Panato Junior 1c0a7e4907
reformat error message string (#8284)
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-10-26 14:55:25 -06:00
Paul Stack 52ba8b446c
Cleanup of all docker operations since moving to pulumi/pulumi-docker-containers (#8252)
Co-authored-by: Josh Kodroff <josh@pulumi.com>
2021-10-26 20:37:33 +03:00
Fraser Waters b39c81e4cb
Improve error message and add test for #1440 (#8268)
* Improve error message and add test for #1440

* lint

* lint

* Use %w instead of errors.Wrap
2021-10-26 16:55:52 +01:00
svangordon-fruit 22d2ef247f
Allow hyphens in middle portion of token (#8282) 2021-10-25 17:15:17 -07:00
Liam White 6e3e17ef28
Enable workaround for Yarn workspaces for inline functions (#8215)
See https://github.com/pulumi/pulumi/issues/2661\#issuecomment-939531284 for context.

Bascially, yarn workspaces rely on symlinks for monorepo-local packages.

I think this also resolves https://github.com/pulumi/pulumi/issues/2980

Signed-off-by: Liam White <liam@tetrate.io>
2021-10-25 10:13:09 -07:00
Anton Tayanovskyy 979f8d5c85
Clean CHANGELOG_PENDING.md after v3.16.0 release (#8272) 2021-10-20 14:16:56 -04:00
Anton Tayanovskyy b8514450b5
Update pkg -> sdk dependency for v3.16.0 (#8271) 2021-10-20 14:11:38 -04:00
Anton Tayanovskyy 12a5a52aab
Prepare for v3.16.0 release (#8270) 2021-10-20 14:08:34 -04:00
Fraser Waters 02ed28dd8c
Update go version in brew command line in CONTRIBUTING.md (#8258)
The go version in the brew command line didn't match the version of go listed above in the list of requirements.
2021-10-20 09:30:39 +01:00
Praneet Loke d73c380bef
[codegen/docs] Sort the package tree items (#8262)
* Sort the modules, resources and functions individually as the package tree is created

* Update package tree test
2021-10-19 15:21:39 -07:00