pull_requests.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. Guidelines for Contribution to Tripal
  2. ========================================
  3. The following guidelines are meant to encourage contribution to Tripal source-code on GitHub by making the process open, transparent and collaborative. If you have any feedback including suggestions for improvement or constructive criticism, please `comment on the Github issue <https://github.com/tripal/tripal/issues/344>`_. **These guidelines apply to everyone contributing to Tripal whether it's your first time (Welcome!) or project management committee members.**
  4. .. note::
  5. These guidelines are specifically for contributing to `Tripal <https://github.com/tripal/tripal>`_. However, we encourage all Tripal extension modules to consider following these guidelines to foster collaboration among the greater Tripal Community.
  6. .. note::
  7. Guidelines serve as suggestions ( **should** ) or requirements (**must**). When the word "should" is used in the text below, the stated policy is expected but there may be minor exceptions. When the word "must" is used there are no exceptions to the stated policy.
  8. Github Communication Tips
  9. ---------------------------
  10. - Don't be afraid to mention people (@username) who are knowledgeable on the topic or invested. *We are academics and overcommitted, it's too easy for issues to go unanswered: don't give up on us!*
  11. - Likewise, don't be shy about bumping an issue if no one responds after a few days. *Balancing responsibilities is hard.*
  12. - Want to get more involved? Issues marked with "Good beginner issue" are a good place to start if you want to try your hand at submitting a PR.
  13. - Everyone is encouraged/welcome to comment on the issue queue! Tell us if you
  14. - are experiencing the same problem
  15. - have tried a suggested fix
  16. - know of a potential solution or work-around
  17. - have an opinion, idea or feedback of any kind!
  18. - Be kind when interacting with others on Github! (see Code of Conduct below for further guidelines). We want to foster a welcoming, inclusive community!
  19. - Constructive criticism is welcome and encouraged but should be worded such that it is helpful :-) Direct criticism towards the idea or solution rather than the person and focus on alternatives or improvements.
  20. Bugs
  21. -----
  22. - Every bug **should** be reported as a Github issue.
  23. - Even if a bug is found by a committer who intends to fix it themselves immediately, they **should** create an issue and assign it to themselves to show their intent.
  24. - Please follow the issue templates as best you can. This information makes discussion easier and helps us resolve the problem faster.
  25. - Also provide as much information as possible :-) Screenshots or links to the issue on a development site can go a long way!
  26. - Bonus points for unit tests to ensure the bug does not return :-)
  27. Feature Requests
  28. ------------------
  29. - Every feature request should start as an issue so that discussion is encouraged :-)
  30. - Please provide the following information (bold is required; underlined strengthens your argument):
  31. - **Use Case:** fully describe why you need/want this feature
  32. - Generally Applicable: Why do you feel this is generally applicable? Suggest other use cases if possible. Mention (@) others that might want/need this feature.
  33. - Implementation: Describe a possible implementation. Bonus points for configuration, use of ontologies, ease of use, permission control, security considerations
  34. - All features **should** be optional so that Tripal admin can choose to make it available to their users.
  35. - When applicable, new features should be designed such that Tripal-site admin can disable them.
  36. - Bonus points: for making new features configurable and easily themed.
  37. - Feature requests will be voted on by the project management and advisory/steering committees to determine if it should be included in core, an existing extension module or it's own extension module.
  38. - Votes should be based on whether this feature is generally applicable and doesn't exclude existing users and not be biased by the needs of your own Tripal site.
  39. - If a feature isn't suitable for inclusion within Tripal core, use the issue discussion as a springboard to create a Tripal extension module!
  40. .. note::
  41. In the future there will be a set of guidelines for what should be included in core. This will make the process of requesting new features more streamlined, inclusive and transparent.
  42. Pull Request (PR) Guideline
  43. ----------------------------
  44. The goal of this document is to make it easy for **A)** contributors to make pull requests that will be accepted, and **B)** Tripal committers to determine if a pull request should be accepted.
  45. - PRs that address a specific issue **must** link to the related issue page.
  46. - In almost every case, there should be an issue for a PR. This allows feedback and discussion before the coding happens. Not grounds to reject, but encourage users to create issues at start of their PR. Better late than never :).
  47. - Each PR **must** be tested/approved by at least 1 contributor, if approved, a "trusted committer" will merge the PR.
  48. - Testers **should** describe how the testing was performed if applicable (allows others to replicate the test).
  49. - While Tripal's review body is small, the code review must be a thorough functional test.
  50. - At the Project Management Committee's (PMC) discretion, a PR may be subject to a non-functional review. Generally these are small and obvious commits.
  51. - Tripal's guiding philosophy is to encourage open contribution. With this in mind, committers should **work with contributors** to resolve issues in their PRs. PRs that will not be merged should be closed, **transparently citing** the reason for closure. In an ideal world, features that would be closed are discouraged at the **issue phase** before the code is written!
  52. - The pull request branch should be deleted after merging (if not from a forked repository) by the person who performs the merge.
  53. - PRs that include new functionality **must** also provide Unit Tests.
  54. - Tests **must** test the new functionality added.
  55. - Bonus points for testing all surrounding functionality.
  56. - For example, when adding feature X to custom tables, the PR must include tests for feature X and we would be greatly appreciative if it included tests for custom tables in general :-D.
  57. - PRs **should** pass all Travis-CI tests before they are merged.
  58. - Branches **should** follow the following format:
  59. - ``[issue\_number]-[tripal\_version]-[short\_description]``
  60. - ``tripal\_version`` being Tv2, Tv3, etc.
  61. - ``-[short\_description]`` being optional but highly encouraged
  62. - **Must** follow `Drupal code standards <https://www.drupal.org/docs/develop/standards>`_
  63. - PRs for new feature should remain open until adequately discussed (see guidelines below) and approved by a vote (all members of the PMC must vote in favour).
  64. .. note::
  65. If you need more instructions creating a pull request, see for example the `KnowPulse workflow <https://knowpulse.readthedocs.io/en/latest/developer_docs/dev_workflow.html#workflow>`_
  66. How PRs and Issues are Handled
  67. ------------------------------
  68. The Project Management Committee (PMC) and trusted committers will follow specific rules when working with all issues and pull requests. The rules are listed below. Anyone may provide bug fixes in which case some of the following will apply to all:
  69. - **Every task related to Tripal (bug, feature requests, documentation, discussions) should be in Github, either as it's own issue or grouped with like tasks into a single issue.** This effectively puts our todo list on github making it transparent to anyone who wants to help. It has the benefit of showing how active our community is, keeps everyone informed with where Tripal is headed and makes it easy for others to chime in with experience, comments and support.
  70. - **Guidelines for Tagging Issues:**
  71. - The first committer who comments on an issue should tag it with the version of Tripal it applies to.
  72. - Issues with a suggested fix or work-around should be tagged with "Fix Required" to let others know a PR is needed.
  73. - Only tag an issue with "bug" once it has been shown to be reproducible. If it's not reproducible by a committer but you feel it is a bug then tag it as "potential bug".
  74. - If multiple users have commented that a bug affects them, tag it as "affects multiple users".
  75. - Issues that require a PR and someone with relatively little Tripal experience could fix should be tagged with "Good beginner issue"
  76. - All feature requests should be tagged as an "enhancement"
  77. - If you are the first reviewer to confirm a PR works, tag it with "Reviewer #1 Approval"
  78. - **Guidelines for Discussion:**
  79. - Issues that do not require discussion (PRs still require 2 reviews): minor bug fixes, changes to inline comments, addition of unit tests, minor code typos
  80. - Issues that require discussion: major changes, new features, and issue at the discretion of the PMC
  81. - Add the "discussion" tag to any issue requiring discussion
  82. - Discussion Tag is removed when adequate discussion has taken place (at the discretion of the person who added the tag)
  83. - Additionally, new features require that all members of the PMC have had a chance to contribute to the discussion and feel satisfied.
  84. - Please use the **assignment** feature to clarify who will be contributing the code to prevent duplication of effort.
  85. - When assigning yourself, comment on what your timeline is. This allows others to jump in if they have time sooner.
  86. - If you would like to **take over a PR assigned to someone else** , comment asking for an update and offer your services.
  87. - If the author of the issue plans on contributing the fix themselves but is not a committer, they should indicate that in the issue. A committer will assign them the issue.
  88. - When you start working on an issue, you **should** create the branch and push to it regularly. If you are working on a fork, you're **encouraged** to link to it in the issue.
  89. - Committers can work on a fork or directly. If the branch is on tripal/tripal, then other committers should contribute via PR unless otherwise agreed
  90. - If an issue is identified as being relevant to another repository (ie a tripal module, not core), a new issue **should** be created, cross referenced, and the original issue should be closed encouraging discussion in the module.
  91. Code of Conduct
  92. ----------------
  93. - Be nice! If that's insufficient, Tripal community defers to https://www.contributor-covenant.org/
  94. Testing/CI
  95. ------------
  96. Comprehensive guides to testing are available in the :ref:`tests` section. Below are guiding principles.
  97. - All tests pass.
  98. - Tests don't modify db: use transactions and factories.
  99. - Tests are organized properly: by submodule and function.
  100. - Tests run quietly.