David Hu | 7fb5b53 | 2022-01-29 22:52:18 +0800 | [diff] [blame^] | 1 | ######################### |
| 2 | Design proposal guideline |
| 3 | ######################### |
| 4 | |
| 5 | ********** |
| 6 | Background |
| 7 | ********** |
| 8 | |
| 9 | The existing TF-M design proposal process [1]_ requires developers to upstream a |
| 10 | formal design document in reStructuredText format to describe their design. |
| 11 | That process further defines a 2-stage review process to review and approve the |
| 12 | design document. That process ensures that critical designs are thoroughly |
| 13 | reviewed by key reviewers, especially when TF-M was built up from scratch. |
| 14 | |
| 15 | Currently, since more and more developers are contributing to TF-M community |
| 16 | with new requirements and features, the existing process sometimes becomes |
| 17 | heavyweight 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 | |
| 29 | Furthermore, 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 | |
| 40 | TF-M design proposal process shall be simplified to speed up contribution, |
| 41 | review and maintenance stages. |
| 42 | |
| 43 | ************* |
| 44 | New guideline |
| 45 | ************* |
| 46 | |
| 47 | The steps in the new design proposal guideline are lightweight and flexible to |
| 48 | make sure that contributors can focus more on actual code implementation and |
| 49 | iteration. |
| 50 | |
| 51 | The guideline encourages developers to share design proposal via |
| 52 | TF-M mailing list [2]_ and TF-M technical forum (tech forum) [3]_. |
| 53 | The design details can be discussed via code reviews of actual implementations. |
| 54 | |
| 55 | Typical 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 | |
| 94 | Discussion in TF-M mailing list and tech forum |
| 95 | ============================================== |
| 96 | |
| 97 | It is **highly recommended** to propose and discuss designs in TF-M mailing list |
| 98 | or TF-M tech forum, before or while the code implementation is under review. |
| 99 | |
| 100 | It is efficient and flexible to directly discuss design proposal via TF-M |
| 101 | mailing list and TF-M tech forum. Contributors can receive quick and broad |
| 102 | feedback from TF-M community. |
| 103 | |
| 104 | Although it is optional to present the ideas in mailing list or tech forum, it |
| 105 | will help reviewers understand the design much better and expedite the code |
| 106 | review process. |
| 107 | |
| 108 | Code review of details |
| 109 | ====================== |
| 110 | |
| 111 | It is straightforward and convenient for contributors and reviewers to |
| 112 | deliberate over design and implementation details via code review. |
| 113 | |
| 114 | Contributors can implement their design proposal and upstream the patch set to |
| 115 | TF-M gerrit [4]_ for code review. |
| 116 | For non-trivial changes or new major features, it is **strongly suggested** to |
| 117 | propose the design to TF-M mailing list and tech forum in advance. |
| 118 | |
| 119 | Contributors don't have to wait for any approvals before upstreaming patches, |
| 120 | even if the changes are non-trivial. |
| 121 | No formal design document in advance is required anymore. |
| 122 | |
| 123 | The review process is the same as the general one [5]_, with some specific |
| 124 | requirements: |
| 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 | |
| 133 | Code owners and maintainers may require contributors to further verify the |
| 134 | implementation besides normal per-patch CI test. Contributors shall provide the |
| 135 | verification results as requested. |
| 136 | |
| 137 | Integration guide and manual |
| 138 | ============================ |
| 139 | |
| 140 | Contributors can create an integration guide or a user manual to describe how to |
| 141 | integrate the new features related to the design proposal. |
| 142 | |
| 143 | Contributors shall update the corresponding documents if the design changes |
| 144 | existing implementation. |
| 145 | |
| 146 | ********* |
| 147 | Reference |
| 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.* |