Skip to content

How to submit PRs involving module updates

Eric Chen edited this page Nov 20, 2019 · 5 revisions

For example, a PR needs to make changes in 3 repos where go-btfs depends on go-unixfs depends on go-btfs-chunker.

Before making any PRs, make sure local testing works:

  1. Make changes in go-btfs-chunker. Make sure go test ./... passes.
  2. Modify go.mod in go-unixfs, add a line replace github.com/TRON-US/go-btfs-chunker => ../go-btfs-chunker at the end. Make sure go test ./... passes.
  3. Modify go.mod in go-btfs, add a line replace github.com/TRON-US/go-unixfs => ../go-unixfs at the end. Under the case that some changes are backwards incompatible, there may also need an additional replace github.com/TRON-US/go-btfs-chunker => ../go-btfs-chunker.
  4. make test_go_test and make install to make sure go-btfs works as intended.

Then follow these PR guidelines:

  1. Make a PR in the bottom most module, which is go-btfs-chunker.
    • If the changing module has not been forked by TRON-US:
        1. Fork and add go-btfs team with write access.
        1. If forked code needs to be based on a specific release (other than master), branch off the desired tag and push to BTFS branch. Set BTFS as default branch in settings.
        1. Set up branch protection rules on master (and BTFS if needed).
        1. If the forked repo name contains ipfs, e.g., xxx-ipfs-yyy, rename to xxx-btfs-yyy.
        1. If the forked / existing repo is not public, ask TRON-US owner to change the visibility to public.
        1. After forking, submit PR to update LICENSE, README, go.mod top-level path, and imports (github.com/ipfs/xxx -> github.com/TRON-US/xxx).
        1. After merging, draft a new release with at least a minor version bump.
    • Make a PR with changes to go-btfs-chunker. Make sure replace lines are removed from go.mod and run go mod tidy.
  2. After approval and merge, draft a new release on go-btfs-chunker with at least a patch version bump (consult other team members about a minor or major version bump). For example, v1.2.3.
  3. Make a PR in the next level-up module, which is go-unixfs. Follow the same instructions as Step 1. Then modify go.mod to have github.com/TRON-US/go-btfs-chunker v1.2.3.
  4. After approval and merge, draft a new release on go-unixfs with at least a patch version bump (consult other team members about a minor or major version bump). For example, v4.5.6.
  5. Perform Steps 3-4 for all the modules up until go-btfs.
  6. Submit final go-btfs PR and fill out the description based on template: https://github.com/TRON-US/go-btfs/blob/master/.github/PULL_REQUEST_TEMPLATE.md
Clone this wiki locally