Commit graph

9 commits

Author SHA1 Message Date
Ian Wahbe 4b7985384c
[codegen/go] Call site defaults for Pulumi Object types (#8411)
* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add feature flag for go

* Add required+default test case

* Don't `<any>` cast known types.

* Add more flags.

I realize this should really wait for PR#8400 to merge.

* Add plain object to env-helper test

This test fails right now. My next problem is fixing it.

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Add test case

* Fix tests

* Add test dependencies correctly

* Feed through error handling

* Include test output

* Get types to line up

* Add remaining test files

* Update changelog

* Correctly find type paths

* Handle transitive objects

* Handle required fields

* Add required+default test case

* Don't `<any>` cast known types.

* Add plain object to env-helper test

This test fails right now. My next problem is fixing it.

* Handle plain types

* Handle function inputs

* Fix the indentation

* Handle output types correctly

* Remove unnecessary `!`

* Start on `genPlainObjectDefaultFunc`

* Add missing change to fix test

* Run tests with merge

* Refactor out assign

* Merge in next _index.md diff

* Change method name to `Defaults`

* Handle enums correctly

* Another attempt at _index.md

* Make module generation deterministic

* Add checks for old values

* Insert defaults in resources

* Fix docs generation

Credit to @praneetloke

* Progress on adding defaults to Resource arguments

* Handle resource argument defaults

* Don't create defaults if disableObjectDefaults

* Rename test folder

* Add test for disable flag

* Fix disable test

* Update docs

* Abstract out nil comparisons

* Use reflection to test for empty values

* Simplify Ptr and pulumi.Any type handling

* Remove unused function

* Apply defaults to functions

* Update new test with master codegen

* Tests + nil check
2021-11-23 15:10:15 -08:00
Ian Wahbe 208c6ec44d
Add flag for input registration to the go schema (#8198)
* Add flag

* Update CHANGELOG_PENDING.md

* Add this feature to an orthogonal test
2021-10-12 10:15:24 -07:00
Justin Van Patten 230f4ee006
Support "lifting" single-valued method returns to their return type (#8111)
This change allows lifting single valued method returns rather than using an output structure.
2021-10-01 11:33:02 -07:00
Anton Tayanovskyy 98ef06ecb8
Go codegen flag to disable fnOutput generation to save space (#8106) 2021-09-30 14:56:42 -04:00
Komal a1b7f64bdd
[docgen/go] - Fix go docgen links for pulumi types (#7558) 2021-07-20 15:57:48 -07:00
James Nugent f73ec2fc71
[codegen/go] Permit production of flat Go packages (#6862)
When working in a monorepo environment, it can be desirable to generate
Go SDKs into a structure less like the upstream SDKs, and more like
this:

github.com/x/mymonorepo/sdk/go/package-name

Where `package-name` is also the root of a Go module. Since
`package-name` is not a valid package name in Go, it's also desirable to
be able to choose a replacement name and reduce the amount of nesting.

This commit adds a new Go option to the schema, `rootPackageName`, which
can be used to modify the generated root package name (e.g. to
`mypackage` instead of `package-name`, and remove the additional layer
of nesting.

Test coverage is added to ensure that the correct file structure and
package names are generated.
2021-04-29 13:30:01 -06:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Vivek Lakshmanan 4da8a45eb2 Option to generate container types resources now specified in GoPackageInfo 2021-01-20 11:29:01 -08:00
Pat Gavlin 1f19cbbe08
Clean up the language-specific schema APIs. (#4454)
Rather than forcing consumers to deal with language-specific data
ad-hoc, add an API that allows all language-specific data to be decoded
up-front.
2020-04-20 16:36:05 -07:00