Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to push multiple modules in Buf workspace #22

Closed
xmlking opened this issue Aug 6, 2022 · 2 comments
Closed

Document how to push multiple modules in Buf workspace #22

xmlking opened this issue Aug 6, 2022 · 2 comments

Comments

@xmlking
Copy link

xmlking commented Aug 6, 2022

As Buf supports multi-module proto workspaces as documented here https://docs.buf.build/tour/push-workspace-modules ,
please document how to push multiple modules via this GitHub action for a monorepo.

If possible, please improve this action to support pushing multi-module repo with coordinated buf mod update and buf push

@xmlking xmlking changed the title Document how to use push multiple modules in Buf workspace Document how to push multiple modules in Buf workspace Aug 6, 2022
@amckinney
Copy link
Contributor

This will largely depend on the modules defined in your workspace. In short, you'll need to push and update each module in the order of a DAG - the upstream modules should be pushed first, so that the downstream modules can update to the latest commit, be pushed themselves, and so on. This is described here.

A very crude example is something like this:

steps:
  # Run `git checkout`
  - uses: actions/checkout@v2
  # Install the `buf` CLI
  - uses: bufbuild/buf-setup-action@v1
  - uses: bufbuild/buf-push-action@v1
    with:
      input: paymentapis
      buf_token: ${{ secrets.BUF_TOKEN }}
  - name: update-petapis
    run: buf mod update petapis
  - uses: bufbuild/buf-push-action@v1
    with:
      input: petapis
      buf_token: ${{ secrets.BUF_TOKEN }}

It's important to note that you should also check in the updated petapis/buf.lock file (from the buf mod update petapis command) so that it's committed back to your repository.

We'd eventually like to bake all this complexity into the buf push command itself - see this issue for details.

@xmlking
Copy link
Author

xmlking commented Aug 10, 2022

Hope we could figure out DAG of dependencies programmatically and automatically push all modules in the order.
Agree , committing the ,lock files is impotent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants