Commit graph

3428 commits

Author SHA1 Message Date
Matt Ellis 6e95bdda9c Merge branch 'release/0.16' into ellismg/merge-release 2018-11-16 20:22:13 -08:00
Matt Ellis 2b3c7f61c5 Rework get-version scripts
Under our old versioning system, when we started a new point release,
we'd tag the HEAD commit of master with a tag like `v0.16.6-dev` and
our scripts would use this to generate a new version number. This
required a great deal of gymnastics when producing a release and
caused us to litter these -dev tags everywhere.

To improve this, we change version number generation to the following
strategy:

1. If the commit we are building has a tag applied to it, use that tag
as the version (appending the dirty bit metadata to the version, if
needed).

2. If the commit we are bulding does not have a tag applied to it,
take the version from the next reachable tag, increment the patch
version and then append the `-dev` pre-release tag. As part of this,
we also make a slight tweek to our semver generation such that instead
of `-dev<TIMESTAMP>` we use `-dev.<TIMESTAMP>` which is more in line
with what semver recommends.
2018-11-16 20:11:04 -08:00
Matt Ellis c95890c481 Don't require stderr to be empty in a test
Because of a bug in our version scripts (which will be addressed by
pulumi/pulumi#2216) we generate a goofy version when building an
untagged commit in the release branches. That causes our logic to
decide if it should print the upgrade message or not to print an
upgrade message, because it thinks the CLI is out of date.

It then prints the upgrade message and a test fails because it is
expecting an empty stderr.

Just stop checking that stderr was empty, and just validate standard
out.
2018-11-16 20:07:24 -08:00
Matt Ellis faff805f1e Fix an issue where plugin install would fail on windows
The issue is related to this code:

https://github.com/pulumi/pulumi/blob/v0.16.4/pkg/workspace/plugins.go#L155-L195

Note that we use `defer` to ensure we close our handle to the file we
are unpacking when we encounter a file in the tarball.  However, the
defers don't run until the containing function ends, so when we go to
do the rename, or process still has a bunch of open file handles, which
prevents the directory from being renamed because it is "in use".

By doing all of the work in an anonymous function, we ensure that the
defer statements run before we go to rename the directory

Fixes #2217
2018-11-16 20:07:24 -08:00
Matt Ellis c63a99ac2d Ensure the plugins root folder exists
On clean installs, where `~/.pulumi/plugins` doesn't exist, we failed
to create the temporary directory.
2018-11-16 18:04:25 -08:00
Matt Ellis 79204ad1b2 Do not fail plugin install when the destination folder exists
This is code that should have been part of #2211 but was accidently
dropped during a rebase when responding to CR feedback.

When two installs for the same plugin are racing, the second one will
see the destination directory already exists and fail. We can safely
ignore this error.
2018-11-15 17:15:27 -08:00
Matt Ellis 76e20281f4 Fix a race when pulumi plugin install ran concurrently 2018-11-15 15:50:08 -08:00
Pat Gavlin bc08574136
Add an API for importing stack outputs (#2180)
These changes add a new resource to the Pulumi SDK,
`pulumi.StackReference`, that represents a reference to another stack.
This resource has an output property, `outputs`, that contains the
complete set of outputs for the referenced stack. The Pulumi account
performing the deployment that creates a `StackReference`  must have
access to the referenced stack or the call will fail.

This resource is implemented by a builtin provider managed by the engine.
This provider will be used for any custom resources and invokes inside
the `pulumi:pulumi` module. Currently this provider supports only the
`pulumi:pulumi:StackReference` resource.

Fixes #109.
2018-11-14 13:33:35 -08:00
CyrusNajmabadi cea165615e
Reenable tests. (#2200) 2018-11-13 17:13:27 -08:00
Matt Ellis aa7f26a3b5 Have README.md point at CONTRIBUTING.md
Instead of duplicating information about how to build Pulumi from
source in both `README.md` and `CONTRIBUTING.md`, just have the
`README.md` point at `CONTRIBUTING.md`.

Fixes #2197
2018-11-13 11:50:12 -08:00
Matt Ellis 2f1d548470
Merge pull request #2196 from pulumi/ellismg/remove-yarn-lock-files
Stop checking in yarn.lock files
2018-11-13 11:49:56 -08:00
Matt Ellis d000896a49 Bump @types/node dependency 2018-11-13 11:20:21 -08:00
Matt Ellis 5afac2c1a9 Merge remote-tracking branch 'origin/master' into release/0.16 2018-11-13 10:48:57 -08:00
Matt Ellis eca0ec4036 Add CHANGELOG.md 2018-11-13 09:43:20 -08:00
Matt Ellis 0ec93f0386 Add yarn.lock to gitignore 2018-11-12 15:34:11 -08:00
Matt Ellis 22fef07fcf Remove existing lock files 2018-11-12 15:33:58 -08:00
Matt Ellis b5a0e039fb Download plugins to temp folder before installing
Fixes #1861
2018-11-12 14:09:26 -08:00
Matt Ellis bbd2172541
Merge pull request #2191 from pulumi/chrsmith/fix-minor-issues
Fix issue with converting keys
2018-11-12 10:33:17 -08:00
Sean Gillespie c1582264e1
Fix, formalize and add tests for property rewrites (#2187)
* Fix, formalize and add tests for property rewrites

The Python SDK provides two hooks for resources to override how their
properties are communicated to and from the engine. The code that
performs this transformation is subtle and, before this commit, subtly
incorrect.

This commit adds a test that verifies that the SDK correctly transforms
properties recursively according to the two transformation hooks, while
also fixing a smattering of test issues encountered when adding the new
test.

* CR feedback
2018-11-12 09:26:31 -08:00
Joe Duffy 1e9f5b96f2
Merge pull request #2164 from pulumi/ellismg/update-tools
Update to Go 1.11 and golangci-lint
2018-11-10 17:32:14 -08:00
Matt Ellis 8a21844ed8 Correctly handle in progress updates in pulumi stack ls
When an update is in progress, `pulumi stack ls` was showing the LAST
UPDATE time as "a long while ago" because the service API returns 0 as
the last update time.

Handle this case correctly, displaying "in progress" for the update
time. When using JSON output, we don't include the update time (just
like a stack that has never been updated) but we do set the
`updateInProgress` property of the returned object

Fixes #2042
2018-11-09 14:34:16 -08:00
Matt Ellis 4442f22377 Add --preserve-config to pulumi stack rm
This allows you to keep the configuration file for a stack on disk,
even if you are removing the stack from the backend.

Fixes #2152
2018-11-09 14:33:18 -08:00
Sean Gillespie 828d59665e
Implement Invoke for Python 3 (#2175)
* Implement Invoke for Python 3

* CR feedback
2018-11-09 14:27:10 -08:00
Chris Smith 6b862e8afe Fix issue with converting keys 2018-11-09 14:01:15 -08:00
Sean Gillespie f625376915
Fix presentation of RunErrors (#2188)
The correct way to retrieve an exception's message in Python is to
stringify it with str.
2018-11-09 12:55:10 -08:00
Chris Smith c63c43b3a9 Add missing annotation 2018-11-09 11:11:05 -08:00
Chris Smith 8b76fd53d1
Record engine events (#2168)
* apitypes for surfacing engine events

* Add more comments to runEngineAction

* Persist engine events in the service

* Use cmdutil.IsTruthy
2018-11-09 10:01:29 -08:00
Pat Gavlin b753341686
Exclude the unscriptable-object rule (#2184)
Python 3.7 gets this rule wrong for `Generic[]`.

https://github.com/PyCQA/pylint/issues/2416 tracks this issue in pylint.
2018-11-08 18:26:13 -08:00
Pat Gavlin 170541546e
Disable the config capture tests (#2183)
These tests fail non-deterministically.
2018-11-08 17:45:51 -08:00
Matt Ellis b5450d41af Use Infof instead of Infoln when we have format strings 2018-11-08 14:11:52 -08:00
Matt Ellis 6c7092ff65 Pass -count=1 to disable result caching on go 1.10 and above 2018-11-08 14:11:52 -08:00
Matt Ellis 33ec9103c7 Use go 1.11 in CI 2018-11-08 14:11:52 -08:00
Matt Ellis 992b048dbf Adopt golangci-lint and address issues
We run the same suite of changes that we did on gometalinter. This
ended up catching a few new issues, some of which were addressed and
some of which were baselined.
2018-11-08 14:11:47 -08:00
Matt Ellis adb0d9aee6 Use pipenv from the toolset
- Remove the forked copy of the toolset
- Stop installing `pipenv` in sdk/python/Makefile

After this, we'll require that you already have `pipenv` present
before building.
2018-11-08 12:09:21 -08:00
Matt Ellis c398e8ba80 Don't write a lock file when installing test packages
The lockfile is not super interesting when running the lifecycle
tests, since the test project is not a long lived artifact. There was
no real harm in writing it, exepct that in some cases `pipenv` gets
very confused when you have dependencies on pre-release
versions (which is the case right now as we are brining up Python 3).

The packages are still installed correctly, even when we don't write a
lock file.
2018-11-08 12:09:10 -08:00
Justin Van Patten 4defd64e0a
Support specifying template names to pulumi up (#2177)
`pulumi up <arg>` does not currently support template names like `pulumi
new`; `up` is hard-coded to only support URLs to templates. This
prevents us from displaying shorter `$ pulumi up ...` commands in the
Pulumi Console when the URL is to one of our standard Pulumi templates.
In such cases, we'd like to be able to show the command with just the
template name instead of a full URL to the template in the
pulumi/templates repo.

This changes `up` to support the standard Pulumi template names
just like `new`.

Also, while making changes here, if a URL specified to `up` contains
multiple templates in subdirectories, allow the user to choose the
template, just like with `new`.
2018-11-08 10:43:10 -08:00
Justin Van Patten d3ec63cd1d
Use proj description when there's no template desc (#2179)
Whenever we need to display a template description, if the Pulumi.yaml
doesn't have it, but has a project description, just use the project
description. This will allow us to avoid having the same description for
both the project and template in our examples.
2018-11-08 10:42:26 -08:00
Justin Van Patten e1d1366f3b
Don't show new prelude when -g is specified (#2178)
The new command shouldn't show you the "this command will walk you
through" prelude when using the `-g` command -- it's not helpful and
generally looks confusing.
2018-11-08 10:42:00 -08:00
Sean Gillespie 9c82082a57
Implement RegisterResourceOutputs for Python 3 (#2173)
* Implement RegisterResourceOutputs for Python 3

RegisterResourceOutputs allows Python 3 programs to export stack outputs
and export outputs off of component resources (which, under the hood,
are the same thing).

Adds a new integration test for stack outputs for Python programs, as
well as add a langhost test for register resource outputs.

Fixes pulumi/pulumi#2163

* CR: Rename stack_output -> export

Fix integration tests that hardcoded paths to stack_outputs

* Fix one more reference to stack_outputs
2018-11-08 09:44:34 -08:00
CyrusNajmabadi 08fc305b7f
Prevent resource registration from overwriting unknown properties at random points in the future. (#2176) 2018-11-07 20:24:16 -08:00
Sean Gillespie 4ae39b8bec
Ask for the newest Python 3 instead of 3.6 specifically (#2165)
* Ask for the newest Python 3 instead of 3.6 specifically

* Remove PythonVersion from test opts
2018-11-06 10:38:46 -08:00
Matt Ellis 30b26a5203 Require Node 11 run to pass
It was alowed to fail when we were bringing up Node 11 support, but
now that we do support it, we should lock in the win.

(cherry picked from commit aa018081b2)
2018-11-05 18:06:10 -08:00
CyrusNajmabadi bfd22b6cf3 Get closure serialiation working in Node11 (#2101)
* Make v8 primitives async as there is no way to avoid async in node11.

* Simplify API.

* Move processing of well-known globals into the v8 layer.
We'll need this so that we can map from RemoteObjectIds back to these well known values.

* Remove unnecesssary check.

* Cleanup comments and extract helper.

* Introduce helper bridge method for the simple case of making an entry for a string.

* Make functions async.  They'll need to be async once we move to the Inspector api.

* Make functions async.  They'll need to be async once we move to the Inspector api.

* Make functions async.  They'll need to be async once we move to the Inspector api.

* Move property access behind helpers so they can move to the Inspector API in the future.

* Only call function when we know we have a Function.  Remove redundant null check.

* Properly serialize certain special JavaScript number values that JSON serialization cannot handle.

* Only marshall across the 'source' and 'flags' for a RegExp when serializing.

* Add a simple test to validate a regex without flags.

* Extract functionality into helper method.

* Add test with complex output scenarios.

* Output serialization needs to avoid recursively trying to serialize a serialized value.

* Introduce indirection for introspecting properties of an object.

* Use our own introspection API for examining an Array.

* Hide direct property access through API indirection.

* Produce values like the v8 Inspector does.

* Compute the module map asynchronously.  Will need that when mapping mirrors instead.

* Cleanup a little code in closure creation.

* Get serialization working on Node11 (except function locations).

* Run tests in the same order on <v11 and >=v11

* Make tests run on multiple versions of node.

* Rename file to make PR simpler to review.

* Cleanup.

* Be more careful with global state.

* Remove commented line.

* Only allow getting a session when on Node11 or above.

* Promisify methods.

(cherry picked from commit 901a238fd5)
2018-11-05 18:05:51 -08:00
CyrusNajmabadi 4c5e4c776d Ensure method always returns a boolean. (#2120)
(cherry picked from commit c7a46848b9)
2018-11-05 18:05:29 -08:00
CyrusNajmabadi b6ebb55fe9 Add test with complex output scenarios. (#2118)
(cherry picked from commit 3e25bc80c8)
2018-11-05 18:05:21 -08:00
CyrusNajmabadi 3f701e6c80 Cleanup a little code in closure creation. (#2122)
(cherry picked from commit 7efd3ddf05)
2018-11-05 18:05:12 -08:00
CyrusNajmabadi 4a056c05d5 Produce values like the v8 Inspector does. (#2119)
(cherry picked from commit 13d9043771)
2018-11-05 18:05:00 -08:00
CyrusNajmabadi 41f4bfa31c Add a simple test to validate a regex without flags. (#2117)
(cherry picked from commit c83eaf428b)
2018-11-05 18:04:38 -08:00
CyrusNajmabadi 200b032333 Properly serialize certain special JavaScript number values that JSON serialization cannot handle. (#2116)
(cherry picked from commit 1d7f35352d)
2018-11-05 18:04:28 -08:00
Matt Ellis 851a34dc7c Add Node 11 scouting build
(cherry picked from commit e84eab0d9f)
2018-11-05 18:04:01 -08:00