Conversation
The provider implementation lives in internal/provider, which Go's module visibility rules make unimportable from outside this repository. Re-exporting New through a non-internal shim package lets external tooling embed the provider, in particular a Pulumi provider built on the Pulumi Terraform Bridge, which must construct the terraform-plugin-framework provider to generate a schema and language SDKs. No behavior change: shim.New returns exactly what main.go already passes to providerserver.Serve.
1e3a925 to
6f0a10c
Compare
|
@ctian1 @jeffy sorry to tag you directly, but I suspect pull requests on this mirror may not surface to To be clear about the stakes: this is not blocking anything. The Pulumi bridge works today without The one thing that would help either way: if this repository is generated from an internal tree, could |
|
Following up with the piece that was missing when I opened this: the downstream consumer now exists and is published, so this is no longer a speculative request.
All 18 resources and 6 data sources map cleanly with no hand-written token overrides, so the Pulumi surface tracks this repo rather than reimplementing it. To be straight about the urgency: this PR is not blocking anything. The bridge needs to construct the framework provider in-process to generate its schema, and The reason it is still worth merging is that the workaround is a fake module standing in for a real one. Every consumer that wants to embed this provider has to reinvent it, and it silently breaks the moment The diff is one new file, no behavior change, no new dependencies (both imports are already in One question, since every commit here is @jeffy @ctian1 tagging you as the two pushing the syncs. Also relevant to #2, which is in the same position. |
Why
I'm building a Pulumi provider for Devin on the Pulumi Terraform Bridge, to be published under the community pulumiverse org (same as pulumiverse/pulumi-unleash, which I maintain).
The bridge generates its Pulumi schema and the .NET/Go/Node.js/Python SDKs by constructing the terraform-plugin-framework provider in-process, so it needs
provider.New, which lives ininternal/provider.To be precise about the problem, since there is a workaround: the bridge can reach an internal constructor by declaring a synthetic module inside my repo whose module path is nested under yours (
github.com/cognitionai/terraform-provider-devin/shim), plus areplacedirective pointing it at a local directory. Go's internal-visibility check is on the import path, not the module, so that compiles. It's the pattern Pulumi's own boilerplate documents, and it's what I'll use if this PR isn't the right channel.It's just not a nice arrangement: a third-party repo squats a module path in your namespace, and it silently breaks if
internal/provider.New's signature moves. A 20-line package here makes the dependency explicit and reviewable on your side.What
Adds
shim/shim.go, a non-internal package that re-exports the constructor:shim.Newreturns exactly whatmain.goalready passes toproviderserver.Serve, so there is no behavior change, no change to any existing file, and nothing new in the provider binary's own code path.This mirrors the equivalent change in the Unleash provider (Unleash/terraform-provider-unleash#307, merged 2026-07-29), which unblocked the Pulumi bridge there.
One ask, if you're open to it
The bridge has to pin a released version of this module. A tagged release containing this commit (rather than only a merge to
main) lets the Pulumi provider depend onv0.2.1-or-similar instead of a pseudo-version. Happy to follow up whenever suits your release cadence.Also worth flagging: this repo's history looks like a squashed export from an internal source of truth (
Sync provider source). If that means external PRs aren't the right channel, just say so and I'll close this. The useful part is the 20-line file, however you'd prefer to land it.