Skip to content

Commit fd03c36

Browse files
committed
Revert invoke of remote plugins
1 parent 1a43687 commit fd03c36

File tree

15 files changed

+17
-156
lines changed

15 files changed

+17
-156
lines changed

private/buf/bufctl/controller.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ type Controller interface {
128128
defaultMessageEncoding buffetch.MessageEncoding,
129129
options ...FunctionOption,
130130
) error
131-
PluginKeyProvider() bufplugin.PluginKeyProvider
132-
PluginDataProvider() bufplugin.PluginDataProvider
133131
}
134132

135133
func NewController(
@@ -708,14 +706,6 @@ func (c *controller) PutMessage(
708706
return errors.Join(err, writeCloser.Close())
709707
}
710708

711-
func (c *controller) PluginKeyProvider() bufplugin.PluginKeyProvider {
712-
return c.pluginKeyProvider
713-
}
714-
715-
func (c *controller) PluginDataProvider() bufplugin.PluginDataProvider {
716-
return c.pluginDataProvider
717-
}
718-
719709
func (c *controller) getImage(
720710
ctx context.Context,
721711
input string,

private/buf/bufmigrate/migrator.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
3030
"github.com/bufbuild/buf/private/bufpkg/bufmodule"
3131
"github.com/bufbuild/buf/private/bufpkg/bufparse"
32-
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
3332
"github.com/bufbuild/buf/private/pkg/normalpath"
3433
"github.com/bufbuild/buf/private/pkg/slicesext"
3534
"github.com/bufbuild/buf/private/pkg/storage"
@@ -696,7 +695,7 @@ func equivalentCheckConfigInV2(
696695
) (bufconfig.CheckConfig, error) {
697696
// No need for custom lint/breaking plugins since there's no plugins to migrate from <=v1.
698697
// TODO: If we ever need v3, then we will have to deal with this.
699-
client, err := bufcheck.NewClient(logger, bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime, bufplugin.NopPluginKeyProvider, bufplugin.NopPluginDataProvider))
698+
client, err := bufcheck.NewClient(logger, bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime))
700699
if err != nil {
701700
return nil, err
702701
}

private/buf/cmd/buf/buf_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
3636
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
3737
"github.com/bufbuild/buf/private/bufpkg/bufimage"
38-
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
3938
imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1"
4039
"github.com/bufbuild/buf/private/pkg/app/appcmd"
4140
"github.com/bufbuild/buf/private/pkg/app/appcmd/appcmdtesting"
@@ -1351,11 +1350,7 @@ func TestCheckLsBreakingRulesFromConfigExceptDeprecated(t *testing.T) {
13511350
// Do not need any custom lint/breaking plugins here.
13521351
client, err := bufcheck.NewClient(
13531352
slogtestext.NewLogger(t),
1354-
bufcheck.NewRunnerProvider(
1355-
wasm.UnimplementedRuntime,
1356-
bufplugin.NopPluginKeyProvider,
1357-
bufplugin.NopPluginDataProvider,
1358-
),
1353+
bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime),
13591354
)
13601355
require.NoError(t, err)
13611356
allRules, err := client.AllRules(context.Background(), check.RuleTypeBreaking, version)

private/buf/cmd/buf/command/beta/lsp/lsp.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ func run(
115115
}()
116116
checkClient, err := bufcheck.NewClient(
117117
container.Logger(),
118-
bufcheck.NewRunnerProvider(
119-
wasmRuntime,
120-
controller.PluginKeyProvider(),
121-
controller.PluginDataProvider(),
122-
),
118+
bufcheck.NewRunnerProvider(wasmRuntime),
123119
bufcheck.ClientWithStderr(container.Stderr()),
124120
)
125121
if err != nil {

private/buf/cmd/buf/command/breaking/breaking.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,7 @@ func run(
220220
for i, imageWithConfig := range imageWithConfigs {
221221
client, err := bufcheck.NewClient(
222222
container.Logger(),
223-
bufcheck.NewRunnerProvider(
224-
wasmRuntime,
225-
controller.PluginKeyProvider(),
226-
controller.PluginDataProvider(),
227-
),
223+
bufcheck.NewRunnerProvider(wasmRuntime),
228224
bufcheck.ClientWithStderr(container.Stderr()),
229225
)
230226
if err != nil {

private/buf/cmd/buf/command/config/internal/internal.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,6 @@ func lsRun(
183183
return err
184184
}
185185
}
186-
controller, err := bufcli.NewController(container)
187-
if err != nil {
188-
return err
189-
}
190186
wasmRuntimeCacheDir, err := bufcli.CreateWasmRuntimeCacheDir(container)
191187
if err != nil {
192188
return err
@@ -200,11 +196,7 @@ func lsRun(
200196
}()
201197
client, err := bufcheck.NewClient(
202198
container.Logger(),
203-
bufcheck.NewRunnerProvider(
204-
wasmRuntime,
205-
controller.PluginKeyProvider(),
206-
controller.PluginDataProvider(),
207-
),
199+
bufcheck.NewRunnerProvider(wasmRuntime),
208200
bufcheck.ClientWithStderr(container.Stderr()),
209201
)
210202
if err != nil {

private/buf/cmd/buf/command/lint/lint.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ func run(
145145
for _, imageWithConfig := range imageWithConfigs {
146146
client, err := bufcheck.NewClient(
147147
container.Logger(),
148-
bufcheck.NewRunnerProvider(
149-
wasmRuntime,
150-
controller.PluginKeyProvider(),
151-
controller.PluginDataProvider(),
152-
),
148+
bufcheck.NewRunnerProvider(wasmRuntime),
153149
bufcheck.ClientWithStderr(container.Stderr()),
154150
)
155151
if err != nil {

private/buf/cmd/buf/command/mod/internal/internal.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"github.com/bufbuild/buf/private/buf/bufcli"
2525
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
2626
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
27-
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
2827
"github.com/bufbuild/buf/private/pkg/app/appcmd"
2928
"github.com/bufbuild/buf/private/pkg/app/appext"
3029
"github.com/bufbuild/buf/private/pkg/slicesext"
@@ -176,11 +175,7 @@ func lsRun(
176175
// BufYAMLFiles <=v1 never had plugins.
177176
client, err := bufcheck.NewClient(
178177
container.Logger(),
179-
bufcheck.NewRunnerProvider(
180-
wasm.UnimplementedRuntime,
181-
bufplugin.NopPluginKeyProvider,
182-
bufplugin.NopPluginDataProvider,
183-
),
178+
bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime),
184179
bufcheck.ClientWithStderr(container.Stderr()),
185180
)
186181
if err != nil {

private/buf/cmd/protoc-gen-buf-breaking/breaking.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"github.com/bufbuild/buf/private/bufpkg/bufanalysis"
2929
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
3030
"github.com/bufbuild/buf/private/bufpkg/bufimage"
31-
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
3231
"github.com/bufbuild/buf/private/pkg/encoding"
3332
"github.com/bufbuild/buf/private/pkg/protodescriptor"
3433
"github.com/bufbuild/buf/private/pkg/protoencoding"
@@ -126,11 +125,7 @@ func handle(
126125
// The protoc plugins do not support custom lint/breaking change plugins for now.
127126
client, err := bufcheck.NewClient(
128127
container.Logger(),
129-
bufcheck.NewRunnerProvider(
130-
wasm.UnimplementedRuntime,
131-
bufplugin.NopPluginKeyProvider,
132-
bufplugin.NopPluginDataProvider,
133-
),
128+
bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime),
134129
bufcheck.ClientWithStderr(pluginEnv.Stderr),
135130
)
136131
if err != nil {

private/buf/cmd/protoc-gen-buf-lint/lint.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"github.com/bufbuild/buf/private/bufpkg/bufanalysis"
2828
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
2929
"github.com/bufbuild/buf/private/bufpkg/bufimage"
30-
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
3130
"github.com/bufbuild/buf/private/pkg/encoding"
3231
"github.com/bufbuild/buf/private/pkg/protodescriptor"
3332
"github.com/bufbuild/buf/private/pkg/protoencoding"
@@ -101,11 +100,7 @@ func handle(
101100
// The protoc plugins do not support custom lint/breaking change plugins for now.
102101
client, err := bufcheck.NewClient(
103102
container.Logger(),
104-
bufcheck.NewRunnerProvider(
105-
wasm.UnimplementedRuntime,
106-
bufplugin.NopPluginKeyProvider,
107-
bufplugin.NopPluginDataProvider,
108-
),
103+
bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime),
109104
bufcheck.ClientWithStderr(pluginEnv.Stderr),
110105
)
111106
if err != nil {

0 commit comments

Comments
 (0)