Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

133 linhas
8.0 KiB

há 4 anos
  1. # Contributor Guidelines
  2. (Please talk to people on the mailing list before you change this page, see our section on [how to get in touch](https://github.com/ether/etherpad-lite#get-in-touch))
  3. ## Pull requests
  4. * the commit series in the PR should be _linear_ (it **should not contain merge commits**). This is necessary because we want to be able to [bisect](https://en.wikipedia.org/wiki/Bisection_(software_engineering)) bugs easily. Rewrite history/perform a rebase if necessary
  5. * PRs should be issued against the **develop** branch: we never pull directly into **master**
  6. * PRs **should not have conflicts** with develop. If there are, please resolve them rebasing and force-pushing
  7. * when preparing your PR, please make sure that you have included the relevant **changes to the documentation** (preferably with usage examples)
  8. * contain meaningful and detailed **commit messages** in the form:
  9. ```
  10. submodule: description
  11. longer description of the change you have made, eventually mentioning the
  12. number of the issue that is being fixed, in the form: Fixes #someIssueNumber
  13. ```
  14. * if the PR is a **bug fix**:
  15. * the first commit in the series must be a test that shows the failure
  16. * subsequent commits will fix the bug and make the test pass
  17. * the final commit message should include the text `Fixes: #xxx` to link it to its bug report
  18. * think about stability: code has to be backwards compatible as much as possible. Always **assume your code will be run with an older version of the DB/config file**
  19. * if you want to remove a feature, **deprecate it instead**:
  20. * write an issue with your deprecation plan
  21. * output a `WARN` in the log informing that the feature is going to be removed
  22. * remove the feature in the next version
  23. * if you want to add a new feature, put it under a **feature flag**:
  24. * once the new feature has reached a minimal level of stability, do a PR for it, so it can be integrated early
  25. * expose a mechanism for enabling/disabling the feature
  26. * the new feature should be **disabled** by default. With the feature disabled, the code path should be exactly the same as before your contribution. This is a __necessary condition__ for early integration
  27. * think of the PR not as something that __you wrote__, but as something that __someone else is going to read__. The commit series in the PR should tell a novice developer the story of your thoughts when developing it
  28. ## How to write a bug report
  29. * Please be polite, we all are humans and problems can occur.
  30. * Please add as much information as possible, for example
  31. * client os(s) and version(s)
  32. * browser(s) and version(s), is the problem reproducible on different clients
  33. * special environments like firewalls or antivirus
  34. * host os and version
  35. * npm and nodejs version
  36. * Logfiles if available
  37. * steps to reproduce
  38. * what you expected to happen
  39. * what actually happened
  40. * Please format logfiles and code examples with markdown see github Markdown help below the issue textarea for more information.
  41. If you send logfiles, please set the loglevel switch DEBUG in your settings.json file:
  42. ```
  43. /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
  44. "loglevel": "DEBUG",
  45. ```
  46. The logfile location is defined in startup script or the log is directly shown in the commandline after you have started etherpad.
  47. ## General goals of Etherpad
  48. To make sure everybody is going in the same direction:
  49. * easy to install for admins and easy to use for people
  50. * easy to integrate into other apps, but also usable as standalone
  51. * lightweight and scalable
  52. * extensible, as much functionality should be extendable with plugins so changes don't have to be done in core.
  53. Also, keep it maintainable. We don't wanna end up as the monster Etherpad was!
  54. ## How to work with git?
  55. * Don't work in your master branch.
  56. * Make a new branch for every feature you're working on. (This ensures that you can work you can do lots of small, independent pull requests instead of one big one with complete different features)
  57. * Don't use the online edit function of github (this only creates ugly and not working commits!)
  58. * Try to make clean commits that are easy readable (including descriptive commit messages!)
  59. * Test before you push. Sounds easy, it isn't!
  60. * Don't check in stuff that gets generated during build or runtime
  61. * Make small pull requests that are easy to review but make sure they do add value by themselves / individually
  62. ## Coding style
  63. * Do write comments. (You don't have to comment every line, but if you come up with something that's a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are worthless!)
  64. * Never ever use tabs
  65. * Indentation: JS/CSS: 2 spaces; HTML: 4 spaces
  66. * Don't overengineer. Don't try to solve any possible problem in one step, but try to solve problems as easy as possible and improve the solution over time!
  67. * Do generalize sooner or later! (if an old solution, quickly hacked together, poses more problems than it solves today, refactor it!)
  68. * Keep it compatible. Do not introduce changes to the public API, db schema or configurations too lightly. Don't make incompatible changes without good reasons!
  69. * If you do make changes, document them! (see below)
  70. * Use protocol independent urls "//"
  71. ## Branching model / git workflow
  72. see git flow http://nvie.com/posts/a-successful-git-branching-model/
  73. ### `master` branch
  74. * the stable
  75. * This is the branch everyone should use for production stuff
  76. ### `develop`branch
  77. * everything that is READY to go into master at some point in time
  78. * This stuff is tested and ready to go out
  79. ### release branches
  80. * stuff that should go into master very soon
  81. * only bugfixes go into these (see http://nvie.com/posts/a-successful-git-branching-model/ for why)
  82. * we should not be blocking new features to develop, just because we feel that we should be releasing it to master soon. This is the situation that release branches solve/handle.
  83. ### hotfix branches
  84. * fixes for bugs in master
  85. ### feature branches (in your own repos)
  86. * these are the branches where you develop your features in
  87. * If it's ready to go out, it will be merged into develop
  88. Over the time we pull features from feature branches into the develop branch. Every month we pull from develop into master. Bugs in master get fixed in hotfix branches. These branches will get merged into master AND develop. There should never be commits in master that aren't in develop
  89. ## Documentation
  90. The docs are in the `doc/` folder in the git repository, so people can easily find the suitable docs for the current git revision.
  91. Documentation should be kept up-to-date. This means, whenever you add a new API method, add a new hook or change the database model, pack the relevant changes to the docs in the same pull request.
  92. You can build the docs e.g. produce html, using `make docs`. At some point in the future we will provide an online documentation. The current documentation in the github wiki should always reflect the state of `master` (!), since there are no docs in master, yet.
  93. ## Testing
  94. Front-end tests are found in the `tests/frontend/` folder in the repository. Run them by pointing your browser to `<yourdomainhere>/tests/frontend`.
  95. Back-end tests can be run from the `src` directory, via `npm test`.
  96. ## Things you can help with
  97. Etherpad is much more than software. So if you aren't a developer then worry not, there is still a LOT you can do! A big part of what we do is community engagement. You can help in the following ways
  98. * Triage bugs (applying labels) and confirming their existence
  99. * Testing fixes (simply applying them and seeing if it fixes your issue or not) - Some git experience required
  100. * Notifying large site admins of new releases
  101. * Writing Changelogs for releases
  102. * Creating Windows packages
  103. * Creating releases
  104. * Bumping dependencies periodically and checking they don't break anything
  105. * Write proposals for grants
  106. * Co-Author and Publish CVEs
  107. * Work with SFC to maintain legal side of project
  108. * Maintain TODO page - https://github.com/ether/etherpad-lite/wiki/TODO#IMPORTANT_TODOS