Commit graph

486 commits

Author SHA1 Message Date
Ian Wahbe 72a4e1fc3f
Update pkg -> sdk dependency (#8481) 2021-11-22 14:39:54 -08:00
Ian Wahbe d9dd88c740
Add tsconfig option to specify tsconfig path (#8452)
* Add tsconfig option to specify tsconfig path

* Add CHANGELOG entry and fix lint

* Add a test

* Fix test
2021-11-22 11:42:39 -08:00
Ian Wahbe b0dfad44c5
Update pkg -> sdk dependency (#8442) 2021-11-17 15:24:09 -08:00
Justin Van Patten ba39ed9ad4
Add tests that return failures from Call (#8424)
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
- [sdk/go] - Allow specifying Call failures from the provider.
- Add tests that return failures from Call.
2021-11-16 08:58:46 -08:00
Justin Van Patten f6cc3d375c
Add output values integration tests (#8421) 2021-11-15 15:42:04 -08:00
Anton Tayanovskyy 372ddc7e5c
Skip flaky tests for now (#8420) 2021-11-15 15:17:20 -05:00
Ian Wahbe 554660b23a
Implement the --exclude-protected feature (#8359)
* Implement the --exclude-protected feature

This piggybacks on the same machinery used by the --target flag. By
examining the stack, we find a list of all resources managed by
Pulumi (in that stack). We then form them into a DAG, and mark all
resources as either protected or unprotected.

A resource is protected it has the `Protect` flag set or is has a child
with the `protect` flag set. It is unprotected otherwise.

We then pass the urns of unprotected resources to the update options
passed to the destroy operation in the same way that `--target` does.

* Update changelog

* Handle providers correctly

* Add integration test

* Protect dependencies of protected resources

* Handle --exclude-protected in separate function

* Simplify implementation via DependencyGraph

* Add TransitiveDependenciesOf

* Cleanup unused functions

* Gate printed message behind !jsonDisplay

* Ensure provider is not `""`

* Clean up documentation (and some code)
2021-11-15 11:45:14 -08:00
Justin Van Patten c4c1f3d449
Add tests that create resources from methods (#7701) 2021-11-15 11:17:53 -08:00
Joe Duffy 0a38bc295c
Fix issue with --target deletion dependent calculation (#8360)
* Fix issue with --target deletion dependant calculation

The code that computed --target deletion dependants was not correct.
It used parent/child component relationships, but did not respect actual
DAG dependencies. As a result, it could erroneously leave hanging
references to resources that no longer exist after performing a
`pulumi destroy --target X` operation. This manifested in bugs like
https://github.com/pulumi/pulumi/issues/6283, which is fixed by this
change. The solution is to compute the (transitive!) dependency graph
correctly, factoring in both parent/child, as well as explicit and
implicit, dependencies. The existing logic does the correct thing once
we do this. I've also added tests for this area, including regression
tests that cover transitive dependency relationships, as well as ones
that would cause an infinite loop given a naive implementation.

* Add a changelog entry

* Fix failing test to include all destroyed targets

Unless I'm missing something, the entire tree should be deleted
in this test case because A is the ancestor for the entire tree.

* Use DependencyGraph to compute dependents

Per code review feedback from @pgavlin.

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2021-11-12 10:02:51 -05:00
Anton Tayanovskyy ac3f0a36c2
Update pkg -> sdk dependency for 3.17.1 (#8391) 2021-11-09 16:54:45 -05: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
Justin Van Patten f989e1cc9d
Update pkg -> sdk dependency (#8346) 2021-11-03 11:25:20 -07:00
Emiliza Gutierrez 14211eea10
Updating requirements.txt to use 3.x series of pulumi (#8337) 2021-11-02 15:25:26 -07: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
Komal 2f433d64b7
[cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07: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
Anton Tayanovskyy b8514450b5
Update pkg -> sdk dependency for v3.16.0 (#8271) 2021-10-20 14:11:38 -04:00
Fraser Waters a45f408c49
Deduplicate a couple of go module names (#8232)
Picked these duplicates up when running gopls across the whole repo.
Module names should reflect the folder path they are in, but these two
looked like copy-paste bugs.
2021-10-15 14:21:12 +01:00
Anton Tayanovskyy a6e02d6dd8
Update pkg and tests pulumi/sdk refs to v3.15.0 (#8227) 2021-10-14 21:05:42 -04:00
Ian Wahbe 20287afdd7
Iwahbe/8000/uprgade go versions (#8171)
* Upgrade the pulumi cli to go1.17.1

* Run go mod tidy

* Update CHANGELOG_PENDING.md

* Update pkg/go.mod for go1.17

* Update sdk and tests
2021-10-11 09:47:08 -07:00
Emiliza Gutierrez a1b6b1ee6a
update go.sum files (#8151) 2021-10-06 11:54:59 -07:00
Emiliza Gutierrez 083ea657c1
Updating version of pulumi sdk used to v3.14.0 (#8150) 2021-10-06 11:30:24 -07:00
Justin Van Patten a182f103cf
Update pkg -> sdk dependency (#8088) 2021-09-27 23:05:36 -07:00
Justin Van Patten ec8409bd4e
Update tests/go.mod (#8085) 2021-09-27 22:29:06 -07:00
Komal 0bcf475573
Update SDK version in pulumi/pkg (#8027) 2021-09-22 13:16:08 -07:00
Ian Wahbe 2e5fedff54
Switch from golint to revive (#8010) 2021-09-21 10:00:44 -07:00
Pat Gavlin 236ce54269
[schema] Add the Pulumi Package metaschema. (#7952)
The Pulumi Package metaschema is a JSON schema definition that describes
the format of a Pulumi Package schema. The metaschema can be used to
validate certain basic properties of a Pulumi Package schema, including
(but not limited to):

- data types (e.g. is this property a string?)
- data formats (e.g. is this string property a valid regex?)
- object shapes (e.g. is this object missing required properties?)

The schema binder has been updated to use the metaschema as its first
validation pass.

In addition to its use in the binder, the metaschema has its own page in
the developer documentation. This page is generated using a small tool,
jsonschema2md.go.
2021-09-20 12:00:42 -07:00
Justin Van Patten 0c0684af5c
Initial support for (un)marshaling output values (#7861)
This change expands the definition of `resource.Output` in the Go SDK with additional information about the output, i.e. dependencies and secretness, and adds support in the core Go RPC code for (un)marshaling output values.

Output values are marshaled as special objects ala archives, assets, and resource refs and are unmarshaled as `resource.Output` values.

Subsequent PRs will add:
 - A monitor feature for output values, which will initially be disabled by default but available to turn on via an envvar
 - Support for (un)marshaling output values in each language SDKs
 - A way for providers to indicate support for receiving output values
 - E2E tests
 - Turn the monitor feature on by default (w/ env var to disable) (Note: the current plan is to initially scope this to only be used when marshaling inputs to a multi-language component)
2021-09-13 09:05:31 -07:00
Anton Tayanovskyy 151fdff906
Lower the BrokenDynamicProvider regression test from integration to mock (#7951) 2021-09-10 17:25:48 -04:00
Paul Stack a70cf66fae
Upgrade pulumi docker image to use NodeJS 14.x (#7904)
Fixes: #7878

also, we stopp building the pulumi actions docker container as we are
now EOL as per 31st August
2021-09-09 20:49:22 +03:00
Luke Hoban f89e9a29f5
Revert "Allow Python dynamic provider resources to be constructed outside of __main__ (#7755)" (#7889)
This reverts commit ebb0e6aaed.

The changes in #7755 introduced a regression tracked in #7795.  It is not yet clear how to retain the desired behaviour introduced in #7755 while avoiding this regression, so for now we will revert those changes, and re-open #7453 to track a deeper fix.  That fix may require making changes to upstream `dill` to properly support these serialization requirements.

Fixes #7795.
2021-09-01 20:49:04 -07:00
Ian Wahbe 59f88030b7 Allow failure to cleanup 2021-08-31 00:25:50 -07:00
Ian Wahbe 703104e412 Skip failing test on windows 2021-08-30 22:53:16 -07:00
Ian Wahbe 70833d3a3c Allow windows to find commands without .exe 2021-08-30 21:36:03 -07:00
Ian Wahbe 30a042a9a1 Call os.Remove correctly 2021-08-30 19:48:50 -07:00
Ian Wahbe aa1eedf5a7 Allow windows to use NPM 2021-08-30 19:16:19 -07:00
Ian Wahbe 43114007eb Whitespace and grammer 2021-08-30 18:56:02 -07:00
Ian Wahbe 8150ef0880 Improve CI error messages
Failures unique to windows require a more informative error message to
diagnose.
2021-08-30 12:55:30 -07:00
Ian Wahbe b1271708ff Final version of the same typo 2021-08-28 11:53:17 -04:00
Ian Wahbe 9ec92fe593 Fix same typo in other copy of test 2021-08-28 02:55:00 -04:00
Ian Wahbe c40ec4a3cb Fix nodejs no snapshot failure 2021-08-28 02:06:41 -04:00
Ian Wahbe 95bbad6e3d Fix typo 2021-08-28 01:17:53 -04:00
Ian Wahbe 244b8d9ea5 Another attempt to make tests pass 2021-08-28 00:31:46 -04:00
Ian Wahbe 4d93b70d79 Set stack for node and go integration tests 2021-08-27 19:04:42 -04:00
Ian Wahbe cdcabc34f3 Fix integration tests && found bug in nodejs -t 2021-08-27 14:25:10 -04:00
Ian Wahbe b5bcc655e7 Add integration tests in each language 2021-08-27 13:39:49 -04:00
Ian Wahbe 878ab50044 Merge branch 'master' into iwahbe/2715/add-pulumi-about-command 2021-08-27 04:50:50 -04:00
Ian Wahbe 0d43d2c4a4 @jutinvp's improvements
These include:
1. Make transitive dependencies optional.
2. Use filepath instead of path.
3. Correctly consider the python virtual enviroments.
2021-08-27 04:37:09 -04:00