Commit Graph

17 Commits

Author SHA1 Message Date
Zaid Ajaj ef628d7ab0 Propagate SkipRangeTypechecking option down to program components 2023-07-14 19:00:38 +02:00
Zaid Ajaj fe5e65f0f4 Allow binding unsupported range and collection types in non-strict mode for pulumi convert 2023-07-12 19:13:57 +02:00
Zaid Ajaj ed02926277 Allow generating code for unknown invokes in non-strict mode 2023-07-10 15:05:18 +02:00
Zaid Ajaj 7ab7ad5a58 Prefer output-versioned invokes in generated programs for nodejs and python 2023-06-23 02:42:18 +02:00
Zaid Ajaj e3e4dbdb02 lint 2023-06-08 22:07:18 +02:00
Zaid Ajaj 604d0f9b77 Fixes range scoping for PCL components 2023-06-08 21:43:54 +02:00
Fraser Waters 46332e7d17 Make convert more lenient
Fixes https://github.com/pulumi/pulumi/issues/13117

This adds a new "--strict" flag to `pulumi convert` which defaults to
false. When strict is NOT set we bind the PCL with the extra options of
`SkipResourceTypechecking`, `AllowMissingVariables`, and
`AllowMissingProperties`. This will change some errors to warnings in
code generation.

The `strict` flag is sent over the gRPC interface to the Go/Node plugins
for their `GenerateProject` methods as they have to do PCL binding
plugin side currently.
2023-06-08 11:14:31 +01:00
Zaid Ajaj 0f25ea6471 include file name of component in diagnostic 2023-05-24 18:17:22 +02:00
Zaid Ajaj 1f1158ef94 Include the component source directory in diagnostics when reporting PCL errors 2023-05-24 16:29:01 +02:00
Abhinav Gupta ed5706ddb9
lint(govet): Enable nilness linter
govet includes a nilness linter that detects a few nil issues.
This linter is not enabled by default in govet because the `go` tool
does not want a dependency on the libraries necessary to implement this
().

Enable the nilness linter and fix the following issues found by it
(commentary below each check mine):

    pkg/cmd/pulumi/new.go:283:9: nilness: impossible condition: nil != nil (govet)
        ^- the error was very likely supposed to be the `os.Remove`
    pkg/cmd/pulumi/new.go:633:10: nilness: impossible condition: nil != nil (govet)
        ^- same error checked on the previous line
    pkg/cmd/pulumi/preview.go:190:11: nilness: impossible condition: nil != nil (govet)
        ^- same error checked a few blocks above
    pkg/codegen/pcl/binder_component.go:101:64: nilness: nil dereference in dynamic method call (govet)
        ^- err is guaranteed nil
    pkg/codegen/pcl/binder_component.go:133:10: nilness: impossible condition: nil != nil (govet)
        ^- err is guaranteed nil
    sdk/go/auto/errors_test.go:374:34: nilness: nil dereference in index operation (govet)
        ^- this is intentional; I replaced it with a deliberate panic
    tests/integration/construct_component_methods_resources/testcomponent-go/random.go:30:10: nilness: impossible condition: non-nil == nil (govet)
        ^- args is rejected if it's nil
2023-05-19 15:32:00 -07:00
Zaid Ajaj 98803e4d15 Examples of iterating lists and maps of objects in components 2023-03-24 10:40:18 +01:00
Zaid Ajaj 726caed8ab Object-typed config variables for components 2023-03-23 23:25:21 +01:00
Zaid Ajaj fe66a67ba1 Export fields from component binder args 2023-03-16 22:09:08 +01:00
Zaid Ajaj 6d01a77106 PCL program.SourceFiles(...) implementation and usage in pulumi convert 2023-03-16 11:51:45 +01:00
Zaid Ajaj 26e58eb9a8 nodejs program-gen implementation for components and support for nested component declarations 2023-03-14 16:17:14 +01:00
Abhinav Gupta acaf79bc10
all: Drop //nolint:goconst
Drops the nolint:goconst directive
now that the goconst linter is no longer enabled.
2023-03-09 11:15:21 -08:00
Zaid Ajaj ba639d555a PCL components and dotnet program-gen implementation 2023-03-08 14:21:34 +01:00