Commit graph

346 commits

Author SHA1 Message Date
Pat Gavlin 259b2d314a Update the CHANGELOG for 1.11.0 2020-02-20 10:11:12 -08:00
Luke Hoban 4eb2b555fe
Disable interactive progress display when no terminal size is available (#3936)
It appears there are cases where our IsInteractive heuristics return true, but terminal.GetSize returns an error. In these cases, we should assume we do not have an interactive terminal and avoid trying to render interactive progress by default.

Fixes #3935.
2020-02-19 09:21:03 -08:00
Chris Smith ba046b063b
Add --version flag to 'pulumi stack export' (#3906)
* Add --version flag to 'pulumi stack export'

* Update CHANGELOG

* Update/rebase with latest

* Fix lint warning
2020-02-13 12:25:57 -08:00
Mikhail Shilkov f1cdce9488
Move .NET serialization attributes to Pulumi namespace (#3902)
Move .NET serialization attributes to Pulumi namespace, deprecate the ones in Pulumi.Serialization
2020-02-11 11:40:14 +01:00
Levi Blackstone 7efb88de3e
Allow oversize protocol buffers (#3895)
Set an option to increase the memory limit on protobuf
parsing so that we can handle larger gRPC payloads.

Co-authored-by: Evan Boyle <EvanBoyle@users.noreply.github.com>
2020-02-10 15:30:42 -07:00
Justin Van Patten 3bf9067bac
Expose options, parent, deps, and provider config to policies (#3862) 2020-02-07 16:11:34 -08:00
Luke Hoban f6e37c25ad
Don't print prelude in terminal mode (#3890)
We can't correctly print simple messages for prelude events when doing progress based display in a terminal, as it would lead to resetting the display of the table rendering.

This does mean that `--show-config` no longer works in the default terminal display mode - but it's not clear it *can* work correctly (at least as currently implemented) since it doesn't cleanly participate in the table rendering.

For cases where `--show-config` is not set (the norm) -nothing would have been printed anyway, so the changes here just avoid resetting the table rendering unnecessarily.

Fixes #3469.
2020-02-07 12:44:22 -08:00
Pat Gavlin 4a201a7dfd
Do not busy wait in Python. (#3892)
Instead, keep a stack of outstanding RPCs and await each in turn. This
allows the main loop to block instead of spin.

Fixes #3759.
2020-02-07 12:10:59 -08:00
Evan Boyle cea807a244
Go aliases (#3853) 2020-02-06 12:02:13 -08:00
Luke Hoban 5bf490228a
Use \n for provider protocol even on Windows (#3855)
The provider plugin protocol is to write a port number followed by `\n`.  We must guarantee we do that even on Windows, so must avoid Python `print` statements which implicitly rewrite newlines to platform specific character sequences.

Fixes #3807.
2020-02-06 11:34:05 -08:00
Pat Gavlin 3b445f10b4 Update the CHANGELOG for v1.10.1 2020-02-06 10:05:45 -08:00
Evan Boyle 411f1a179a
Support stack references in Go SDK (#3829) 2020-02-06 10:00:46 -08:00
Pat Gavlin 5df00f8303 Update the CHANGELOG for 1.10.0 2020-02-05 12:56:10 -08:00
Luke Hoban 615ab3a4bf
Fix bug in computing whether checkpoint write is necessary (#3860)
We were seeing that ~all same steps were requiring checkpoint writes due to percieving a difference between `Dependencies` being `nil` and `[]URN{}` - which should be considered the same for this purpose.
2020-02-04 18:56:24 -08:00
Erin Krengel 89f84dc4d9
Improve PP naming for local PPs (#3839) 2020-01-30 13:31:41 -08:00
Jamie Kinkead 9c0e9021d1
Return current operation info (#3822) 2020-01-29 16:04:09 -08:00
CyrusNajmabadi 2d117e6acf
Fix integration test harness. (#3831) 2020-01-29 11:57:45 -08:00
Pat Gavlin d6bafd5b4b Update the CHANGELOG for 1.9.1. 2020-01-27 11:47:51 -08:00
Erin Krengel 232d798189
Add remove all to policy (#3792) 2020-01-27 10:35:34 -08:00
Pat Gavlin 47b7eaf484
Make primitive input types implement pointer types (#3806)
For example, pulumi.String also implements pulumi.StringPtr. This is
consistent with the output of the code generator, and makes optional
inputs much more ergonomic.
2020-01-25 12:19:00 -08:00
Erin Krengel f0172990b8
Always render PPs even if there are diagnostic events (#3796) 2020-01-24 14:33:31 -08:00
Evan Boyle 106154f1fc
fix python sdk stack ref regression (#3798) 2020-01-24 09:36:47 -08:00
Pat Gavlin 2f554d5cdc
Fix an assert in the Go SDK. (#3794)
This assert is not correct in the case of pointer input types, in
particular `pulumi.stringPtr`. Though these types are not assignable,
they are convertible.
2020-01-23 13:07:47 -08:00
Erin Krengel 0d0641278c
Remove version req for disable; Add --latest to enable (#3784) 2020-01-22 15:17:00 -08:00
Pat Gavlin 567a515296 Update the CHANGELOG for 1.9.0 2020-01-22 11:56:40 -08:00
Pat Gavlin f168bdc1c2
Redesign the Go SDK resource/input/output system. (#3506)
The redesign is focused around providing better static typings and
improved ease-of-use for the Go SDK. Most of the redesign revolves
around three pivots:
- Strongly-typed inputs, especially for nested types
- Struct-based resource and invoke APIs
- Ease-of-use of Apply

1. Strongly-typed inputs

Input is the type of a generic input value for a Pulumi resource.
This type is used in conjunction with Output to provide polymorphism
over strongly-typed input values.

The intended pattern for nested Pulumi value types is to define an
input interface and a plain, input, and output variant of the value
type that implement the input interface.

For example, given a nested Pulumi value type with the following shape:

```
type Nested struct {
    Foo int
    Bar string
}
```

We would define the following:

```
var nestedType = reflect.TypeOf((*Nested)(nil)).Elem()

type NestedInput interface {
    pulumi.Input

    ToNestedOutput() NestedOutput
    ToNestedOutputWithContext(context.Context) NestedOutput
}

type Nested struct {
    Foo int `pulumi:"foo"`
    Bar string `pulumi:"bar"`
}

type NestedInputValue struct {
    Foo pulumi.IntInput `pulumi:"foo"`
    Bar pulumi.StringInput `pulumi:"bar"`
}

func (NestedInputValue) ElementType() reflect.Type {
    return nestedType
}

func (v NestedInputValue) ToNestedOutput() NestedOutput {
    return pulumi.ToOutput(v).(NestedOutput)
}

func (v NestedInputValue) ToNestedOutputWithContext(ctx context.Context) NestedOutput {
    return pulumi.ToOutputWithContext(ctx, v).(NestedOutput)
}

type NestedOutput struct { *pulumi.OutputState }

func (NestedOutput) ElementType() reflect.Type {
    return nestedType
}

func (o NestedOutput) ToNestedOutput() NestedOutput {
    return o
}

func (o NestedOutput) ToNestedOutputWithContext(ctx context.Context) NestedOutput {
    return o
}

func (o NestedOutput) Foo() pulumi.IntOutput {
    return o.Apply(func (v Nested) int {
        return v.Foo
    }).(pulumi.IntOutput)
}

func (o NestedOutput) Bar() pulumi.StringOutput {
    return o.Apply(func (v Nested) string {
        return v.Bar
    }).(pulumi.StringOutput)
}
```

The SDK provides input and output types for primitives, arrays, and
maps.

2. Struct-based APIs

Instead of providing expected output properties in the input map passed
to {Read,Register}Resource and returning the outputs as a map, the user
now passes a pointer to a struct that implements one of the Resource
interfaces and has appropriately typed and tagged fields that represent
its output properties.

For example, given a custom resource with an int-typed output "foo" and
a string-typed output "bar", we would define the following
CustomResource type:

```
type MyResource struct {
    pulumi.CustomResourceState

    Foo pulumi.IntOutput    `pulumi:"foo"`
    Bar pulumi.StringOutput `pulumi:"bar"`
}
```

And invoke RegisterResource like so:

```
var resource MyResource
err := ctx.RegisterResource(tok, name, props, &resource, opts...)
```

Invoke arguments and results are also provided via structs, but use
plain-old Go types for their fields:

```
type MyInvokeArgs struct {
    Foo int `pulumi:"foo"`
}

type MyInvokeResult struct {
    Bar string `pulumi:"bar"`
}

var result MyInvokeResult
err := ctx.Invoke(tok, MyInvokeArgs{Foo: 42}, &result, opts...)
```

3. Ease-of-use of Apply

All `Apply` methods now accept an interface{} as the callback type.
The provided callback value must have one of the following signatures:

	func (v T) U
	func (v T) (U, error)
	func (ctx context.Context, v T) U
	func (ctx context.Context, v T) (U, error)

T must be assignable from the ElementType of the Output. If U is a type
that has a registered Output type, the result of the Apply will be the
corresponding Output type. Otherwise, the result of the Apply will be
AnyOutput.

Fixes https://github.com/pulumi/pulumi/issues/2149.
Fixes https://github.com/pulumi/pulumi/issues/3488.
Fixes https://github.com/pulumi/pulumi/issues/3487.
Fixes https://github.com/pulumi/pulumi-aws/issues/248.
Fixes https://github.com/pulumi/pulumi/issues/3492.
Fixes https://github.com/pulumi/pulumi/issues/3491.
Fixes https://github.com/pulumi/pulumi/issues/3562.
2020-01-18 10:08:37 -05:00
Evan Boyle faa6d95178
update changelog for #3704 (#3770) 2020-01-17 15:26:41 -08:00
Praneet Loke 0fd131fb9e
Add a new BuildNumber property to the backend metadata bag and CI vars (#3766)
* Add a new metadata property for BuildNumber. Update Travis and GitLab to set both Build ID and Build Number. Add link to env vars doc for Codefresh.

* Update changelog

* Update CI vars detection test.

* Add PR number to changelog.
2020-01-17 10:47:49 -08:00
Praneet Loke 39a4abe32d
Fix the pipeline ID and PR URL for GitLab CI (#3763)
* Use Merge Request Instance ID instead of the Merge Request ID for GitLab CI.

* Use GitLab Pipeline Instance ID as the BuildID for GitLab CI.

* Update the changelog.

* Update the test for GitLab CI detection.
2020-01-16 14:59:12 -08:00
Erin Krengel 223e0c5e83
Add policy ls (#3753) 2020-01-16 12:04:51 -08:00
Erin Krengel 77bcba412e
Add permalink to policy publish (#3757) 2020-01-15 17:08:14 -08:00
Mike Metral 1f192d024e Lock dep ts-node to v8.5.4 2020-01-10 12:18:46 -05:00
Erin Krengel 0ba101fdba
Improvements to pulumi policy (#3688) 2020-01-03 14:16:39 -08:00
Mikhail Shilkov 66de4a48b7
First-class Stack component for .NET (#3618)
First-class Stack component for .NET
2019-12-23 08:31:12 +01:00
Luke Hoban 6525d17b7b
Update CHANGELOG.md 2019-12-22 11:49:49 -08:00
Luke Hoban a2ed4c56ad
Update CHANGELOG.md 2019-12-20 14:17:58 -08:00
Pat Gavlin 7b9e05eb6a Update the CHANGELOG for 1.8.1 2019-12-20 14:05:00 -08:00
Pat Gavlin bf9424d7e4 Update the CHANGELOG for 1.8.0 2019-12-19 18:43:06 -08:00
Praneet Loke c87f161cf0
Fix logic to determine PRNumber and BuildURL for Az Pipelines. (#3677)
* Fix logic to determine PRNumber and BuildURL for Az Pipelines.

* Update changelog

* Set the BranchName to the PR source branch if PRNumber is not empty.
2019-12-19 17:17:54 -05:00
CyrusNajmabadi 342b80b768
Add a supported api for components to indicate that they are asynchronously constructed. (#3676) 2019-12-17 15:34:30 -08:00
CyrusNajmabadi f4fc00ad0e
Output.apply should lift resources from inner Outputs to the top level output. (#3663) 2019-12-17 14:11:45 -08:00
Luke Hoban 0ae81f6654
Bring pulumi preview in-line with pulumi up (#3675)
Adds support to `pulumi preview` to match `pulumi up` for:
* `refresh`
* `target`
* `replace`
* `target-replace`
* `target-dependents`

Fixes #3674.
2019-12-17 13:31:12 -08:00
Chris Smith 7818c219e8
Add .NET Core SDK to pulumi/pulumi container (#3616)
* Add tests for the pulumi/actions container

* Add .NET Core SDK to pulumi/pulumi container

* Address PR feedback

* Update CHANGELOG.md
2019-12-17 11:05:19 -08:00
CyrusNajmabadi 7cbdf58105
Update to TypeScript 3.7 (#3627) 2019-12-17 11:00:45 -08:00
Justin Van Patten 10a960ea4b
PaC: Support Config/getProject/getStack/isDryRun (#3612)
Add support for using `Config`, `getProject()`, `getStack()`, and
`isDryRun()` from Policy Packs.
2019-12-16 22:51:02 +00:00
Luke Hoban 35f16f3e42
Update CHANGELOG.md 2019-12-16 11:23:27 -08:00
PLACE c01ba59684 added support for using GOOGLE_CREDENTIALS for gs:// filestate authentication (#2906)
* added support for using GOOGLE_CREDENTIALS environment variable for authenticating with gs:// file state

* modified the change to fix #2791 as well

* fixed a small bug

* fixed linter error

* added code comments

* Update pkg/backend/filestate/gcpauth.go

Co-Authored-By: CyrusNajmabadi <cyrus.najmabadi@gmail.com>

* Parse provided backend url to check if scheme is gs://

* Update changelog
2019-12-16 17:47:31 +00:00
Pat Gavlin 03e0005fe0 Update the CHANGELOG for v1.7.1 2019-12-13 15:37:16 -08:00
CyrusNajmabadi 9151d48ee3
Fix typing for 'Lifted<T>' to work better across versions of TS (#3658) 2019-12-13 11:18:19 -08:00
Luke Hoban 57b19ce403
Improve CHANGELOG formatting 2019-12-11 10:22:29 -08:00