Commit graph

3166 commits

Author SHA1 Message Date
Sean Gillespie 6fa67329de
Several gardening tasks for Python (#2145)
* Several gardening tasks for Python

1. Update pipenv to 2018.7.1, which is the most recent release that
isn't broken on Python 2
2. Update our pylint dependency to 1.9, the most recently released
version
3. Re-enable pylint for the Pulumi package

* Back out of pipenv upgrade

It's apparently broken in our CI. Also upgrade pylint to 2.1, which is
apparently the "actual" most recently release according to PyPI.

* Fix a bad merge
2018-11-01 12:58:45 -07:00
Chris Smith 0a76923c64
Add CircleCI support (#2143) 2018-11-01 11:20:31 -07:00
Sean Gillespie 946ca655d3
Provide a Py hook for providers to rename props (#2140)
* Provide a Py hook for providers to rename props

This commit adds input and output hooks that can be overridden by
providers if they would like to change the names of dictionary fields
when projecting resources into Python.

* Add syntax sugar for dict outputs

Properly recurse when rewriting input dictionaries
2018-11-01 10:25:47 -07:00
Joe Duffy 9aedb234af
Tidy up some data structures (#2135)
In preparation for some workspace restructuring, I decided to scratch a
few itches of my own in the code:

* Change project's RuntimeInfo field to just Runtime, to match the
  serialized name in JSON/YAML.

* Eliminate the no-longer-used Context and NoDefaultIgnores fields on
  project, and all of the associated legacy PPC-related code.

* Eliminate the no-longer-used IgnoreFile constant.

* Remove a bunch of "// nolint: lll" annotations, and simply format
  the structures with comments on dedicated lines, to avoid overly
  lengthy lines and lint suppressions.

* Mark Dependencies and InitErrors as `omitempty` in the JSON
  serialization directives for CheckpointV2 files. This was done for
  the YAML directives, but (presumably accidentally) omitted for JSON.
2018-11-01 08:28:11 -07:00
Sean Gillespie 56be1a6677
Implement RPC for Python 3 (#2111)
* Implement RPC for Python 3

* Try not setting PYTHONPATH

* Remove PYTHONPATH line

* Implement Invoke for Python 3

* Implement register resource

* progress

* Rewrite the whole thing

* Fix a few bugs

* All tests pass

* Fix an abnormal shutdown bug

* CR feedback

* Provide a hook for resources to rename properties

As dictionaries and other classes come from the engine, the
translate_property hook can be used to intercept them and rename
properties if desired.

* Fix variable names and comments

* Disable Python integration tests for now
2018-10-31 13:35:31 -07:00
Pat Gavlin b748935753
Do not assert on duplicate resources. (#2127)
Just what it says on the tin.
2018-10-31 10:33:00 -07:00
CyrusNajmabadi 76d08f8590
Simplify summary text. (#2136) 2018-10-30 21:57:38 -07:00
James Nugent 95a5ad4a21
Merge pull request #2137 from pulumi/go-1.11-archive-hashes
Add Go 1.10+ versions of archive hashes in tests
2018-10-30 22:47:10 -05:00
James Nugent 59a8a7fbfe Add Go 1.10+ versions of archive hashes in tests
Go 1.10 made some breaking changes to the headers in archive/tar [1] and
archive/zip [2], breaking the expected values in tests. In order to keep
tests passing with both, wherever a hardcoded hash is expect we switch
on `runtime.Version()` to select whether we want the Go 1.9 (currently
supported Go version) or later version of the hash.

Eventually these switches should be removed in favour of using the later
version only, so they are liberally commented to explain the reasoning.

[1]: https://golang.org/doc/go1.10#archive/tar
[2]: https://golang.org/doc/go1.10#archive/zip
2018-10-30 21:59:36 -05:00
CyrusNajmabadi ba6b36a97b
Explicit disable interactive mode if the TERM variable is set to 'dumb' (#2131) 2018-10-30 17:48:55 -07:00
CyrusNajmabadi 73b42d753b
Include diagnostic prefix in the output for the diff display. (#2132) 2018-10-30 17:46:22 -07:00
CyrusNajmabadi 9b1c2ff54d
Round time to the nearest second to clean up our display (#2133) 2018-10-30 17:42:03 -07:00
CyrusNajmabadi 8eff0e3142
Remove need to dynamically determine if we're in preview or not. (#2129) 2018-10-30 15:42:33 -07:00
Pat Gavlin a93bb948c8
Restore the CloudName field of apitype.Stack. (#2128)
This field is necessary in order to support downlevel CLIs.
2018-10-30 13:49:51 -07:00
James Nugent 0ac0cae722
Merge pull request #2126 from pulumi/go-1.11-fixes
Fix some linter errors. which appear with Go 1.11
2018-10-30 09:13:16 -05:00
James Nugent 39742b3239 Spread array argument to variadic function 2018-10-29 18:09:00 -05:00
James Nugent 84d52b1b3e Use formatting directives when using Assertf 2018-10-29 18:08:08 -05:00
James Nugent 5c76b20f70 Use Infof instead of Info when formatting 2018-10-29 18:06:04 -05:00
Matt Ellis 4ba5901aaf Add --json to pulumi logs
When outputing JSON, if we have a fixed number of log entries (i.e. we
are not `--follow`'ing, we wrap each entry in array. Otherwise, we
just emit each log entry as an object at top level.

As part of this change, I've adopted a slightly more precise time
output format in `pulumi stack ls` when using JSON output. These times
now match the default output from `console.log(new Date())`
2018-10-29 12:43:52 -07:00
Sean Gillespie ca540cc736 Use math.MaxInt32 to signal unbounded parallelism
Downlevel versions of the Pulumi Node SDK assumed that a parallelism
level of zero implied serial execution, which current CLIs use to signal
unbounded parallelism. This commit works around the downlevel issue by
using math.MaxInt32 to signal unbounded parallelism.
2018-10-29 12:27:03 -07:00
CyrusNajmabadi c7a46848b9
Ensure method always returns a boolean. (#2120) 2018-10-28 13:02:37 -07:00
CyrusNajmabadi 3e25bc80c8
Add test with complex output scenarios. (#2118) 2018-10-28 13:02:25 -07:00
CyrusNajmabadi 7efd3ddf05
Cleanup a little code in closure creation. (#2122) 2018-10-28 13:02:04 -07:00
CyrusNajmabadi 13d9043771
Produce values like the v8 Inspector does. (#2119) 2018-10-28 01:01:48 -07:00
Joe Duffy 4647aa6cdb
Merge pull request #2114 from pulumi/joeduffy/994_combinators
Add some helpful input/output combinators
2018-10-27 15:41:22 -07:00
joeduffy c5be233f57 Revert formatting changes for Output.all 2018-10-27 13:55:54 -07:00
joeduffy 972d678388 Add an extra layer of Input-ness
CR feedback.
2018-10-27 13:47:15 -07:00
joeduffy 930c86cb50 Fix some lint errors 2018-10-27 13:27:04 -07:00
joeduffy 1daad93ccd Add tests for the new combinators 2018-10-27 12:56:16 -07:00
joeduffy d6f58eb20e Ditch the Map-based combinators in favor of objects 2018-10-27 12:39:22 -07:00
joeduffy 724ae41e1b Add a toObject combinator
This function works like toMap does, except that it returns an
output object with keys and values derived from input values.
2018-10-27 12:31:31 -07:00
joeduffy b261908884 Move combinators to an iterable module
Rather than placing these combinators directly on the Output class,
which feels odd because they are special purpose to iterables, and deal
with not only Outputs but also Inputs, we will place them on a
separate and dedicated iterable module for these utility helpers.
2018-10-27 12:19:42 -07:00
CyrusNajmabadi c83eaf428b
Add a simple test to validate a regex without flags. (#2117) 2018-10-27 00:42:52 -07:00
CyrusNajmabadi 1d7f35352d
Properly serialize certain special JavaScript number values that JSON serialization cannot handle. (#2116) 2018-10-26 23:46:57 -07:00
joeduffy d1d2ceaedd Add create, createMap, and createGroupByMap combinators
This change adds some new constructors for output properties:

1) We alias `Output.create` to `output`, more like Promise's various
   construction methods. This reads better and is more discoverable.

2) A new `Output.createMap` function will accept an array of inputs,
   along with a selector function for key/value pairs, and produces
   an output map with said keys and values inside of it.

3) A new `Output.createGroupByMap` functon will similarly accept an
   array of inputs and a key/value selector, however it creates an
   output map with said keys, but where values are arrays of values,
   and all duplicate keys will lead to appending to said arrays.

Tests to come in a subsequent checkin.
2018-10-26 20:49:16 -07:00
Matt Ellis 74672857fd Remove pulumi archive and archive uploading code
In the past, we had a mode where the CLI would upload the Pulumi
program, as well as its contents and do the execution remotely.

We've since stopped supporting that, but all the supporting code has
been left in the CLI.

This change removes the code we had to support the above case,
including the `pulumi archive` command, which was a debugging tool to
generate the archive we would have uploaded (which was helpful in the
past to understand why behavior differed between local execution and
remote execution.)
2018-10-26 18:03:58 -07:00
Matt Ellis 5b97cf5cd1 Don't prompt if you want to continue when --skip-preview is passed
If you took the time to type out `--skip-preview`, we should have high
confidence that you don't want a preview and you're okay with the
operation just happening without a prompt.

Fixes #1448
2018-10-26 15:41:29 -07:00
Sean Gillespie 85623d6c4d
Implement Output for Python (#2107) 2018-10-26 14:52:30 -07:00
Matt Ellis 19cf3c08fa Add --json flag to pulumi stack ls
We've had multiple users ask for this, so let's do it proactively
instead of waiting for #496

Fixes #2018
2018-10-26 13:13:50 -07:00
Sean Gillespie 53aea7bc12
Begin Python 3 conversion (#2103)
This commit introduces a 'next' package which we can use as a staging
ground for incrementally adopting new Python 3 code. The next package is
initially populated with the non-runtime portions of the Python SDK,
which is enough to pass all tests when running on Python 3. Future
commits will reach further into the runtime.
2018-10-26 11:05:45 -07:00
Matt Ellis e84eab0d9f Add Node 11 scouting build 2018-10-25 19:07:04 -07:00
Matt Ellis db1c646c94 Don't error in pulumi stack output when there is no root resource
We used to issue an error when you ran `pulumi stack output` for a
stack with with no root resource (e.g. one that hadn't been stood up
yet or one that had been stood up but then destoryed).

Instead, just follow the normal case for a stack that has a root
resource, but has no outputs.

Fixes #2016
2018-10-25 15:00:38 -07:00
Sean Gillespie ae1a2e8b7e
Fail closure serialization in Node 11 (#2098)
* Fail closure serialization in Node 11

Node 11 changed many of the intrinsics that we depend upon for closure
serialization, so until we fix the underlying issues this commit lazily
fails if a closure is serialized when running on Node 11.

* CR feedback
2018-10-25 10:55:47 -07:00
CyrusNajmabadi 3ecd1ddeb0
Support colors in CI/CD environments (#2094) 2018-10-24 14:45:15 -07:00
Chris Smith f324a460e9
Remove references to Pulumi private clouds (#2095)
* Remove TODO for issue since fixed in PPCs.

* Update issue reference to source

* Update comment wording

* Remove --ppc arg of stack init

* Remove PPC references in int. testing fx

* Remove vestigial PPC API types
2018-10-24 13:50:35 -07:00
Pat Gavlin b14d259365
Split large events into multiple log entries. (#2092)
Just what it says on the tin. The splitting is implemented s.t.
colorization commands are never split across multiple log entries.
2018-10-23 14:59:30 -07:00
Praneet Loke 052bc69a52
Add gitlab metadata - Part 1 (#2090)
* Introduce new metadata keys `vcs.repo`, `vcs.kind` and `vcs.owner` to keep the keys generic for any vcs. Expanded the git SSH regex to account for bitbucket's .org domain.

* Introduce new stack tags keys with the same theme of detecting the vcs.
2018-10-23 14:53:52 -07:00
Sean Gillespie e70c5d385e
Enable gzip compression on the wire (#2074)
* Enable gzip compression on the wire

This change allows the Pulumi API client to gzip requests sent to the
Pulumi service if requested using the 'GzipCompress' http option.

This change also sets the Accept-Encoding: gzip header for all requests
originating from the CLI, indicating to the service that it is free to
gzip responses. The 'readBody' function is used in the API client to
read a response's body, regardless of how it is encoded.

Finally, this change sets GzipCompress: true on the
'PatchUpdateCheckpoint' API call, since JSON payloads in that call tend
to be large and it has become a performance bottleneck.

* spelling

* CR feedback:

1. Clarify and edit comments
2. Close the gzip.Reader when reading bodies
3. Log the payload size when logging compression ratios
2018-10-23 14:11:40 -07:00
Pat Gavlin 72a6ed320c
Do not propose replacement of providers in preview. (#2088)
Providers with unknown properties are currently considered to require
replacement. This was intended to indicate that we could not be sure
whether or not replacement was reqiuired. Unfortunately, this was not a
good user experience, as replacement would never be required at runtime.
This caused quite a bit of confusion--never proposing replacement seems
to be the better option.
2018-10-23 10:23:28 -07:00
Pat Gavlin f465fc0a48
Reorder an error check in the provider registry. (#2078)
The provider registry was checking for a `nil` provider instance before
checking for a non-nil error. This caused the CLI to fail to report
important errors during the plugin load process (e.g. invalid checkpoint
errors) and instead report a failure to find a matching plugin.
2018-10-19 17:22:50 -07:00