add support for installing released plugins#1658
Conversation
Update `buf alpha plugin push` command to add support for installing plugins from released versions (zip file containing buf.plugin.yaml and image.tar). Remove all support for building Docker images (Docker CLI is preferred).
| return err | ||
| } | ||
| var sourceBucket storage.ReadWriteBucket | ||
| if !sourceStat.IsDir() && strings.HasSuffix(strings.ToLower(sourceStat.Name()), ".zip") { |
There was a problem hiding this comment.
If argument is a zip file, then we'll create a temp dir and unpack contents to it.
| tagResponse, err := client.Tag(ctx, flags.Image, pluginConfig) | ||
| var imageToTag string | ||
| if flags.Image != "" { | ||
| imageToTag = flags.Image |
There was a problem hiding this comment.
The --image always takes precedence. If not specified, we fall back to looking for a pre-built image.tar in the directory where the buf.plugin.yaml is found.
There was a problem hiding this comment.
I'd error to avoid surprising behavior. But we don't need to get the UX ideal right now, let's see how this will be used.
| } | ||
|
|
||
| func buildDockerPlugin(t testing.TB, dockerClient Client, dockerfilePath string, pluginIdentity string, pluginVersion string) (*BuildResponse, error) { | ||
| func buildDockerPlugin(t testing.TB, dockerfilePath string, pluginIdentity string) (string, error) { |
There was a problem hiding this comment.
Removed code which used to build docker images in favor of just shelling out to the docker command to run some basic tests. This still allows us to keep coverage up for issues seen when pushing images, etc.
There was a problem hiding this comment.
At this point we're effectively testing the docker cli, do we still find these tests useful?
buf/private/bufpkg/bufplugin/bufplugindocker/docker.go
Lines 205 to 208 in 34fdcfa
Did the previous tests require you to have docker cli or the docker engine installed?
There was a problem hiding this comment.
Yeah they did. We still exercise tests where we simulate errors from the docker registry push, etc. I think it is still useful to keep around.
| github.com/jhump/protoreflect v1.14.0 | ||
| github.com/klauspost/compress v1.15.12 | ||
| github.com/klauspost/pgzip v1.2.5 | ||
| github.com/moby/buildkit v0.10.5 |
Update `buf alpha plugin push` command to add support for installing plugins from released versions (zip file containing buf.plugin.yaml and image.tar). Remove all support for building Docker images (Docker CLI is preferred).
Update
buf alpha plugin pushcommand to add support for installing plugins from released versions (zip file containing buf.plugin.yaml and image.tar). Remove all support for building Docker images (Docker CLI is preferred).