blob: 4667f0711dc08515d14974fdcac970c9d2aab883 [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
Javier Almansa Sobrino6166c032022-11-10 14:24:03 +000073- Assuming the clone of the repo has been done as mentioned in the
74 :ref:`getting_started_get_source` and *origin* refers to the upstream repo,
75 submit your changes for review targeting the ``integration`` branch.
76 Create a topic that describes the target of your changes to help group
77 related patches together.
Soby Mathewb4c6df42022-11-09 11:13:29 +000078
79 .. code::
80
81 git push origin HEAD:refs/for/integration [-o topic=<your_topic>]
82
83 Refer to the `Gerrit Uploading Changes documentation`_ for more details.
84
85- Add reviewers for your patch:
86
87 - At least one maintainer. See the list of :ref:`maintainers`.
88
89 - Alternatively, you might send an email to the `TF-RMM mailing list`_
90 to broadcast your review request to the community.
91
92- The changes will then undergo further review by the designated people. Any
93 review comments will be made directly on your patch. This may require you to
94 do some rework. For controversial changes, the discussion might be moved to
95 the `TF-RMM mailing list`_ to involve more of the community.
96
97- The patch submission rules are the following. For a patch to be approved
98 and merged in the tree, it must get a ``Code-Review+2``.
99
100 In addition to that, the patch must also get a ``Verified+1``. This is
101 usually set by the Continuous Integration (CI) bot when all automated tests
102 passed on the patch. Sometimes, some of these automated tests may fail for
103 reasons unrelated to the patch. In this case, the maintainers might
104 (after analysis of the failures) override the CI bot score to certify that
105 the patch has been correctly tested.
106
107 In the event where the CI system lacks proper tests for a patch, the patch
108 author or a reviewer might agree to perform additional manual tests
109 in their review and the reviewer incorporates the review of the additional
110 testing in the ``Code-Review+1`` to attest that the patch works as expected.
111
112- When the changes are accepted, the :ref:`maintainers` will integrate them.
113
114 - Typically, the :ref:`maintainers` will merge the changes into the
115 ``integration`` branch.
116
117 - If the changes are not based on a sufficiently-recent commit, or if they
118 cannot be automatically rebased, then the :ref:`maintainers` may rebase it
119 on the ``integration`` branch or ask you to do so.
120
121 - After final integration testing, the changes will make their way into the
122 ``main`` branch. If a problem is found during integration, the
123 :ref:`maintainers` will request your help to solve the issue. They may
124 revert your patches and ask you to resubmit a reworked version of them or
125 they may ask you to provide a fix-up patch.
126
127.. _copyright-license-guidance:
128
129License and Copyright for Contributions
130=======================================
131
132All new files should include the BSD-3-Clause SPDX license identifier
133where possible. When contributing code to us, the committer and all authors
134are required to make the submission under the terms of the
135:ref:`Developer Certificate of Origin`, confirming that the code submitted can
136(legally) become part of the project, and be subject to the same BSD-3-Clause
137license. This is done by including the standard Git ``Signed-off-by:``
138line in every commit message. If more than one person contributed to the
139commit, they should also add their own ``Signed-off-by:`` line.
140
141Files that entirely consist of contributions to this project should
142have a copyright notice and BSD-3-Clause SPDX license identifier of
143the form :
144
145.. code::
146
147 SPDX-License-Identifier: BSD-3-Clause
148 SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
149
150Patches that contain changes to imported Third Party IP files should retain
151their original copyright and license notices. If changes are made to the
152imported files, then add an additional ``SPDX-FileCopyrightText`` tag line
153as shown above.
154
155--------------
156
157.. _review.trustedfirmware.org: https://review.trustedfirmware.org
158.. _RMM: https://git.trustedfirmware.org/TF-RMM/tf-rmm.git
159.. _Git guidelines: http://git-scm.com/book/ch5-2.html
160.. _Gerrit Uploading Changes documentation: https://review.trustedfirmware.org/Documentation/user-upload.html
161.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io
162.. _TF-RMM mailing list: https://lists.trustedfirmware.org/mailman3/lists/tf-rmm.lists.trustedfirmware.org/