Commit graph

4299 commits

Author SHA1 Message Date
stack72 4c8997bf63 Template tests will be part of the templates repo
Fixes: #3744
2020-01-30 13:33:02 +00:00
Mikhail Shilkov d46a1d1abb
Output watcher (#3836) 2020-01-30 08:05:47 +01:00
Jamie Kinkead 9c0e9021d1
Return current operation info (#3822) 2020-01-29 16:04:09 -08:00
Jamie Kinkead 1f1bb7598c
Fix for windows policy-pack install (#3837)
* Fix for windows policy-pack install

* Add test for npm install
2020-01-29 16:02:44 -08:00
CyrusNajmabadi 2d117e6acf
Fix integration test harness. (#3831) 2020-01-29 11:57:45 -08:00
Anastasia Halim 4c8237aa77
Validate stack tag names (#3804)
* added regex to validate stack tag names

* added tests
2020-01-29 10:53:33 -08:00
Paul Stack b6b313821c
Skip dynamic provider TestStackBadParenting test on Windows (#3835)
Skip dynamic provider TestStackBadParenting test on Windows
2020-01-29 13:32:42 +00:00
stack72 15193c3674 Skip dynamic provider TestStackBadParenting test on Windows 2020-01-29 12:26:56 +00:00
Paul Stack eddbbaf5cd
Running our pulumi/pulumi examples on Windows (#3656)
Running our pulumi/pulumi examples on Windows
2020-01-27 22:54:24 +03:00
Pat Gavlin d6bafd5b4b Update the CHANGELOG for 1.9.1. 2020-01-27 11:47:51 -08:00
Jamie Kinkead eee80decc9
Merge pull request #3805 from pulumi/jkinkead/updatekind-rename
Add rename to apitype.UpdateKind.
2020-01-27 11:46:27 -08:00
Jamie Kinkead 9b8cab751e Add rename to apitype.UpdateKind. 2020-01-27 11:45:05 -08:00
stack72 81d271d9ed Changing build.proj to run all languages and tests on windows 2020-01-27 21:16:37 +02:00
Erin Krengel 232d798189
Add remove all to policy (#3792) 2020-01-27 10:35:34 -08:00
Justin Van Patten a5fea292a3
Fix doc comment to filter internal API (#3814)
I noticed `_setQueryMode` wasn't being filtered out of API docs, and it was due to the comment not being a _doc_ comment.
2020-01-27 10:22:32 -08:00
Pat Gavlin a64616a0f9 Fix three bugs in the Go SDK
- Do not set top-level properties that were not provided
- Check for nil after awaiting inputs
- Check for interface-typed values, which can be produced by `Any`
- Pass a settable value to `awaitInputs` in `Any`
2020-01-27 09:14:23 -08:00
Pat Gavlin c4cbff072b
Handle failures from plugins' CheckConfig. (#3813) 2020-01-26 13:19:13 -08:00
Justin Van Patten 9abcca345a
Mark internal APIs @internal to filter from API docs (#3809)
Also:

 - Cleaned up existing tags so they're consistently at the bottom of doc comments where they should be
 - Cleaned up some unused imports while I was taking a pass over the files
 - Marked one function `@deprecated` that should be deprecated
2020-01-26 09:06:35 -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
CyrusNajmabadi bf3dc1cd0c
Ensure that resources not specified by --target do not get added to checkpoint file. (#3797) 2020-01-24 12:37:13 -08:00
Pat Gavlin 77c0f5dad1 Fix a bug in the Go code generator.
Resource input properties must also be scanned for optionality.
2020-01-24 10:18:34 -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
Pat Gavlin 4d8027f057 Fix another typo. 2020-01-23 10:42:38 -08:00
Pat Gavlin 60a5d06d37 Fix a typo. 2020-01-23 10:00:38 -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 d400f26832
Add a schema package and code generators. (#3749)
The schema format is described in pkg/codegen/schema/schema.go. The code
generators are derived from the code generators contained in
https://github.com/pulumi/pulumi-terraform-bridge/pkg/tfgen, with the
exception of the Go code generator, which is net new.
2020-01-21 14:45:48 -08:00
Pat Gavlin f9548b3095
Add coverage for pulumi.Fprintf. (#3782)
Just what it says on the tin.
2020-01-21 13:27:46 -08:00
Pat Gavlin 4611cbe645
Add more test coverage for builtins. (#3775)
- Test builtin Apply methods
- Test type-specific ToOutput methods
- Test pointer, array, and map indexers
2020-01-21 09:52:57 -08:00
Mikhail Shilkov c9d3a504b1
Remove .ionide (#3778) 2020-01-21 09:27:44 +01: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
James Forcier bf84a3482b Add py.typed to Python package for PEP 561 compliance (#3704)
PEP 561 specifies that packages which contain either inline type hints
or type stubs should indicate their support for type hints via
including a file named `py.typed` in the root of the package. Since
Pulumi already includes inline type hints, adding `py.typed` to the
Python SDK simply allows these hints to be used by mypy.
2020-01-17 15:01:36 -08:00
Evan Boyle 972fc44dd7
Enable mypy (#3758) 2020-01-17 14:45:08 -08:00
Jamie Kinkead 88cdaef8b3
Merge pull request #3768 from pulumi/jkinkead/current-operation
Add Current Operation info to stack command.
2020-01-17 13:00:04 -08:00
Jamie Kinkead 56a3cc7e8f Adjust commenting. 2020-01-17 12:57:08 -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
Jamie Kinkead 5a02a61765 Add Current Operation info. 2020-01-17 07:44:23 -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
Cameron Stokes ae13d6672c
Merge pull request #3741 from pulumi/clstokes/fix-misspelling
Fixed 'transacational' misspelling.
2020-01-13 13:02:16 -08:00
clstokes 0a3191905c Fixed 'transacational' misspelling. 2020-01-13 10:45:07 -08:00
Mike Metral 1f192d024e Lock dep ts-node to v8.5.4 2020-01-10 12:18:46 -05:00
jkisk 661215b489 update ulimit (#3726) 2020-01-08 10:59:20 -08:00
Praneet Loke 19d2e504db
Trim tailing slash from the base URL for Azure Pipelines build URL. (#3721) 2020-01-07 10:30:22 -08:00
Chris Smith 25cf245622
Write .npmrc if NPM_AUTH_TOKEN is set (#3716) 2020-01-06 08:23:15 -08:00
Erin Krengel 0ba101fdba
Improvements to pulumi policy (#3688) 2020-01-03 14:16:39 -08:00