Skip to content

Workspace push #838

@lrewega

Description

@lrewega

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 the buf 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions