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

Missing types in monitoring for v6.41.0 #11207

Closed
ringods opened this issue Oct 28, 2022 · 4 comments · Fixed by #11244
Closed

Missing types in monitoring for v6.41.0 #11207

ringods opened this issue Oct 28, 2022 · 4 comments · Fixed by #11244
Assignees
Labels
area/codegen SDK-gen, program-gen, convert kind/bug Some behavior is incorrect or out of spec language/go p1 Bugs severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@ringods
Copy link
Member

ringods commented Oct 28, 2022

What happened?

Customer reports build problems when using v6.41.0 of the Go SDK for this provider:

error: error in compiling Go: unable to run `go build`: exit status 2

    # github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/monitoring
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:90:15: undefined: ServiceBasicServicePtrOutput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:102:14: undefined: ServiceTelemetryArrayOutput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:146:16: undefined: ServiceBasicService
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:158:16: undefined: ServiceTelemetry
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:171:15: undefined: ServiceBasicServicePtrInput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:183:14: undefined: ServiceTelemetryArrayInput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:200:16: undefined: ServiceBasicService
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:222:15: undefined: ServiceBasicServicePtrInput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:329:39: undefined: ServiceBasicServicePtrOutput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:356:38: undefined: ServiceTelemetryArrayOutput
    ../../../../../go/pkg/mod/github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go:356:38: too many errors

Steps to reproduce

This file was added to the Go SDK:

https://github.com/pulumi/pulumi-gcp/blob/v6.41.0/sdk/go/gcp/monitoring/service.go

But refers to types not defined elsewhere in the SDK

Expected Behavior

All types should be generated.

Actual Behavior

There are 10 missing types.

Output of pulumi about

pulumi-gcp v6.41.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@ringods ringods added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 28, 2022
@lblackstone
Copy link
Member

lblackstone commented Oct 31, 2022

@pulumi/platform This looks like a codegen issue. I tried upgrading to the latest tfbridge, but these types are still missing.

Changes with the latest version are in this PR: pulumi/pulumi-gcp#935

@iwahbe iwahbe added the p1 Bugs severe enough to be the next item assigned to an engineer label Oct 31, 2022
@iwahbe iwahbe transferred this issue from pulumi/pulumi-gcp Oct 31, 2022
@iwahbe iwahbe added language/go area/codegen SDK-gen, program-gen, convert and removed needs-triage Needs attention from the triage team labels Oct 31, 2022
@lblackstone
Copy link
Member

@iwahbe pointed out that the sdk package wasn't building, so I checked back on older releases to see when this regressed. It appears that pulumi/pulumi-gcp#865 introduced a compilation error.

v6.32.0 compiles, but v6.33.0 does not.

cd sdk && go build ./...
# github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/certificatemanager
go/gcp/certificatemanager/certificateMap.go:61:6: CertificateMap redeclared in this block
	go/gcp/certificatemanager/certificate.go:336:6: other declaration of CertificateMap
go/gcp/certificatemanager/certificateMap.go:92:98: cannot use &resource (value of type *CertificateMap) as type pulumi.Resource in argument to ctx.RegisterResource:
	*CertificateMap does not implement pulumi.Resource (missing URN method)
go/gcp/certificatemanager/certificateMap.go:189:6: CertificateMapInput redeclared in this block
	go/gcp/certificatemanager/certificate.go:329:6: other declaration of CertificateMapInput
go/gcp/certificatemanager/certificateMap.go:196:24: CertificateMap.ElementType redeclared in this block
	go/gcp/certificatemanager/certificate.go:338:23: other declaration of ElementType
go/gcp/certificatemanager/certificateMap.go:200:26: CertificateMap.ToCertificateMapOutput redeclared in this block
	go/gcp/certificatemanager/certificate.go:342:25: other declaration of ToCertificateMapOutput
go/gcp/certificatemanager/certificateMap.go:204:26: CertificateMap.ToCertificateMapOutputWithContext redeclared in this block
	go/gcp/certificatemanager/certificate.go:346:25: other declaration of ToCertificateMapOutputWithContext
go/gcp/certificatemanager/certificateMap.go:258:6: CertificateMapOutput redeclared in this block
	go/gcp/certificatemanager/certificate.go:435:6: other declaration of CertificateMapOutput
go/gcp/certificatemanager/certificateMap.go:260:29: CertificateMapOutput.ElementType redeclared in this block
	go/gcp/certificatemanager/certificate.go:437:29: other declaration of ElementType
go/gcp/certificatemanager/certificateMap.go:264:31: CertificateMapOutput.ToCertificateMapOutput redeclared in this block
	go/gcp/certificatemanager/certificate.go:441:31: other declaration of ToCertificateMapOutput
go/gcp/certificatemanager/certificateMap.go:268:31: CertificateMapOutput.ToCertificateMapOutputWithContext redeclared in this block
	go/gcp/certificatemanager/certificate.go:445:31: other declaration of ToCertificateMapOutputWithContext
go/gcp/certificatemanager/certificateMap.go:92:98: too many errors

@iwahbe
Copy link
Member

iwahbe commented Oct 31, 2022

You can build and test the issue with

export PULUMI_EXTRA_MAPPING_ERROR=true;
export PULUMI_MISSING_DOCS_ERROR=true;
export PULUMI_MISSING_MAPPING_ERROR=true;
make tfgen build_go && (cd sdk && go mod tidy && go build ./...);

@iwahbe
Copy link
Member

iwahbe commented Nov 3, 2022

I think there were two issues with the gcp SDK:

  1. We generated duplicate names (fixed by Allow resource names that conflict with extra types #11244).
  2. The SDK didn't delete the old SDK folder during regeneration, leaving orphaned files from previous generations. (such as github.com/pulumi/pulumi-gcp/sdk/v6@v6.41.0/go/gcp/monitoring/service.go)

By depending on the change from #11244 and running rm sdk/go before sdk generation, I can build the newly generated schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen SDK-gen, program-gen, convert kind/bug Some behavior is incorrect or out of spec language/go p1 Bugs severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants