blob: 0bd50e9782402824b588bf189d978ef8ed4a0081 [file] [log] [blame]
David Hu7fb5b532022-01-29 22:52:18 +08001#########################
2Design proposal guideline
3#########################
4
5**********
6Background
7**********
8
9The existing TF-M design proposal process [1]_ requires developers to upstream a
10formal design document in reStructuredText format to describe their design.
11That process further defines a 2-stage review process to review and approve the
12design document. That process ensures that critical designs are thoroughly
13reviewed by key reviewers, especially when TF-M was built up from scratch.
14
15Currently, since more and more developers are contributing to TF-M community
16with new requirements and features, the existing process sometimes becomes
17heavyweight for contributors and reviewers.
18
19 - It is an additional effort for contributors to get familiar with
20 reStructuredText syntax and complete the document with reStructuredText
21 coding.
22 - The whole review process may take a long time. It is required that design
23 document shall be approved before code review starts. However, reviews of
24 design document details and implementation details sometimes can be combined
25 from the point of view of reviewers.
26 - The approved design document might be frequently updated during later code
27 review. The changes to design documents require review and approval again.
28
29Furthermore, it also brings some maintenance difficulties.
30
31 - When implementation in code is changed, in theory, it is unnecessary to
32 update the corresponding design document since it is a pure design proposal
33 instead of a user guide.
34 However, it is confusing if design document doesn't align with the
35 implementation.
36 - If the implementation is deprecated or the design document is out of date,
37 there is no guideline yet to discuss whether or how the design document
38 shall be deprecated as well or archived.
39
40TF-M design proposal process shall be simplified to speed up contribution,
41review and maintenance stages.
42
43*************
44New guideline
45*************
46
47The steps in the new design proposal guideline are lightweight and flexible to
48make sure that contributors can focus more on actual code implementation and
49iteration.
50
51The guideline encourages developers to share design proposal via
52TF-M mailing list [2]_ and TF-M technical forum (tech forum) [3]_.
53The design details can be discussed via code reviews of actual implementations.
54
55Typical steps are shown as the diagram below.
56
57.. uml::
58
59 @startuml
60
61 title Design proposal process
62
63 [*] --> propose : Non-trivial changes
64
65 state "Propose general ideas" as propose {
66 state "TF-M mailing list" as mail_list : Contributors send emails to mailing list\nto describe the design.
67 state "TF-M tech forum" as tech_forum : Contributors present the design\nin tech forum.
68
69 [*] --> mail_list
70 [*] --> tech_forum
71 }
72
73 note bottom of propose : Optional but strongly recommended
74
75 [*] --> upload
76 note right of upload : No prerequisites
77 propose --> upload
78
79 state "Upstream changes" as upload : Contributors upstream code patch\nand integration guide to gerrit.
80 state "Code review" as review : Reviewer review changes of\ncode and documents.\nChanges pass verifications.
81 state "Broadcast patches" as broadcast : Contributors ask for review\nin mailing list.
82 state "Approve and merge" as approve : Code owners approve changes.\nMaintainers merge patches.
83
84 upload --> broadcast : Optional
85 upload --> review
86
87 broadcast --> review
88 review --> review : Update implementation
89 review --> approve
90 approve --> [*]
91
92 @enduml
93
94Discussion in TF-M mailing list and tech forum
95==============================================
96
97It is **highly recommended** to propose and discuss designs in TF-M mailing list
98or TF-M tech forum, before or while the code implementation is under review.
99
100It is efficient and flexible to directly discuss design proposal via TF-M
101mailing list and TF-M tech forum. Contributors can receive quick and broad
102feedback from TF-M community.
103
104Although it is optional to present the ideas in mailing list or tech forum, it
105will help reviewers understand the design much better and expedite the code
106review process.
107
108Code review of details
109======================
110
111It is straightforward and convenient for contributors and reviewers to
112deliberate over design and implementation details via code review.
113
114Contributors can implement their design proposal and upstream the patch set to
115TF-M gerrit [4]_ for code review.
116For non-trivial changes or new major features, it is **strongly suggested** to
117propose the design to TF-M mailing list and tech forum in advance.
118
119Contributors don't have to wait for any approvals before upstreaming patches,
120even if the changes are non-trivial.
121No formal design document in advance is required anymore.
122
123The review process is the same as the general one [5]_, with some specific
124requirements:
125
126 - Contributors can send an email to TF-M mailing list to ask for review.
127 - If it requires additional reviewers besides code owners and maintainers,
128 contributors shall add the specific reviewers in the review list.
129 - Authors shall clearly specify the design purpose and briefly describe the
130 implementation in the commit message.
131 - Authors shall put essential comments and notes in code for the code changes.
132
133Code owners and maintainers may require contributors to further verify the
134implementation besides normal per-patch CI test. Contributors shall provide the
135verification results as requested.
136
137Integration guide and manual
138============================
139
140Contributors can create an integration guide or a user manual to describe how to
141integrate the new features related to the design proposal.
142
143Contributors shall update the corresponding documents if the design changes
144existing implementation.
145
146*********
147Reference
148*********
149
150.. [1] :doc:`Design proposal process </docs/contributing/tfm_design_proposal_process>`
151
152.. [2] `TF-M mailing list <https://lists.trustedfirmware.org/mailman3/lists/tf-m.lists.trustedfirmware.org/>`_
153
154.. [3] `TF-M technical forum <https://www.trustedfirmware.org/meetings/tf-m-technical-forum/>`_
155
156.. [4] `TF-M gerrit <https://review.trustedfirmware.org/q/project:TF-M/trusted-firmware-m>`_
157
158.. [5] :doc:`Contributing process </docs/contributing/contributing_process>`
159
160-------------------
161
162*Copyright (c) 2022, Arm Limited. All rights reserved.*