Skip to content

Commit

Permalink
Merge 26a9617 into f89e9a2
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Sep 2, 2021
2 parents f89e9a2 + 26a9617 commit 94aa4e9
Show file tree
Hide file tree
Showing 28 changed files with 245 additions and 194 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

- [automation/go] Fix loading of stack settings/configs from yaml files.
[#pulumi-kubernetes-operator/183](https://github.com/pulumi/pulumi-kubernetes-operator/issues/183)

- [codegen/schema] - Correct validation for Package
[#7896](https://github.com/pulumi/pulumi/pull/7896)
5 changes: 5 additions & 0 deletions pkg/cmd/pulumi/schema_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ func newSchemaCheckCommand() *cobra.Command {
diagWriter := hcl.NewDiagnosticTextWriter(os.Stderr, nil, 0, true)
wrErr := diagWriter.WriteDiagnostics(diags)
contract.IgnoreError(wrErr)
if err == nil && len(diags) != 0 {
// We don't want to print an error, but we do want to indicate
// that the check was not successful
os.Exit(1)
}
return err
}),
}
Expand Down
1 change: 1 addition & 0 deletions pkg/codegen/docs/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func initTestPackageSpec(t *testing.T) {
}
testPackageSpec = schema.PackageSpec{
Name: providerPackage,
Version: "0.0.1",
Description: "A fake provider package used for testing.",
Meta: &schema.MetadataSpec{
ModuleFormat: "(.*)(?:/[^/]*)",
Expand Down
1 change: 1 addition & 0 deletions pkg/codegen/dotnet/doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

var testPackageSpec = schema.PackageSpec{
Name: "aws",
Version: "0.0.1",
Description: "A fake provider package used for testing.",
Meta: &schema.MetadataSpec{
ModuleFormat: "(.*)(?:/[^/]*)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "funcWithAllOptionalInputs",
"version": "0.0.1",
"functions": {
"madeup-package:codegentest:funcWithAllOptionalInputs": {
"description": "Check codegen of functions with all optional inputs.",
Expand All @@ -22,9 +24,7 @@
}
},
"type": "object",
"required": [
"r"
]
"required": ["r"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"functions": {
"madeup-package:codegentest:funcWithConstInput": {
"description": "Codegen demo with const inputs",
"inputs": {
"type": "object",
"properties": {
"plainInput": {
"type": "string",
"const": "fixed"
}
}
}
"name": "funcWithConstInput",
"version": "0.0.1",
"functions": {
"madeup-package:codegentest:funcWithConstInput": {
"description": "Codegen demo with const inputs",
"inputs": {
"type": "object",
"properties": {
"plainInput": {
"type": "string",
"const": "fixed"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "funcWithDefaultValue",
"version": "0.0.1",
"functions": {
"madeup-package:codegentest:funcWithDefaultValue": {
"description": "Check codegen of functions with default values.",
"inputs": {
"type": "object",
"required": [
"a"
],
"required": ["a"],
"properties": {
"a": {
"type": "string"
Expand All @@ -24,9 +24,7 @@
}
},
"type": "object",
"required": [
"r"
]
"required": ["r"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "funcWithDictParam",
"version": "0.0.1",
"functions": {
"madeup-package:codegentest:funcWithDictParam": {
"description": "Check codegen of functions with a Dict<str,str> parameter.",
Expand All @@ -23,9 +25,7 @@
}
},
"type": "object",
"required": [
"r"
]
"required": ["r"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "funcWithListParam",
"version": "0.0.1",
"functions": {
"madeup-package:codegentest:funcWithListParam": {
"description": "Check codegen of functions with a List parameter.",
"inputs": {
"type": "object",
"properties": {
"a": {
"type": "array",
"items": {
"type": "string"
}
"type": "array",
"items": {
"type": "string"
}
},
"b": {
"type": "string"
Expand All @@ -23,9 +25,7 @@
}
},
"type": "object",
"required": [
"r"
]
"required": ["r"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "getClientConfig",
"version": "0.0.1",
"functions": {
"azure-native:codegentest:getClientConfig": {
"description": "Use this function to access the current configuration of the native Azure provider.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "getIntegrationRuntimeObjectMetadatum",
"version": "0.0.1",
"functions": {
"azure-native:codegentest:getIntegrationRuntimeObjectMetadatum": {
"description": "A list of SSIS object metadata.\nAPI Version: 2018-06-01.",
Expand Down Expand Up @@ -108,9 +110,7 @@
}
},
"type": "object",
"required": [
"type"
]
"required": ["type"]
},
"azure-native:codegentest:SsisFolderResponse": {
"description": "Ssis folder.",
Expand All @@ -134,9 +134,7 @@
}
},
"type": "object",
"required": [
"type"
]
"required": ["type"]
},
"azure-native:codegentest:SsisPackageResponse": {
"description": "Ssis Package.",
Expand Down Expand Up @@ -180,9 +178,7 @@
}
},
"type": "object",
"required": [
"type"
]
"required": ["type"]
},
"azure-native:codegentest:SsisProjectResponse": {
"description": "Ssis project.",
Expand Down Expand Up @@ -230,9 +226,7 @@
}
},
"type": "object",
"required": [
"type"
]
"required": ["type"]
},
"azure-native:codegentest:SsisEnvironmentReferenceResponse": {
"description": "Ssis environment reference.",
Expand Down
2 changes: 2 additions & 0 deletions pkg/codegen/internal/test/testdata/schema/bad-enum-1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "bad-enum-1",
"version": "0.0.1",
"types": {
"fake-provider:module1:BadEnum": {
"type": "string",
Expand Down
2 changes: 2 additions & 0 deletions pkg/codegen/internal/test/testdata/schema/bad-enum-2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "bad-enum-2",
"version": "0.0.1",
"types": {
"fake-provider:module1:BadEnum": {
"type": "string",
Expand Down
2 changes: 2 additions & 0 deletions pkg/codegen/internal/test/testdata/schema/bad-enum-3.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "bad-enum-3",
"version": "0.0.1",
"types": {
"fake-provider:module1:BadEnum": {
"type": "integer",
Expand Down
2 changes: 2 additions & 0 deletions pkg/codegen/internal/test/testdata/schema/bad-enum-4.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "bad-enum-4",
"version": "0.0.1",
"types": {
"fake-provider:module1:BadEnum": {
"type": "boolean",
Expand Down
14 changes: 8 additions & 6 deletions pkg/codegen/internal/test/testdata/schema/bad-methods-1.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"resources": {
"xyz:index:Foo": {
"methods": {
"bar": "xyz:index:Foo/bar"
}
}
"name": "bad-methods-1",
"version": "0.0.1",
"resources": {
"xyz:index:Foo": {
"methods": {
"bar": "xyz:index:Foo/bar"
}
}
}
}
48 changes: 25 additions & 23 deletions pkg/codegen/internal/test/testdata/schema/bad-methods-2.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
{
"resources": {
"xyz:index:Foo": {
"methods": {
"bar": "xyz:index:Foo/bar",
"baz": "xyz:index:Foo/bar"
}
"name": "bad-methods-2",
"version": "0.0.1",
"resources": {
"xyz:index:Foo": {
"methods": {
"bar": "xyz:index:Foo/bar",
"baz": "xyz:index:Foo/bar"
}
}
},
"functions": {
"xyz:index:Foo/bar": {
"inputs": {
"properties": {
"__self__": {
"$ref": "#/resources/xyz:index:Foo"
}
}
},
"functions": {
"xyz:index:Foo/bar": {
"inputs": {
"properties": {
"__self__": {
"$ref": "#/resources/xyz:index:Foo"
}
}
},
"outputs": {
"properties": {
"someValue": {
"type": "string"
}
}
}
},
"outputs": {
"properties": {
"someValue": {
"type": "string"
}
}
}
}
}
}
46 changes: 24 additions & 22 deletions pkg/codegen/internal/test/testdata/schema/bad-methods-3.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
{
"resources": {
"xyz:index:Foo": {
"methods": {
"bar": "xyz:index:Foo"
}
"name": "bad-methods-3",
"version": "0.0.1",
"resources": {
"xyz:index:Foo": {
"methods": {
"bar": "xyz:index:Foo"
}
}
},
"functions": {
"xyz:index:Foo": {
"inputs": {
"properties": {
"__self__": {
"$ref": "#/resources/xyz:index:Foo"
}
}
},
"functions": {
"xyz:index:Foo": {
"inputs": {
"properties": {
"__self__": {
"$ref": "#/resources/xyz:index:Foo"
}
}
},
"outputs": {
"properties": {
"someValue": {
"type": "string"
}
}
}
},
"outputs": {
"properties": {
"someValue": {
"type": "string"
}
}
}
}
}
}

0 comments on commit 94aa4e9

Please sign in to comment.