You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.3 KiB

  1. # Contributing to Blubber
  2. `blubber` is an open source project maintained by Wikimedia Foundation's
  3. Release Engineering Team and developed primarily to support a continuous
  4. delivery pipeline for MediaWiki and related applications. We will, however,
  5. consider any contribution that advances the project in a way that is valuable
  6. to both users inside and outside of WMF and our communities.
  7. ## Requirements
  8. 1. `go` >= 1.11 (>=1.12 recommended) and related tools
  9. * To install on rpm style systems: `sudo dnf install golang golang-godoc`
  10. * To install on apt style systems: `sudo apt install golang golang-golang-x-tools`
  11. * To install on macOS use [Homebrew](https://brew.sh) and run:
  12. `brew install go`
  13. * You can run `go version` to check the golang version.
  14. * If your distro's go package is too old or unavailable,
  15. [download](https://golang.org/dl/) a newer golang version.
  16. 2. `dep` for dependency management
  17. * On macOS, try Homebrew: `brew install dep`
  18. * [Other](https://golang.github.io/dep/docs/installation.html)
  19. 3. An account at [gerrit.wikimedia.org](https://gerrit.wikimedia.org)
  20. * See the [guide](https://www.mediawiki.org/wiki/Gerrit/Getting_started)
  21. on mediawiki.org for setup instructions.
  22. 4. (optional) `gox` is used for cross-compiling binary releases. To
  23. install `gox` use `go get github.com/mitchellh/gox`.
  24. ## Get the source
  25. Use `go get` to install the source from our Git repo into `src` under your
  26. `GOPATH`. By default, this will be `~/go/src`.
  27. go get gerrit.wikimedia.org/r/blubber
  28. Symlink it to a different directory if you'd prefer not to work from your
  29. `GOPATH`. For example:
  30. cd ~/Projects
  31. ln -s ~/go/src/gerrit.wikimedia.org/r/blubber
  32. cd blubber # yay.
  33. ## Have a read through the documentation
  34. If you haven't already seen the [README.md](README.md), check it out.
  35. Run `godoc -http :9999` and peruse the HTML generated from inline docs
  36. at `localhost:9999/pkg/gerrit.wikimedia.org/r/blubber`.
  37. ## Installing or updating dependencies
  38. Dealing with Go project dependencies is kind of a moving target at the moment,
  39. but for now we've opted to commit a minimal `vendor` directory which contains
  40. all the required packages. It has been automatically populated by `dep
  41. ensure` according to our `Gopkg.toml` and `Gopkg.lock` files.
  42. If you're not making any changes to `Gopkg.toml`, adding, updating, or
  43. removing dependencies, you should already be good to go.
  44. If you do update `Gopkg.toml` to add, update, or remove a dependency, simply
  45. run `dep ensure` after doing so, and commit the resulting
  46. `vendor` directory changes.
  47. ## Running tests and linters
  48. Tests and linters for packages/files you've changed will automatically run
  49. when you submit your changes to Gerrit for review. You can also run them
  50. locally using the `Makefile`:
  51. make lint # to run all linters
  52. make unit # or all unit tests
  53. make test # or all linters and unit tests
  54. go test -run TestFuncName ./... # to run a single test function
  55. ## Getting your changes reviewed and merged
  56. Push your changes to Gerrit for review. See the
  57. [guide](https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch)
  58. on mediawiki.org on how to correctly prepare and submit a patch.
  59. ## Releases
  60. The `release` target of the `Makefile` in this repository uses `gox` to
  61. cross-compile binary releases of Blubber.
  62. make release