Commit graph

3965 commits

Author SHA1 Message Date
Cyrus Najmabadi e99cdc07a4 Initial work to support serializing proxies 2019-10-10 11:29:02 -07:00
Pat Gavlin 97803a6591 Prepare the CHANGELOG for 1.3.1. 2019-10-10 10:33:50 -07:00
Pat Gavlin 834e583c95
Revert "Propagate inputs to outputs during preview. (#3245)" (#3324)
This reverts commit 80504bf0bc.
2019-10-10 10:33:05 -07:00
Alex Clemmer 5e1c4d31c6 Use PulumiPolicy.yaml instead of Pulumi.yaml for PolicyPacks 2019-10-10 10:15:51 -07:00
CyrusNajmabadi 1574f6f9c2
Enable some tests that weren't actually running (#3320) 2019-10-09 20:16:16 -07:00
Chris Smith bec608d0d3
Improve error message when using PAC on out-of-date SDK (#3307)
* Fix lint warnings

* Improve error message when using PAC on old SDK

* Update pkg/resource/plugin/analyzer_plugin.go

Co-Authored-By: Justin Van Patten <jvp@justinvp.com>
2019-10-09 13:51:10 -07:00
Chris Smith 0e52e965db
Add local policy packs to summary event (#3308) 2019-10-09 13:50:28 -07:00
Pat Gavlin 7778d7ae84 Prepare the CHANGELOG for 1.3.0. 2019-10-09 11:50:21 -07:00
Ken Fukuyama 0700e6fa05 Fix invalid bullet points in stack init (#3303)
This fixes the issue where the bullet points aren't rendered correctly
by hugo.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2019-10-08 15:07:03 -07:00
Mikhail Shilkov 69743fe2bf Make the path to .pulumi folder configurable with an ENV variable (#3300)
Introduces `PULUMI_HOME` environment variable which points to a path to the path to `.pulumi` folder. Defaults to `<user's home dir> + ".pulumi"` if not specified.

Fixes #2966. In addition to plugins, it "moves" the credentials file, templates, workspaces.

`bin` folder is intact: to move it, we need to adjust all installation scripts to respect `PULUMI_HOME` and put executables in the proper `bin` folder.
2019-10-08 15:01:46 -07:00
Pat Gavlin 22799879e8 Fix the CHANGELOG. 2019-10-08 14:50:00 -07:00
Mikhail Shilkov 0b7cc93711 Run all template tests in parallel (#3296)
* Run all template tests in parallel

* Revert Makefile
2019-10-07 16:47:21 +03:00
Mikhail Shilkov 90e111ba73 Override all options in ProgramTest.With (#3264) 2019-10-07 14:11:36 +03:00
Chris Smith 97d769000d
Support renaming stack projects (#3292)
* Support renaming stack projects

* Update CHANGELOG.md

* Address PR feedback
2019-10-03 09:13:13 -07:00
CyrusNajmabadi e019e12469
Perform our closure tree-shaking when the code contains element accesses, not just property accesses (#3295) 2019-10-02 23:34:09 -07:00
Mikhail Shilkov 96295ce322 Add -v option to go test of templates to avoid stalling in TravisCI 2019-10-03 08:28:58 +02:00
Pat Gavlin 23b7a3f337
Add scripting for updating the Homebrew formula. (#3291)
This script will run during OS X legs, and will open a PR to update the
Homebrew formula for Pulumi on each new release.
2019-10-02 16:04:58 -07:00
Pat Gavlin ecd028104c
Fetch CLI verisons from Homebrew where applicable. (#3290)
If the CLI seems to have been installed using Homebrew, do not consult
the service for the latest version. Instead, consult the Homebrew JSON
API.

Fixes #3230.
2019-10-01 13:34:42 -07:00
Pat Gavlin 5ad307d457
Close test language runtime connections. (#3289)
This should help address the issues we've begun seeing with too many
open files when running tests on OS X.
2019-10-01 12:12:06 -07:00
CyrusNajmabadi 52884096e9
Add support for updating a subset of resources in the stack (i.e. --target) (#3251) 2019-09-30 23:41:56 -07:00
Alex Clemmer f7f4333909 Expose queryable.Resolved<T> publicly
Fixes pulumi/pulumi-policy#92.
2019-09-30 16:49:11 -07:00
Alex Clemmer 429bde332b Print PolicyPacks run as part of update summary
Fixes pulumi/pulumi-policy#69.
2019-09-30 14:49:21 -07:00
Pat Gavlin 80504bf0bc
Propagate inputs to outputs during preview. (#3245)
These changes restore a more-correct version of the behavior that was
disabled with #3014. The original implementation of this behavior was
done in the SDKs, which do not have access to the complete inputs for a
resource (in particular, default values filled in by the provider during
`Check` are not exposed to the SDK). This lack of information meant that
the resolved output values could disagree with the typings present in
a provider SDK. Exacerbating this problem was the fact that unknown
values were dropped entirely, causing `undefined` values to appear in
unexpected places.

By doing this in the engine and allowing unknown values to be
represented in a first-class manner in the SDK, we can attack both of
these issues.

Although this behavior is not _strictly_ consistent with respect to the
resource model--in an update, a resource's output properties will come
from its provider and may differ from its input properties--this
behavior was present in the product for a fairly long time without
significant issues. In the future, we may be able to improve the
accuracy of resource outputs during a preview by allowing the provider
to dry-run CRUD operations and return partially-known values where
possible.

These changes also introduce new APIs in the Node and Python SDKs
that work with unknown values in a first-class fashion:
- A new parameter to the `apply` function that indicates that the
  callback should be run even if the result of the apply contains
  unknown values
- `containsUnknowns` and `isUnknown`, which return true if a value
  either contains nested unknown values or is exactly an unknown value
- The `Unknown` type, which represents unknown values

The primary use case for these APIs is to allow nested, properties with
known values to be accessed via the lifted property accessor even when
the containing property is not fully know. A common example of this
pattern is the `metadata.name` property of a Kubernetes `Namespace`
object: while other properties of the `metadata` bag may be unknown,
`name` is often known. These APIs allow `ns.metadata.name` to return a
known value in this case.

In order to avoid exposing downlevel SDKs to unknown values--a change
which could break user code by exposing it to unexpected values--a
language SDK must indicate whether or not it supports first-class
unknown values as part of each `RegisterResourceRequest`.

These changes also allow us to avoid breaking user code with the new
behavior introduced by the prior commit.

Fixes #3190.
2019-09-30 11:03:58 -07:00
Chris Smith 7254b3db4d
Remove vestigial field from apitype (#3284) 2019-09-30 08:33:47 -07:00
Luke Hoban 9374c374c3
Transformations (#3174)
Adds the ability to provide `transformations` to modify the properties and resource options that will be used for any child resource of a component or stack.

This offers an "escape hatch" to modify the behaviour of a component by peeking behind it's abstraction.  For example, it can be used to add a resource option (`additionalSecretOutputs`, `aliases`, `protect`, etc.) to a specific known child of a component, or to modify some input property to a child resource if the component does not (yet) expose the ability to control that input directly.  It could also be used for more interesting scenarios - such as:
1. Automatically applying tags to all resources that support them in a stack (or component)
2. Injecting real dependencies between stringly-referenced  resources in a Helm Chart 
3. Injecting explicit names using a preferred naming convention across all resources in a stack
4. Injecting `import` onto all resources by doing a lookup into a name=>id mapping

Because this feature makes it possible to peek behind a component abstraction, it must be used with care in cases where the component is versioned independently of the use of transformations.  Also, this can result in "spooky action at a distance", so should be used judiciously.  That said - this can be used as an escape hatch to unblock a wide variety of common use cases without waiting on changes to be made in a component implementation.  

Each transformation is passed the `resource`, `name`, `type`, `props` and `opts` that are passed into the `Resource` constructor for any resource descended from the resource that has the transformation applied.  The transformation callback can optionally return alternate versions of the `props` and `opts` to be used in place of the original values provided to the resource constructor.

Fixes #2068.
2019-09-29 11:27:37 -07:00
Alex Clemmer ec85408eee Don't throw away secrets in calls to Analyze 2019-09-27 15:26:13 -07:00
Chris Smith 2801bfe0c2
Update apitype.StackRenameRequest // Support project renames (#3273)
* Update apitype.StackRenameRequest

* Add support for renaming projects in Snapshots

* Address PR feedback
2019-09-26 15:23:09 -07:00
Pat Gavlin dd8155ae20 Prepare the CHANGELOG for 1.2.0 2019-09-26 13:27:57 -07:00
Chris Smith fbb28eacc9
Fix problem with divergent project names (#3269)
* Prevent stack/workspace project name mismatch

* Account for Pulumi.yaml missing entirely
2019-09-26 12:27:37 -07:00
Praneet Loke a0a86155c1
Add the config array option to the preview command. (#3271)
* Add the config array option to the preview command.

* Update changelog
2019-09-25 17:45:36 -07:00
Praneet Loke 4404dfb470
Add codefresh CI detection. Thanks to @fernandocarletti. (#3270)
* Add codefresh CI detection. Thanks to @fernandocarletti.
2019-09-25 14:41:13 -07:00
Chris Smith a128b613ac
Remve use of GENERIC_CI_SYSTEM (#3259) 2019-09-25 14:03:00 -07:00
CyrusNajmabadi 0ea50f458e
Print destroyed outputs when a stack is destroyed. (#3261) 2019-09-24 17:15:46 -07:00
Mikhail Shilkov 6f37982048 Use a stack name other than 'dev' to work around #3250 (#3256) 2019-09-24 08:31:07 -07:00
Mikhail Shilkov f90ec766d0 Speed up the test runs (#3254)
* Faster test runs

* Remove template tests from all but cron runs
2019-09-23 10:10:11 -07:00
CyrusNajmabadi ef7b7d0bd1
Share target checking code. (#3252) 2019-09-20 17:50:44 -07:00
CyrusNajmabadi c1ff9c37f8
Delete specific target (#3244) 2019-09-19 19:28:14 -07:00
CyrusNajmabadi da0bcdccda
Coerce dictionary values to a list. (#3242) 2019-09-18 15:58:20 -07:00
Pat Gavlin 40b0f8cbab
Cache ciphertext for secret properties. (#3183)
This caching is enabled by wrapping the `secrets.Manager` returned by
`DefaultSecretsProvider.OfType` in an outer `secrets.Manager` that
cooperates with `stack.{Serialize,Deserialize}PropertyValue`. Ciphertext
is cached on a per-secret-instance basis (i.e. not a per-plaintext-value
basis). Cached ciphertext is only reused if the plaintext for the secret
value has not changed. Entries are inserted into the cache upon both
encryption and decryption so that values that originated from ciphertext
and that have not changed can aoid re-encryption.

Contributes to #3178.
2019-09-18 15:52:31 -07:00
CyrusNajmabadi c53c0b6c15
Produce appropriate diagnostic when asked to refresh a resource that we cannot find. (#3246) 2019-09-18 14:28:42 -07:00
Erin Krengel cde4ecd84a
Add Applied to GetPolicyPackResponse (#3241) 2019-09-18 14:27:08 -07:00
CyrusNajmabadi 1387afec8f
Color 'reads' as cyan so they don't look like 'creates'. (#3236) 2019-09-18 09:49:13 -07:00
CyrusNajmabadi f788eb8fc1
Add support for refreshing specific targets. (#3225) 2019-09-17 18:14:10 -07:00
Mikhail Shilkov 5e3cc50f4b Move a dot for a better prompt in local login 2019-09-17 01:42:06 -07:00
Erin Krengel 938c2e8bd8
Fix parsing of Gitlab urls w subgroups (#3239) 2019-09-16 20:35:23 -07:00
Pat Gavlin 82204230e1
Improve tracing support. (#3238)
* Fix some tracing issues.

- Add endpoints for `startUpdate` and `postEngineEventsBatch` so that
  spans for these invocations have proper names
- Inject a tracing span when walking a plan so that resource operations
  are properly parented
- When handling gRPC calls, inject a tracing span into the call's
  metadata if no span is already present so that resource monitor and
  engine spans are properly parented
- Do not trace client gRPC invocations of the empty method so that these
  calls (which are used to determine server availability) do not muddy
  the trace. Note that I tried parenting these spans appropriately, but
  doing so broke the trace entirely.

With these changes, the only unparented span in a typical Pulumi
invocation is a single call to `getUser`. This span is unparented
because that call does not have a context available. Plumbing a context
into that particular call is surprisingly tricky, as it is often called
by other context-less functions.

* Make tracing support more flexible.

- Add support for writing trace data to a local file using Appdash
- Add support for viewing Appdash traces via the CLI
2019-09-16 14:16:43 -07:00
Erin Krengel 48a00b507d
bump api version number to indicate PaC support (#3237) 2019-09-16 13:04:29 -07:00
Matt Ellis 1e2f4107c4 Reset patch to 0 when generating a version for a minor update
This fixes an issue we didn't forsee. If we do a patch release by
tagging a commit as `v1.1.1`, the next version we generate will be
`v1.2.1-alpha.....` which is not what we want. When bumping the minor
version, we should reset the patch version to zero, regardless of what
it is.
2019-09-13 15:50:38 -07:00
Matt Ellis b019bc571e Use Python 3
Use `python3` and `pip3` explicitly, as we now depend on Python 3.
2019-09-13 11:58:23 -07:00
Mikhail Shilkov 6450e28a22 Add tests for templates (#3126)
* Add a test for a single template

* Test all templates

* Encrypting the GCP Credentials file for tests

* Exclude some tests for now

* Exclude tests that aren't ready

* Exclude tests that aren't ready

* Enable openstack tests
2019-09-13 00:41:46 +02:00