Commit graph

3428 commits

Author SHA1 Message Date
CyrusNajmabadi ee5b13cb10
Update changelog (#2466) 2019-02-22 01:00:00 -08:00
CyrusNajmabadi 27b04c4c62
Have child resources update their parent urn to include themselves in its dependencies. (#2299) 2019-02-21 20:18:29 -08:00
Sean Gillespie ce26bd871f
Decrease log level for HTTP requests and responses (#2460)
* Decrease log level for HTTP requests and responses

Logging each HTTP request and response can get quite chatty, especially
when publishing a lot of events. This increases the verbosity level of
these logs so that they don't get emitted at level 9, which is the
general level that providers use when issuing verbose logs.

* Appease linter
2019-02-20 09:20:01 -08:00
Justin Van Patten b064a03054
Return error from stack tag commands in local mode (#2457)
Instead of operating as no-ops, return an error to make it more clear
that these commands are not currently implemented when using --local
mode.
2019-02-19 16:07:57 -08:00
Luke Hoban b6a9814e67
Better log messages for replaces/changes (#2452)
We previously logged the number of replaces and changes returned from a call to Diff, but not the actual properties that were forcing replace.  Several times we've had to debug issues with unexpected replaces being proposed, and this information is very useful to have access to.

Changes the verbose logging to include the property names for both replaces and changes instead of just the count.
2019-02-15 12:02:03 -08:00
Sean Gillespie e0b516d0cc
Fix an issue with empty ID for CustomResource (#2449)
* Fix an issue with empty ID for CustomResource

The Python runtime was checking the ID field it receives from the engine
against None, assuming that the engine would not set the ID field if one
was not present. However, it does set the ID field; it is set to the
empty string when an ID is not known.

This commit fixes an issue that can cause certain IDs to be erroneously
considered to be known during previews, which can cause problems during
the Check phase of resources that directly reference IDs of other
resources.

* Add CHANGELOG
2019-02-15 09:55:19 -08:00
David J. Felix 7c42f71c3c fix: overhaul the Dockerfile (#2442)
- Pick python as a base image. Debian build tools depend on 3.5, so don't fight that battle, just use an existing solution
- Fixes #2435
- Move the pulumi install to the bottom. Rule of thumb is you always install deps first then your software so you're not thrashing the dockerfile build because you only build images when your code changes, not when deps change.
- Do all of the dep work in one step and clean up. This makes the image have way fewer layers and makes the image a bit smaller
- Get consistent with repo addition. I'm not sure if this is the best way, but it's better.
- Add some failure handling to curl commands
- Avoid crazy ass curl-pipe-bash install scripts when possible in favor of crazy ass curl-pipe-apt-key 😨 
- Add some github actions stuff in case people want to use this for actions. I'm here because the github action is wack, and I'm trying to align your dockerfiles across both repos.
2019-02-14 14:58:02 -08:00
Sean Gillespie 406c8ea16d
Add a test for exporting Futures (#2447)
It should be possible to export Futures as stack outputs - this test
ensures that this is the case.
2019-02-13 14:05:29 -08:00
Sean Gillespie c720d1329f
Enable delete parallelism for Python (#2443)
* Enable delete parallelism for Python

* Add CHANGELOG.md entry

* Expand changelog message - upgrade to Python 3

* Rework stack rm test

The service now allows removing a stack if it just contains the top
level `pulumi:pulumi:Stack` resource, so we need to actually create
another resource before `stack rm` fails telling you to pass
`--force`.

Fixes #2444
2019-02-12 14:49:43 -08:00
Luke Hoban 06d3c7811f
Fix date text 2019-02-11 15:28:17 -08:00
Matt Ellis 4229f85fda
Merge pull request #2441 from DavidJFelix/patch-1
fix: typo in yarn installation
2019-02-08 19:13:58 -08:00
David J. Felix 617083f855
fix: actually update apt after adding a list for yarn 2019-02-08 22:03:10 -05:00
David J. Felix 666a4a6fd8
fix: typo in yarn installation
- per documentation, looks like you missed a character https://yarnpkg.com/lang/en/docs/install/#debian-stable
2019-02-08 21:59:38 -05:00
CyrusNajmabadi 57a228c2ab
Fix issue with comments throwing off function/class serialization (#2438) 2019-02-08 14:58:24 -08:00
Qingping Hou 46fd8b3b5c fix crash in resource constructor validation check (#2349)
If parent is not a valid resource, throw a RunError instead.
ResourceError needs to be created with a valid resource.
2019-02-08 08:05:33 -08:00
Matt Ellis 687a780b20 Show a better error when --force needs to be passed to stack rm
When `pulumi stack rm` is run against a stack with resources, the
service will respond with an error if `--force` is not
passed. Previously we would just dump the contents of this error and
it looked something like:

`error: [400] Bad Request: Stack still has resources.`

We now handle this case more gracefully, showing our usual "this stack
still has resources" error like we would for the local backend.

Fixes #2431
2019-02-07 15:25:02 -08:00
Matt Ellis 6f386567f6 Don't install the just built package into user's site-packages
We do all our work in a virtualenv and across repositories we now
consume dependencies via pypi (also installed in a virtualenv) so best
case install into the user site packages wastes time and maybe prints
some warnings and worse case it clobbers something they've installed
for real.
2019-02-01 15:49:36 -08:00
Luke Hoban c974bff8e0 Display current logged in user
See pulumi/docs#826.
2019-02-01 11:27:49 -08:00
CyrusNajmabadi 5211954f3a
Break out Resource and Output into their own files (#2420) 2019-01-31 18:08:17 -08:00
Matt Ellis 9eba0d3b37 Run fewer jobs for PRs and pushes
Today, we run 4 jobs for every push or PR build. Three Linux builds
which only differ by node version and an macOS build that also has a
different node version from the rest.

In practice this ends up generating a great deal of jobs during
development, given some of our workflows and these jobs often don't
find interesting issues.

We're going to start by relaxing things in the following ways:

- For a given PR, we'll just run a single Linux leg (as well as the
  Windows leg we get from AppVeyor).

- For push jobs (which happen either when a PR is merged into master,
  or a branch named `features/*` is pushed, we'll run a Linux leg and
  and macOS leg (the macOS leg is run per push, so we build and
  publish of the CLI for macOS builds)

- For our nightly cron job, we'll continue to run all three Linux
  legs, to get coverage across different versions of nodejs.

If we end up seeing an uptick in regressions found by these jobs after
each commit, we can re-evaluate or pre checkin strategy.
2019-01-31 17:59:17 -08:00
Matt Ellis d9b6d54e2e Use prefered new pulumi.Config() form
In #2330 there was a case where if you didn't pass a value to the
`pulumi.Config()` constructor, things would fail in a weird manner.

This shouldn't be the case, and I'm unable to reproduce the issue. So
I'm updating the test to use the form that didn't work at one point so
we can lock in the win.

Fixes #2330
2019-01-31 16:11:57 -08:00
Sean Gillespie 355f6fabe1
Typo: ProviderReference -> ProviderResource (#2418) 2019-01-31 16:03:01 -08:00
Matt Ellis fbae997456 Don't clobber dev tag from PR builds 2019-01-31 14:55:01 -08:00
Pat Gavlin 6e90ab0341
Add support for explicit delete-before-replace (#2415)
These changes add a new flag to the various `ResourceOptions` types that
indicates that a resource should be deleted before it is replaced, even
if the provider does not require this behavior. The usual
delete-before-replace cascade semantics apply.

Fixes #1620.
2019-01-31 14:27:53 -08:00
Pat Gavlin 128afe3323
Use "discard" when deleting read resources (#2280)
In general, a "delete" in Pulumi is destroying an actual physical
resource. In the case of a read resource, however, the delete is
merely removing the resource from the stack; the physical resource
is not affected. These changes attempt to clarify this situation by
using the term "discard" rather than "delete".

Fixes #2015.
2019-01-31 13:48:44 -08:00
Matt Ellis a627cf817a Ensure InvokeRequest is defined
InvokeRequest is defined in provider_pb.js not resource_pb.js. Require
that module instead.
2019-01-31 12:00:32 -08:00
Sean Gillespie 87b8b4dcda
Clean up documentation for Python SDK (#2398)
* Clean up documentation for Python SDK

The Python SDK currently does a couple of bad things that make it
difficult to generate documentation:

1. It "wildcard-imports" submodules without each module specifying an
__all__ member
2. Documentation strings don't have a consistent format
3. Documentation strings are in Markdown and not reStructuredText

To remedy this, this commit addresses 1 by explicitly specifying which
members are being exported from submodules, so that we can see in one
place exactly what the public surface area of the pulumi package is. For
2 and 3, this commit fixes a large number of documentation strings to
contain metadata tags that Sphinx is capable of reading. This allows us
to generate high-quality documentation directly from the source without
having to manually parse docstrings.

* Please pylint
2019-01-31 10:36:03 -08:00
Matt Ellis 07130913df Prepare for v0.16.13 2019-01-30 21:17:34 -08:00
Matt Ellis b0288dd8aa
Merge pull request #2409 from pulumi/ellismg/enhance-stack-reference-error
Improve StackReference error message
2019-01-30 21:09:39 -08:00
Matt Ellis 42ea5d7d14 Pass project in StackReference test 2019-01-30 16:54:12 -08:00
Matt Ellis 50c2ebbdd5 Improve StackReference error message
Because of the change to include a stack's project as part of its
identity in the service, the names passed to StackReference now
require the project name as well.

Improve the error message when they do not include them.
2019-01-30 15:57:44 -08:00
Sean Gillespie 1d5526d292
Work around commonjs protoc bug (#2403)
* Work around commonjs protoc bug

When compiling with the commonjs target, the protoc compiler still emits
references to Closure Compiler-isms that whack global state onto the
global object. This is particularly bad for us since we expect to be
able to make backwards-compatible changes to our Protobuf definitions
without breaking things, and this bug makes it impossible to do so.

To remedy the bug, this commit hacks the output of protoc (again) with
sed in order to avoid ever touching the global object. Everything still
works fine because the commonjs target (correctly) exports the protobuf
message types via the module system - it's just not writing to global
anymore.

* Fix status.proto

* Don't hack status.proto
2019-01-29 17:07:47 -08:00
CyrusNajmabadi 9c95a7e041
add more test logging. (#2405) 2019-01-29 13:14:06 -08:00
Pat Gavlin 35c60d61eb
Follow up on #2369 (#2397)
- Add support for per-property dependencies to the Go SDK
- Add tests for first-class secret rejection in the checkpoint and RPC
  layers and language SDKs
2019-01-28 17:38:16 -08:00
Pat Gavlin 1ecdc83a33 Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.

We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.

This is perhaps clearer when described by example. Consider the
following dependency graph:

  A
__|__
B   C
|  _|_
D  E F

In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.

In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 09:46:30 -08:00
CyrusNajmabadi edd742a0c4
Allow derived classes to call registerOutputs with no args. (#2393) 2019-01-26 17:59:11 -08:00
CyrusNajmabadi 8fee7fb460
Include more data when running commands during tests. (#2392) 2019-01-25 16:34:37 -08:00
Matt Ellis e950ab1e51 Update CHANGELOG.md for 0.16.12 2019-01-25 15:26:01 -08:00
Matt Ellis 597a2861b0
Merge pull request #2386 from pulumi/ellismg/fix-2039
Include project name in stack's identity.
2019-01-25 13:43:48 -08:00
Matt Ellis f94e2e7bcc Update CHANGELOG.md 2019-01-25 12:52:33 -08:00
Matt Ellis 236c58f4e6 Small code cleanups 2019-01-25 09:48:27 -08:00
Matt Ellis 05918a90d9 Clean project name before passing it as a filter
The service also does this filtering on requests, because we'll need
to support older clients, but it would be nice if the CLI itself also
cleaned things up.
2019-01-24 16:56:54 -08:00
Matt Ellis 129a719c72 Spelling fixes 2019-01-24 16:56:54 -08:00
Matt Ellis dc6945f078 Don't include the project name in the sugessted stack name
When stack names had to be unique across an entire organization, we
had a convention that stack names would be prefixed by the project
name, to prevent collisions.

Now that stack names are scoped within a project, we no longer need to
include the project name in the stack name. So when running `pulumi
new` to scaffhold a new project, just recommend the name `dev` for the
stack to create instead of `<project-name>-dev`.

Fixes #1417
2019-01-24 16:56:54 -08:00
Matt Ellis 902be2b0b0 Use project name as part of stack identity with cloud backend
This change starts to use a stack's project name as part of it's
identity when talking to the cloud backend, which the Pulumi Service
now supports.

When displaying or parsing stack names for the cloud backend, we now
support the following schemes:

`<stack-name>`
`<owner-name>/<stack-name>`
`<owner-name>/<project-name>/<stack-name>`

When the owner is not specificed, we assume the currently logged in
user (as we did before). When the project name is not specificed, we
use the current project (and fail if we can't find a `Pulumi.yaml`)

Fixes #2039
2019-01-24 16:56:54 -08:00
Matt Ellis c282e7280a Tighten invariant on getCloudStackIdentifier
This method should only be called with stack references for the cloud
backend. Enforce that and then clean up the resulting code a bit.
2019-01-24 16:56:54 -08:00
Matt Ellis 389a3721ec Publish Docker image as part of release process
This change does two things:

- It ensures that as part of publishing the SDK, we also publish an
  updated pulumi/pulumi docker image (tagged with both `latest` and
  `vX.Y.Z`

- Makes this image published by this repository less perscriptive in a
  workflow. The instead of having wrapper scripts that try to invoke
  Pulumi based on conventions. It is now just a base image that has
  the pulumi CLI installed, as well as the SDKs for the major cloud
  providers. We'll use this base layer in our github actions image,
  which will layer on a github actions centric workflow

Fixes #1991
2019-01-24 11:43:05 -08:00
Matt Ellis 8703df9d21 Use dep 0.5.0 in Windows CI, to match Travis 2019-01-24 09:52:14 -08:00
Pat Gavlin cfe4e127be
Add API types for the V3 checkpoint (#2384)
Resources gain two new fields: `PropertyDependencies` and
`PendingReplacement`. The former maps an input property's name to the
dependencies that may affect the value of that property. The latter is
used to track resources that have been deleted as part of a
delete-before-replace operation but have not yet been recreated.

In addition to the new fields, resource properties may now contain
encrypted first-class secret values. These values are of type `SecretV1`,
where the `Sig` field is set to `resource.SecretSig`.

Finally, the deployment type gains a new field, `SecretsProviders`,
which contains any configuration necessary to handle secrets that may be
present in resource properties.
2019-01-23 13:33:25 -08:00
Sean Gillespie b245fd7595
Use both a in-proc and out-of-proc pipenv lock (#2381)
* Use both a in-proc and out-of-proc pipenv lock

Turns out that flock alone is not sufficient to guarantee exclusive
access to a resource within a single process. To remedy this, a few
FileMutex type wraps both an in-proc mutex and an out-of-proc
file-backed mutex to achieve the goal of exclusive access to a resource
in both in-proc and out-of-proc scenarios.

This commit also uses this lock globally in the integration test
framework in order to globally serialize invocations of pipenv install.

* Remove merge markers
2019-01-23 09:32:59 -08:00