Hello Everyone!
I have been attempting to migrate my build systems/projects to a bazel-driven monorepo. Bazel has been (unsurprisingly) working fantastically for building my code. Where bazel has been (unsurprisingly) obtrusive and unergonomic has been in including external dependencies. I've been thinking about how I'd like to mimic Google's internal third_party source try externally. I have been toying with the idea of mixing Copybara, git sparse-checkout, and bazel to build a public third_party build tree. I have been playing with copybara as a tool to accomplish this goal and I think that it would work well for this use case. I've been having some trouble, though, in configuring copybara to work on a locally cloned git repository. Copybara seems to be focused on taking code from an internal repository and moving it outside of a repository for public distribution and because of that there does not seem to be a way tell copybara to store changes into a git repository that is locally cloned. Ideally my workflow would look something like this:
1. Branch into a new branch `git checkout -b libfoobar-0.0.1`
2. Tell copybara to sync history up to some branch/tag/commit (update copy.bara.sky to point to release-0.0.1) into a local folder
3. Commit an update that creates/update the internal BUILD files for that project
4. Run CI that builds & runs all tests
5. CL with 3-point-merge to master
What is not apparent to me from the copybara documentation and examples:
1. Will copybara gracefully handle a history that will be created by this workflow?
2. How to tell copybara to work against a local HEAD?
3. Will copybara be able to handle history changes from upstream (squashes, fast forward merges, etc)?
4. Is copybara a bad tool for this use case?
Thanks for your time,
- Josh