sparse-intern-71089
12/28/2023, 1:58 PMbig-architect-71258
12/29/2023, 7:13 PMbig-architect-71258
12/30/2023, 2:46 PMbig-architect-71258
12/30/2023, 2:57 PMshim.Provider
does not align with the interface exposed by the GO Provider Framework provider.Provider
. So you can't use the GO Provider Framework to create a mux provider. At least inconvenient. However, I would go so far as to say that all these interfaces for providers make the Pulumi ecosystem look chaotic in this area.limited-rainbow-51650
12/30/2023, 3:03 PMbig-architect-71258
12/30/2023, 3:15 PMancient-policeman-24615
12/30/2023, 3:54 PMI saw that PF in the Bridge uses a completely different approach to mux providers. (AugmentShimWithPF). The code is used at least in the Pulumi Cloudflare, Exoscale and MongoDBAtlas providers. So we canโt introduce a breaking change here and align the code with what I created for the TF SDK V1 and V2 providers. Because we have no muxing for TF SDK providers yet we should align here with the code used for PF based providers.We will need to keep that functionality, since it is deployed in many of our providers. That said, I donโt think we need to align muxing a generic pulumi provider with the
AugmentShimWithPF
call. The two are meaningfully different. For example, tfbridge.ProviderInfo
mappings apply to the SDK V{1,2} and PF providers. They will not apply to MuxWith
addins. I think the .MuxWith
design makes sense for adding in a generic provider.
Main issue with this approach will be that the required interfacedoes not align with the interface exposed by the GO Provider Frameworkshim.Provider
. So you canโt use the GO Provider Framework to create a mux provider. At least inconvenient. However, I would go so far as to say that all these interfaces for providers make the Pulumi ecosystem look chaotic in this area.provider.Provider
shim.Provider
is an abstraction over a TF provider. provider.Provider
is an abstraction over a Pulumi provider. The interfaces are very different, but I agree that the work provider is overused here.
---
@big-architect-71258 Iโm reviewing your PR now.big-architect-71258
12/30/2023, 6:34 PMAugmentShimWithPF
at the same time with MuxWith
?
Next possible issue: pf
has a different entry point as tfbridge
for SDK V{1,2} providers (as mentioned by @enough-garden-22763 in https://github.com/pulumi/pulumi-terraform-bridge/issues/1487). Currently I only added the code to evaluate MuxWith
to tfbridge
. Does the code in PF also need to be changed? And if so, how do we prevent a collision with AugmentShimWithPF
?big-architect-71258
12/31/2023, 11:38 AMancient-policeman-24615
01/02/2024, 1:31 PMpf/tfbridge.serve
and pf/tfbridge.MainWithMuxer
that errors if len(ProviderInfo.MuxWith) > 0
.
Eventually, we will want you to be able to combine arbitrary Terraform providers (served from ProviderInfo.P
) and arbitrary Pulumi providers (served from ProviderInfo.MuxWith
). I donโt think we need that all in 1 PR. A series of PRs is much more likely to merge then one monster PR.ancient-policeman-24615
01/02/2024, 1:31 PMbig-architect-71258
01/02/2024, 2:09 PMMuxWith
with AugmentShimWithPF
.
I totally agree with you that it is not a good idea to create a monster PR to squeeze the PF customizations into the current PR.
However, I will add a len(ProviderInfo.MuxWith) > 0
with an error
to pf/tfbridge.MainWithMuxer
to avoid problems with unadapted code there.ancient-policeman-24615
01/02/2024, 2:12 PMThen I understood correctly that the PF implementation also needs to be changed and that one challenge is to combineYepwithMuxWith
.AugmentShimWithPF
However, I will add aGreatwith anlen(ProviderInfo.MuxWith) > 0
toerror
to avoid problems with unadapted code there.pf/tfbridge.MainWithMuxer
big-architect-71258
01/02/2024, 2:14 PMancient-policeman-24615
01/02/2024, 2:14 PMbig-architect-71258
01/02/2024, 2:15 PMbig-architect-71258
01/02/2024, 2:30 PMlen(ProviderInfo.MuxWith) > 0
Had to use panic
because the methods MainWithMuxer
for pf/tfgen
and pf/tfbridge
do not return an error
.big-architect-71258
01/03/2024, 5:21 PMliniting
fails. I local `make lint`is successful though.big-architect-71258
01/03/2024, 5:27 PMlimited-rainbow-51650
01/03/2024, 6:19 PMbig-architect-71258
01/03/2024, 6:21 PMmake lint
and having the the same version of golangci-lint
installed.ancient-policeman-24615
01/03/2024, 6:25 PMmake lint
fails locally for me on your PR.big-architect-71258
01/03/2024, 6:26 PMancient-policeman-24615
01/03/2024, 6:26 PM$ golangci-lint --version
golangci-lint has version 1.55.2 built with go1.21.3 from e3c2265 on 2023-11-02T214002Z
ancient-policeman-24615
01/03/2024, 6:27 PMgit clean -fxd
is my go to hammer for this (but it will removed everything not checked into git).big-architect-71258
01/03/2024, 6:28 PMgolangci-lint
is slightly different. Hard to spot the difference
golangci-lint has version 1.55.2 built with go1.21.3 from e3c2265*f* on 2023-11-03T125925Zbig-architect-71258
01/03/2024, 6:29 PMancient-policeman-24615
01/03/2024, 6:29 PMgo mod tidy
in pkg/tests
.ancient-policeman-24615
01/03/2024, 6:30 PMbig-architect-71258
01/03/2024, 6:30 PMgolanglint-ci
fails.limited-rainbow-51650
01/03/2024, 6:31 PMbig-architect-71258
01/03/2024, 6:31 PMgo mod tidy
linting is successful. Pushing the changes now.big-architect-71258
01/03/2024, 6:31 PMancient-policeman-24615
01/03/2024, 6:32 PMbig-architect-71258
01/03/2024, 6:33 PMgolanglint-ci
could be improved. Changes pushed BTWbig-architect-71258
01/03/2024, 7:47 PMenough-garden-22763
01/03/2024, 7:56 PM