bufbuild / buf

The best way of working with Protocol Buffers.
https://buf.build
Apache License 2.0
8.49k stars 247 forks source link

Add exclude unnamed flag for push #3075

Closed emcfarlane closed 2 weeks ago

emcfarlane commented 2 weeks ago

This PR adds the flag --exclude-unnamed for push. On push, this flag will allow for unnamed modules to be present in the buf.yaml config. Modules are filtered by name before pushing to the remote. Local only modules, modules without a name, are excluded. All dependencies for a named module must have a valid name.

As an example the following config will work with buf push --exclude-unnamed as long as the module foo does not depend on bar:

version: v2
modules:
  - path: foo
    name: buf.build/example/foo
  - path: bar
bufdev commented 2 weeks ago

since the docs imply that it should not be relied upon, but we definitely do in these cases

The docs definitely should be tightened up, but just a note that they said its structure should not be relied upon, not that it shouldn't be relied upon as a whole. However, we should document that it can be used as a human-readable identifier of the Module.