Advertisement
AtomicOs

CONTRIBUTING.md

May 28th, 2021
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.71 KB | None | 0 0
  1. # Contribution guidelines
  2.  
  3. Table of contents
  4. - [How can you contribute?](#how-can-you-contribute)
  5. - [Help triage issues](#help-triage-issues)
  6. - [Updating documentation](#updating-documentation)
  7. - [Help with translations](#help-with-translations)
  8. - [Work on the code](#work-on-the-code)
  9. - [Getting started](#getting-started)
  10. - [Making changes](#making-changes)
  11. - [Pull requests](#pull-requests)
  12. - [Considerations before submitting a pull request](#considerations-before-submitting-a-pull-request)
  13. - [Each pull request should include](#each-pull-request-should-include)
  14. - [Employees should](#employees-should)
  15. - [Closing issues](#closing-issues)
  16. - [Triage help](#triage-help)
  17.  
  18. ## How can you contribute?
  19. Brave welcomes contributions of all kinds! You can make a huge impact without writing a single line of code
  20.  
  21. ### Help triage issues
  22. One of the easiest ways to help is to [look through our issues tab](https://github.com/brave/brave-browser/issues)
  23. * Does the issue still happen? Sometimes we fix the problem and don't always close the issue
  24. * Are there clear steps to reproduce the issue? If not, let's find and document some
  25. * Is the issue a duplicate? If so, share the issue that is being duplicated in the conversation
  26. * See our [Triage Guidelines page](https://github.com/brave/brave-browser/wiki/Triage-Guidelines) for more info about this process
  27. * Making sure issues that are fixed have the appropriate milestone set. There may be pull requests fixing the bug on the different product channels and sometimes the issues are forgotten about (and aren't updated)
  28.  
  29. ### Updating documentation
  30. Documentation is extremely important. There are lots of areas we can improve:
  31. * Having more clear or up-to-date instructions in the README for both [`brave-browser`](https://github.com/brave/brave-browser/blob/master/README.md) and [`brave-core`](https://github.com/brave/brave-core/blob/master/README.md).
  32. * Capturing/updating helpful information [in our wiki](https://github.com/brave/brave-browser/wiki). You'll need to reach out to a Brave team member to request permission - you can do this by creating a new issue or tagging a Brave team member in an existing issue.
  33. * Helping to propose a way to bring documentation to other languages. Right now, everything is in English
  34. * Improving this document :smile:
  35.  
  36. ### Help with translations
  37. All text being added to Brave is done initially in English (en-US) and then is translated by real people into other languages.
  38. We're missing translations for many languages and some translations might be incomplete or poor quality.
  39.  
  40. For everything you'd need to get started, check out https://www.transifex.com/brave/brave/ :smile:
  41.  
  42. ### Work on the code
  43. * The [repo's wiki](https://github.com/brave/brave-browser/wiki) has instructions for cloning the repo and getting setup on your platform of choice
  44. * Check out the [troubleshooting page](https://github.com/brave/brave-browser/wiki/Troubleshooting) if you get stuck
  45. * Once you're up and running, find an interesting issue to fix. Check out issues labelled with [good first issue](https://github.com/brave/brave-browser/labels/good%20first%20issue)
  46. - some issues only require knowledge of JavaScript (for example, pages using React and our [Brave UI library](https://github.com/brave/brave-ui))
  47. - other issues may require C++ changes in either the Brave code or in Chromium
  48.  
  49. ## Getting started
  50. * Make sure you have a [GitHub account](https://github.com/join).
  51. * Submit a [ticket](https://github.com/brave/brave-browser/issues) for your issue if one does not already exist. Please include the Brave version, operating system, and steps to reproduce the issue.
  52. * Fork the repository on GitHub (this might be [`brave-browser`](https://github.com/brave/brave-browser), [`brave-core`](https://github.com/brave/brave-core), or both).
  53. * For changes to JavaScript files, we recommend installing a [Standard](http://standardjs.com/) plugin for your preferred text editor in order to ensure code style consistency.
  54. * For C++ changes, you can consider setting up [clang-format](https://chromium.googlesource.com/chromium/src/+/master/docs/sublime_ide.md#Format-Selection-with-Clang_Format-Chromium-only) for your editor.
  55. * For changes which involve patches, please check out our [Patching Chromium](https://github.com/brave/brave-browser/wiki/Patching-Chromium) guide.
  56.  
  57. ### Making changes
  58. Once you've cloned the repo to your computer, you're ready to start making edits!
  59.  
  60. Please note that there are two repositories here:
  61. * the root project (this repo, [`brave-browser`](https://github.com/brave/brave-browser)), which pulls down all of the Chromium code into `src/`
  62. * [`brave-core`](https://github.com/brave/brave-core) is basically a sub-module (repo in a repo) which is located on disk under the root at `src/brave`
  63.  
  64. Depending on which you're editing, you'll need to add your fork to the remotes list. By default, `origin` is set to upstream.
  65. For example, here's how GitHub user `bsclifton` would add BOTH remotes `brave-browser` and `brave-core`:
  66. ```sh
  67. # root where project is cloned
  68. cd ~/brave-browser/
  69. git remote add bsclifton git@github.com:bsclifton/brave-browser.git
  70. git fetch bsclifton
  71. # root for the `brave-core` repo
  72. cd src/brave
  73. git remote add bsclifton git@github.com:bsclifton/brave-core.git
  74. git fetch bsclifton
  75. ```
  76.  
  77. Once you're setup, there's a few tips we can suggest:
  78.  
  79. * Make a new branch for your work. It helps to have a descriptive name, like `fix-fullscreen-issue`.
  80. * Make commits in logical units. If needed, run `git rebase -i` to squash commits before opening a pull request.
  81. * New features and most other pull requests require a new [test](https://github.com/brave/brave-browser/wiki/Tests) to be written before the pull request will be accepted. Some exceptions would be a tweak to an area of code that doesn't have tests yet, text changes, build config changes, things that can't be tested due to test suite limitations, etc.
  82. * Use GitHub [auto-closing keywords](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message, and make the commit message body as descriptive as necessary. Ex:
  83.  
  84. ````
  85. Add contributing guide
  86.  
  87. This is a first pass at a contributor's guide so now people will know how to
  88. get pull requests accepted faster.
  89.  
  90. Fix https://github.com/brave/brave-browser/issues/108
  91. ````
  92.  
  93. * Run the tests by running `npm run test brave_unit_tests` and `npm run test brave_browser_tests`
  94. * JavaScript unit tests can be ran from the `src/brave` directory using `npm run test-unit`
  95.  
  96.  
  97. ### Keeping your fork up to sync
  98. - Both `brave-browser` and `brave-core` clone themselves with the remote `origin` being upstream, so you can update either using `git pull`.
  99. - Once `origin` is fetched, you can rebase your `master` branch against `origin/master`
  100. ```sh
  101. git fetch origin
  102. git fetch bsclifton
  103. git checkout -b fork_master bsclifton/master
  104. git rebase origin/master
  105. git push bsclifton fork_master:master
  106. ```
  107.  
  108. An easier strategy might be to keep `origin` in sync and then create branches based on that (and push those to your fork).
  109.  
  110.  
  111. ### Pull requests
  112. After the changes are made in your branch, you're ready to submit a patch. Patches on GitHub are submitted in the format of a pull request.
  113.  
  114. #### Considerations before submitting a pull request
  115. Some helpful things to consider before submitting your work
  116. * Did you manually test your new change?
  117. * Does your pull request fix multiple issues? If so, you may consider breaking into separate pull requests.
  118. * Did you include tests? (we currently have unit tests, browser tests, and JavaScript unit tests)
  119. * If you made a design or layout change, was there a mock-up provided? Do your changes match it?
  120. * If your change affects session or preferences, did you include steps to test? You may also consider manually testing an upgrade.
  121.  
  122. #### Each pull request should include
  123. * a descriptive title; this gets used in the release notes ([desktop](https://github.com/brave/brave-browser/blob/master/CHANGELOG_DESKTOP.md) or [android](https://github.com/brave/brave-browser/blob/master/CHANGELOG_ANDROID.md))
  124. * a short summary of the changes
  125. * a reference to the issue that it fixes
  126. * steps to test the fix (if applicable)
  127. * for design-related changes, it is helpful to include screenshots
  128.  
  129. Once you submit a pull request, you should tag reviewers and add labels if needed. If you do not have the necessary GitHub permissions to do so, a Brave member will take care of this for you.
  130.  
  131. #### Employees should
  132. * Ensure the owner is tagged using the `Assignees` field
  133. * Ensure at least one other employee or contributor is tagged using the `Reviewers` field
  134. * Go through the checklist that's provided in the pull request template and check the appropriate boxes
  135.  
  136. ### Closing issues
  137.  
  138. * Issues should be assigned the milestone when the PR is merged (and the fix is landed in Nightly aka master).
  139. * Some issues may need to be uplifted to other channels (Dev / Beta / Release). Please see our notes on [uplifting a pull request](https://github.com/brave/brave-browser/wiki/Uplifting-a-pull-request).
  140. * If an issue is closed without a fix, because it was a duplicate, or perhaps it was invalid, then any milestone markers should be removed.
  141. * If a bug is not fully fixed after its issue is closed, open a new issue instead of re-opening the existing one (unless the code has been reverted).
  142.  
  143. ### Triage help
  144.  
  145. * Invalid bugs should be closed, tagged with invalid, or a comment should be added indicating that they should if you do not have permission.
  146. * Asking for more detail in an issue when it is needed is helpful.
  147. * Adding applicable labels to an issue is helpful.
  148. * Adding and finding duplicates, and linking them together is helpful.
  149. * Creating tracking issues for an area of work with multiple related issues is helpful.
  150. * Calling out things which seem important for extra attention is helpful.
  151. * Improving steps to reproduce is helpful.
  152. * Testing and adding a comment with "Could not reproduce" if an issue seems obscure is helpful.
  153. * Testing open pull requests.
  154. * You can be granted write permission if you've helped a lot with triage by pinging @bbondy, @bsclifton, @kjozwiak, or another Brave team member.
  155. * Helping make sure issues have a clear and understandable name (ex: not something like "Brave is broken").
  156. * The first comment in an issue ideally would have a clear description of the issue and describe the impact to users. Asking folks for screenshots, steps to reproduce, and more information is highly recommended so that the issue is as clear as possible.
  157. * If the issue is a duplicate, please let the issue creator know in a polite way how they can follow and track progress of the parent issue (including an ETA if it's marked with a milestone).
  158.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement