blob: febcbd34826dae12fc694a505810a7196b00f1ee [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001.. SPDX-License-Identifier: BSD-3-Clause
2.. SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
3
4*******************
5Contributor's Guide
6*******************
7
8Getting Started
9===============
10
11- Make sure you have a Github account and you are logged on
12 `review.trustedfirmware.org`_.
13
14- Clone `RMM`_ on your own machine as described in
15 :ref:`getting_started_get_source`.
16
17- If you plan to contribute a major piece of work, it is usually a good idea to
18 start a discussion around it on the mailing list. This gives everyone
19 visibility of what is coming up, you might learn that somebody else is
20 already working on something similar or the community might be able to
21 provide some early input to help shaping the design of the feature.
22
23- If you intend to include Third Party IP in your contribution, please mention
24 it explicitly in the email thread and ensure that the changes that include
25 Third Party IP are made in a separate patch (or patch series).
26
27- Create a local topic branch based on the `RMM`_ ``main`` branch.
28
29Making Changes
30==============
31
32- See the `License and Copyright for Contributions`_ section for guidance
33 on license and copyright.
34
35- Ensure commits adhere to the project's :ref:`Commit Style`.
36
37- Make commits of logical units. See these general `Git guidelines`_ for
38 contributing to a project.
39
40- Keep the commits on topic. If you need to fix another bug or make another
41 enhancement, please address it on a separate topic branch.
42
43- Split the patch into manageable units. Small patches are usually easier to
44 review so this will speed up the review process.
45
46- Avoid long commit series. If you do have a long series, consider whether
47 some commits should be squashed together or addressed in a separate topic.
48
49- Follow the :ref:`Coding Standard`.
50
51 - Use the static checks as shown in :ref:`build_options_examples` to perform
52 checks like checkpatch, checkspdx, header files include order etc.
53
54- Where appropriate, please update the documentation.
55
56 - Consider whether the :ref:`Design` document or other in-source
57 documentation needs updating.
58
59- Ensure that each patch in the patch series compiles in all supported
60 configurations. For generic changes, such as on the libraries, The
61 :ref:`RMM Fake host architecture` should be able to, at least,
62 build. Patches which do not compile will not be merged.
63
64- Please test your changes and add suitable tests in the available test
65 frameworks for any new functionality.
66
67- Ensure that all CI automated tests pass. Failures should be fixed. They
68 might block a patch, depending on how critical they are.
69
70Submitting Changes
71==================
72
73- Submit your changes for review at https://review.trustedfirmware.org
74 targeting the ``integration`` branch. Create a topic that describes
75 the target of your changes to help group related patches together.
76
77 .. code::
78
79 git push origin HEAD:refs/for/integration [-o topic=<your_topic>]
80
81 Refer to the `Gerrit Uploading Changes documentation`_ for more details.
82
83- Add reviewers for your patch:
84
85 - At least one maintainer. See the list of :ref:`maintainers`.
86
87 - Alternatively, you might send an email to the `TF-RMM mailing list`_
88 to broadcast your review request to the community.
89
90- The changes will then undergo further review by the designated people. Any
91 review comments will be made directly on your patch. This may require you to
92 do some rework. For controversial changes, the discussion might be moved to
93 the `TF-RMM mailing list`_ to involve more of the community.
94
95- The patch submission rules are the following. For a patch to be approved
96 and merged in the tree, it must get a ``Code-Review+2``.
97
98 In addition to that, the patch must also get a ``Verified+1``. This is
99 usually set by the Continuous Integration (CI) bot when all automated tests
100 passed on the patch. Sometimes, some of these automated tests may fail for
101 reasons unrelated to the patch. In this case, the maintainers might
102 (after analysis of the failures) override the CI bot score to certify that
103 the patch has been correctly tested.
104
105 In the event where the CI system lacks proper tests for a patch, the patch
106 author or a reviewer might agree to perform additional manual tests
107 in their review and the reviewer incorporates the review of the additional
108 testing in the ``Code-Review+1`` to attest that the patch works as expected.
109
110- When the changes are accepted, the :ref:`maintainers` will integrate them.
111
112 - Typically, the :ref:`maintainers` will merge the changes into the
113 ``integration`` branch.
114
115 - If the changes are not based on a sufficiently-recent commit, or if they
116 cannot be automatically rebased, then the :ref:`maintainers` may rebase it
117 on the ``integration`` branch or ask you to do so.
118
119 - After final integration testing, the changes will make their way into the
120 ``main`` branch. If a problem is found during integration, the
121 :ref:`maintainers` will request your help to solve the issue. They may
122 revert your patches and ask you to resubmit a reworked version of them or
123 they may ask you to provide a fix-up patch.
124
125.. _copyright-license-guidance:
126
127License and Copyright for Contributions
128=======================================
129
130All new files should include the BSD-3-Clause SPDX license identifier
131where possible. When contributing code to us, the committer and all authors
132are required to make the submission under the terms of the
133:ref:`Developer Certificate of Origin`, confirming that the code submitted can
134(legally) become part of the project, and be subject to the same BSD-3-Clause
135license. This is done by including the standard Git ``Signed-off-by:``
136line in every commit message. If more than one person contributed to the
137commit, they should also add their own ``Signed-off-by:`` line.
138
139Files that entirely consist of contributions to this project should
140have a copyright notice and BSD-3-Clause SPDX license identifier of
141the form :
142
143.. code::
144
145 SPDX-License-Identifier: BSD-3-Clause
146 SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
147
148Patches that contain changes to imported Third Party IP files should retain
149their original copyright and license notices. If changes are made to the
150imported files, then add an additional ``SPDX-FileCopyrightText`` tag line
151as shown above.
152
153--------------
154
155.. _review.trustedfirmware.org: https://review.trustedfirmware.org
156.. _RMM: https://git.trustedfirmware.org/TF-RMM/tf-rmm.git
157.. _Git guidelines: http://git-scm.com/book/ch5-2.html
158.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html
159.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io
160.. _TF-RMM mailing list: https://lists.trustedfirmware.org/mailman3/lists/tf-rmm.lists.trustedfirmware.org/