-
Notifications
You must be signed in to change notification settings - Fork 315
Description
Problem
From the docs:
When you are ready to push updates you've made in a local workspace, you'll need to push each module independently, starting with the upstream modules first (
buf.build/acme/paymentapis
in this case). Once the upstream module's changes are published, you can run thebuf mod update
command in the downstream module to fetch the latest version, and continue to push each of your modules until all of your local changes are published to the BSR.
It's not difficult to imagine this becoming tedious with many modules, and automating it involves tracking the dependency graph outside of buf
, which is a poor user experience and prone to error.
Proposal
Just as buf lint
and buf build
support operating on a workspace, it would be ideal to be able to buf mod update && buf push
recursively for the workspace. Without an atomic way to perform multiple commits, this is still fragile. We would have to be pretty careful here.
Implementation ideas
One option might be to "stage" all of the commits locally and then perform a batch of commits atomically. For comparison, git push
offers a feature to do this:
--[no-]atomic
Use an atomic transaction on the remote side if available. Either all refs are updated, or on error, no refs
are updated. If the server does not support atomic pushes the push will fail.
e.g. git push --atomic $REMOTE HEAD:some/ref HEAD~1:some/other/ref ...
Perhaps we could offer a batch commit service which does something similar.