Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First implementation of module attribution. #22583

Merged
merged 37 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fe31946
First implementation of module attribution.
paddycarver Aug 23, 2019
98cdb7b
Support for validating provider_meta block.
paddycarver Aug 26, 2019
354f56f
Better apply-time errors.
paddycarver Aug 26, 2019
a26a57b
Various bug fixes.
paddycarver Sep 24, 2019
003c422
Make ProviderMeta available in the SDK.
paddycarver Sep 24, 2019
b81eb89
Pass provider meta on destroy.
paddycarver Sep 26, 2019
5c6bc65
First provider_meta test written.
paddycarver Sep 26, 2019
53c2d6d
Start supporting ProviderMeta on all RPC calls.
paddycarver Oct 1, 2019
b15ca8d
Set ProviderMeta during PlanResourceChange.
paddycarver Oct 1, 2019
a0dea88
Add support for refresh to ProviderMeta.
paddycarver Oct 1, 2019
42f49d6
Add test that ProviderMeta is set on Destroy.
paddycarver Oct 1, 2019
1c831cb
Add support for data sources with ProviderMeta.
paddycarver Oct 1, 2019
67455b9
Flesh out tests a bit.
paddycarver Oct 30, 2019
869bdbb
Finish tests, fix some error subjects.
paddycarver Oct 31, 2019
cac3f9a
Add documentation for provider_meta.
paddycarver Nov 1, 2019
4b65daa
Fix import errors.
paddycarver Nov 1, 2019
be9ad2e
OK but run the tests this time.
paddycarver Nov 1, 2019
836d8bc
Delete terraform.tfstate
paddycarver Nov 12, 2019
ed4894a
Fix to use the new addrs.Provider struct.
paddycarver Dec 12, 2019
48b5210
Fix our transform to compile again.
paddycarver Dec 12, 2019
6fba1c1
Update our test cases to use submodules.
paddycarver Dec 12, 2019
e6dba2c
Whitespace fixes.
paddycarver Dec 12, 2019
3eab4e8
Implement provider meta schema everywher on the client.
paddycarver Dec 12, 2019
f85f0f0
Update in response to review.
paddycarver Jan 13, 2020
aa3476c
Add integration tests for provider meta.
paddycarver Feb 11, 2020
47b556d
Fill in provider_meta where it was missing in schema.
paddycarver Feb 11, 2020
c62e378
Try updating context tests to cross module boundaries.
paddycarver Feb 11, 2020
a875f24
Delete the three characters that cost me days.
paddycarver Feb 11, 2020
f35b91f
Add description to protocol for blocks/resources
paultyng Jan 17, 2020
db7ef30
Continue updating tests.
paddycarver Feb 26, 2020
109847d
Finish fixing tests.
paddycarver Feb 26, 2020
ecc8114
Fix broken tests.
paddycarver Feb 26, 2020
aeb26b2
Update version on website.
paddycarver Feb 26, 2020
0bcc625
Fix protobuf error and regenerate.
paddycarver Feb 26, 2020
298d5a5
Add mappings for desc, kind, dep
paultyng Jan 21, 2020
d7a135d
Update test fixtures.
paddycarver Feb 28, 2020
23acb02
Fix whitespace.
paddycarver Mar 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions command/jsonprovider/attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ func TestMarshalAttribute(t *testing.T) {
{
&configschema.Attribute{Type: cty.String, Optional: true, Computed: true},
&attribute{
AttributeType: json.RawMessage(`"string"`),
Optional: true,
Computed: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
Computed: true,
DescriptionKind: "plain",
},
},
{ // collection types look a little odd.
&configschema.Attribute{Type: cty.Map(cty.String), Optional: true, Computed: true},
&attribute{
AttributeType: json.RawMessage(`["map","string"]`),
Optional: true,
Computed: true,
AttributeType: json.RawMessage(`["map","string"]`),
Optional: true,
Computed: true,
DescriptionKind: "plain",
},
},
}
Expand Down
10 changes: 6 additions & 4 deletions command/jsonprovider/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,22 @@ func TestMarshalBlock(t *testing.T) {
},
Want: &block{
Attributes: map[string]*attribute{
"ami": {AttributeType: json.RawMessage(`"string"`), Optional: true},
"id": {AttributeType: json.RawMessage(`"string"`), Optional: true, Computed: true},
"ami": {AttributeType: json.RawMessage(`"string"`), Optional: true, DescriptionKind: "plain"},
"id": {AttributeType: json.RawMessage(`"string"`), Optional: true, Computed: true, DescriptionKind: "plain"},
},
BlockTypes: map[string]*blockType{
"network_interface": {
NestingMode: "list",
Block: &block{
Attributes: map[string]*attribute{
"description": {AttributeType: json.RawMessage(`"string"`), Optional: true},
"device_index": {AttributeType: json.RawMessage(`"string"`), Optional: true},
"description": {AttributeType: json.RawMessage(`"string"`), Optional: true, DescriptionKind: "plain"},
"device_index": {AttributeType: json.RawMessage(`"string"`), Optional: true, DescriptionKind: "plain"},
},
DescriptionKind: "plain",
},
},
},
DescriptionKind: "plain",
},
},
}
Expand Down
54 changes: 34 additions & 20 deletions command/jsonprovider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ func TestMarshalProvider(t *testing.T) {
Block: &block{
Attributes: map[string]*attribute{
"region": {
AttributeType: json.RawMessage(`"string"`),
Required: true,
AttributeType: json.RawMessage(`"string"`),
Required: true,
DescriptionKind: "plain",
},
},
DescriptionKind: "plain",
},
},
ResourceSchemas: map[string]*schema{
Expand All @@ -40,32 +42,38 @@ func TestMarshalProvider(t *testing.T) {
Block: &block{
Attributes: map[string]*attribute{
"id": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
Computed: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
Computed: true,
DescriptionKind: "plain",
},
"ami": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
DescriptionKind: "plain",
},
},
BlockTypes: map[string]*blockType{
"network_interface": {
Block: &block{
Attributes: map[string]*attribute{
"device_index": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
DescriptionKind: "plain",
},
"description": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
DescriptionKind: "plain",
},
},
DescriptionKind: "plain",
},
NestingMode: "list",
},
},
DescriptionKind: "plain",
},
},
},
Expand All @@ -75,32 +83,38 @@ func TestMarshalProvider(t *testing.T) {
Block: &block{
Attributes: map[string]*attribute{
"id": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
Computed: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
Computed: true,
DescriptionKind: "plain",
},
"ami": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
DescriptionKind: "plain",
},
},
BlockTypes: map[string]*blockType{
"network_interface": {
Block: &block{
Attributes: map[string]*attribute{
"device_index": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
DescriptionKind: "plain",
},
"description": {
AttributeType: json.RawMessage(`"string"`),
Optional: true,
AttributeType: json.RawMessage(`"string"`),
Optional: true,
DescriptionKind: "plain",
},
},
DescriptionKind: "plain",
},
NestingMode: "list",
},
},
DescriptionKind: "plain",
},
},
},
Expand Down
11 changes: 7 additions & 4 deletions command/testdata/providers-schema/basic/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@
"attributes": {
"ami": {
"type": "string",
"optional": true
"optional": true,
"description_kind": "plain"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is some weird whitespace here

},
"id": {
"type": "string",
"optional": true,
"computed": true
"computed": true,
"description_kind": "plain"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is some weird whitespace here

}
}
},
"description_kind": "plain"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is some weird whitespace here

}
}
}
}
}
}
}