LS bug process: Comment on branch names
[libreriscv.git] / HDL_workflow / libresoc_bug_process.mdwn
1 [[!toc ]]
2
3 ---
4
5 # LibreSOC Bug Process
6
7 * [Bug #1126](https://bugs.libre-soc.org/show_bug.cgi?id=1126)
8
9 * HDL workflow guide page: [[HDL_workflow]]
10
11 This page describes in detail how to raise new tasks (bugs) and how to approach
12 development within the project in order to get appropriate amount of funding
13 for the tasks completed.
14
15 # Why raise issues
16
17 * [Bug #1126](https://bugs.libre-soc.org/show_bug.cgi?id=1126)
18
19 If you have discovered a problem in Libre-SOC (software, hardware, etc.),
20 please raise a bug report!
21 Bug reports allow tracking of issues, both to make the developers lives easier,
22 as well as for tracking completed grant-funded work.
23
24 It is **extremely** important to link the new bug to previous ones. As Luke
25 mentioned on [this bug](https://bugs.libre-soc.org/show_bug.cgi?id=1139#c3),
26 "it is a mandatory project requirement that the graph from any bug
27 contain all other bugs (one "Group")".
28
29 The primary reason for this is to ensure bugs don't get buried and lost,
30 and will aid those tackling similar problems at a later time.
31
32 Also, for project management and financing purposes, it helps developers
33 to keep an up-to-date list of their tasks.
34
35 ##How to raise issues
36
37 1. Create a bug report.
38 2. Add in any links from the mailing list or IRC logs to the bug report for
39 back tracking (this is mandatory). Also fill in the URL field if there is a
40 relevant wiki page.
41 3. CC in relevant team members
42 4. Make absolutely sure to fill in "blocks", "depends on" or "see also" so
43 that the bug is not isolated (otherwise bugs are too hard to find if isolated
44 from everything else)
45 5. Ping on IRC to say a bug has been created
46 6. Unless you know exactly which milestone to use, leave blank initially. This
47 also applies when editing milestone, budget parent/child, toml fields. See
48 section [[HDL_workflow#Task management guidelines]] further down.
49 7. After setting the milestone, it is **absolutely required** to run
50 [budget-sync](https://git.libre-soc.org/?p=utils.git;a=blob;f=README.txt;hb=HEAD),
51 as it will point out any discrepancies. The budget allocations will be used for
52 accounting purposes and **MUST** be correct. *Note you can only get paid for
53 stuff done **after the nlnet grant is approved** (before the MOU is signed)*
54
55 If a developer ever needs to check which bugs are assigned to them, go to the
56 Libre-SOC bug tracker
57 [advanced search page](https://bugs.libre-soc.org/query.cgi?format=advanced),
58 and in the "Search by People" section, check "Bug Assignee" and "contains"
59
60 ## Additional info
61
62 ### Linking bugs - 'use bug#NNN' format
63
64 - When mentioning other bugs in bug description or comment, use the
65 "bug #NNN" format, and not "#NNN". For example, writing `bug #1000` in
66 in the bugtracker comment section will create a link to
67 [bug #1000](https://bugs.libre-soc.org/show_bug.cgi?id=1000).
68 Following this syntax ensures the Bugzilla system converts
69 every bug reference into a hyperlink which makes things easier to track
70 (as you see the interdependencies between various tasks/bugs/milestones etc.).
71
72 ### Do not attempt to re-use bugs
73
74 - As LibreSOC uses the bugtracker system for task management and grant/budget
75 allocation, it is critical not to change the purpose of a previously created
76 bug. If a duplicate bug has been created, mark as `DUPLICATE` (see the
77 procedure section further down on this page on additional types of bugs
78 which would not be worked on).
79 - All comments cannot be removed (with the exception of having no comments
80 other than the initial description, *and* no link/references to other bugs).
81 - The bug may also be referenced externally, and thus re-use is not permitted.
82
83 # Adding sub-tasks to tasks under existing milestone
84
85 * notify Michiel and the relevant NNNN-NN@nlnet.nl team of
86 advance notice of intent to add new sub-tasks, cc'ing bob
87 goudriaan
88 - confirm with them that this is NOT a change in the AGREED
89 MILESTONE BUDGETs, because it is just sub-task allocation.
90 - confirm that they are happy to add the sub-tasks to the MoU
91 (this needs approval of bob goudriaan)
92 * *re-generate* the JSON file
93 * make a DIFF against the *PREVIOUS* JSON file
94 * create a MANUAL report/summary of "changes" that
95 NLnet may easily action
96 - "add the following task X to parent Y of amount W",
97 - and if any: "change parent Z available amount to V as a WRAPUP")
98 (this latter is because occasionally there are subtasks **not**
99 totalling the full parent amount, usually because a summary
100 report is needed. Michiel and I privately agreed to call
101 this "wrapup")
102 * obtain a confirmation that this has been actioned
103 * **double-check** that the RFP database correctly matches the new
104 bugzilla status.
105
106 PLEASE NOTE: YOU CANNOT ACTION THE ABOVE UNDER THE FOLLOWING CIRCUMSTANCES
107
108 1. to make a change to the actual budgetary amounts of the
109 Grant Milestones, without written authorization from Bob
110 and Michiel. a DIFFERENT PROCEDURE is needed.
111 this is because NLnet had to go through a 3rd party Verification
112 Process with the European Union: changing the amounts without
113 consent is therefore tantamount to fraud.
114
115 2. if there has been an RFP already submitted under a given Milestone,
116 it becomes NO LONGER POSSIBLE to change the JSON file in NLnet's
117 system because it is too complex.
118
119 there is one Grant in this complex situation: bug #690, the crypto
120 grant. it is made much more complex because it *pre-dates* NLnet's
121 current RFP system, where RFPs were submitted by EMAIL and there
122 are manual records not fully integrated into the database.
123
124 also note: as the addition of sub-tasks *requires a change to the MOU*
125 it should NOT be taken lightly, i.e. should not be arbitrarily done
126 one by one, but only in "batches".
127
128 considerable care therefore has to be taken to ensure that NLnet are
129 not overloaded, nor that the EU Auditor is given grounds to become
130 "suspicious" because of a dozen or more alterations to the MOU.
131 and write your nickname (i.e. andrey etc.).
132
133 # Budget Estimation
134
135 Working out a time taken (and budget) for a sub-tasks requires
136 guestimating. A small self-contained task should take
137 approximately **1/2 a day up to 8 days (+/- 40%)**.
138
139 The total for a group of sub-tasks should be approximately
140 **5-25 days**. If a single tasks looks like it might take
141 longer than 8 days, it is **required** to break it into
142 smaller subtasks. Big tasks can quickly get out of hand, so
143 if in doubt, splitting a task is the better option.
144
145 Assume *1 month is appx EUR 3000* (this is an average; the value
146 may be higher depending on circumstances) and back-calculate.
147
148 These numbers come from Luke's
149 [comment #8 on bug #1126](https://bugs.libre-soc.org/show_bug.cgi?id=1126#c8)
150
151 Statistically speaking using the +/- 40% variance for each task,
152 and adding up over 20+ tasks will give a time estimate
153 **that is accurate to +/- 10%**.
154
155 *(Any sources on this?)*
156
157 However it is very important to have a *clear idea of what is
158 actually needed*, and to *not leave anything out*.
159
160 For example, when determining the task of adding instructions:
161
162 - For each instruction perform a thought experiment:
163 "how many lines of HDL, how many unit tests?"
164 - Then from *- past experience -* estimate the total number
165 of days.
166 - Assume 1 month is appx EUR 3000 and back-calculate.
167 - Put that number for each instruction (or group)
168 into comment 0, add them up, and make that the total
169 for the task.
170
171 *(Luke has used this method for the last 5 years based on 20 years
172 of project management, and it is **expected for the team to familiarise
173 themselves with it**)*
174
175 Also, make sure not to forget including **documentation** in your
176 estimate. This ensures a portion of grant money is allocated
177 to actually documenting the work involved.
178
179 Without documentation, it is not only difficult to teach newcomers about
180 the code in question, it makes it difficult to come back to the code
181 6-12 months later for maintenance and/or improvement
182 (not a rare situation in LibreSOC).
183
184 Don't forget to ask fellow project for help, they might be able
185 to help determine the scope of the work involved.
186
187 # "I'm thinking of doing... procedure"
188
189 ## Preamble
190
191 Given the scale of this project and the critical reliance on certain parts
192 of it (such as devscripts, ISA csv files, ISACaller, etc.) on the work done
193 by the team, it is extremely important to raise any proposed changes and/or
194 improvements, and to wait for feedback *before* implementing said changes.
195
196 Going forward, we all need to keep this in mind when working on
197 critical parts of the codebase.
198
199 To make good use of available time and budget, the LibreSOC team should
200 focus on:
201
202 1. Completing tasks under grant budget
203 2. Make small, incremental changes which keep the overall codebase functional.
204 3. When coming up with fixes or improvements which are intrusive to the
205 *current* workflow (which may slow the team down from completing tasks
206 under grant budget), assign them to 'Future' milestone for grant
207 applications going forward.
208
209 Why these three points?
210
211 1. Work that cannot be related to grant sub-tasks (even if indirectly, by
212 bringing us closer to eventual completion), should be put aside *until
213 future funding is secured/confirmed*.
214 2. Small changes make it easier and quicker to find mistakes. That's one of
215 the reasons Luke has specified on [[/HDL_workflow]] to stick to small
216 commits. *(Andrey: I need to improve on this myself)*
217 3. Big changes are inherently risky. When LibreSOC was just a few people
218 (Luke and Jacob), it was easier to keep track of each other's progress.
219 5 years down the line, the situation has changed.
220 Keep in mind that changes to critical parts (whether big or small) will
221 now affect at minimum Luke, Dmitry, Jacob, Sadoon, myself
222 (perhaps also Cesar and Konstantinos, and so on).
223 By going through the process of documenting a change in a new bug report,
224 not only there's an opportunity to take a pause and think about
225 repercussions, it also adds to the list of work for future grant
226 applications (which will make it easier to draft focussed grants with
227 realistic timescales and budget).
228
229 ## Procedure
230
231 - If you discover a problem in code, raise a bug report, and use a
232 corresponding 'importance' setting depending on how serious you perceive the
233 issue to be. This will start a *discussion*.
234
235 **No work is to be started yet.**
236
237 - Based on generated discussion, determine if the issue is a *blocker to
238 current tasks under budget*. If it is a blocker , then the task 'importance'
239 to be set to 'major' or 'critical (or 'blocker').
240 *Andrey: need to clarify this*
241 If possible, a budget may be assigned after discussion and confirmation with
242 Luke and Andrey (depends on remaining budget/tasks).
243
244 - If the issue is *not a blocker*, but useful in future work, then the
245 'Future' milestone is to be assigned. The issue will be evaluated at a later
246 stage. At this point, no further time should be spent on this issue
247 (to prioritise outstanding tasks).
248
249 *(Andrey): Sometimes determining whether to use WONTFIX or INVALID is
250 difficult. Perhaps more examples would help?*
251
252 - If the issue is not a blocker, and the discussion shows that it is not
253 an issue at all, it is to be set to either of the following:
254 - `RESOLVED DUPLICATE` - If the issue raised already exists.
255 [Example, bug #962](https://bugs.libre-soc.org/show_bug.cgi?id=962)
256 - `RESOLVED WONTFIX` - If the issue requires too much time or budget.
257 [Example, bug #921](https://bugs.libre-soc.org/show_bug.cgi?id=921)
258 - `RESOLVED INVALID` - If the issue does not align with project goals or
259 methodology.
260 [Example, bug #76](https://bugs.libre-soc.org/show_bug.cgi?id=76)
261 - The final status will be confirmed after *at least two other people* (other
262 than the reporter) look at the bug report.
263 For cases considered to be `WONTFIX` or `INVALID`, 48h should be given
264 before the bug report is closed. This ensures the team has enough time to
265 see the discussion before the issue disappears.
266
267 - Once the issue has been discussed and determined to be critical to current
268 grant sub-task/s, and budget considered, *then* work can proceed in a separate
269 branch. Only after fixes have been confirmed to keep the CI tests passing,
270 can they be rebased (to keep commit history) into the master branch.
271 - *Note*: branch names **should not include personal info** such as names.
272 This is because others may require to use or work on the branch, and no
273 single developer owns a branch.
274
275 This procedure adds a time delay between the issue discovery and
276 start of work. This is important however because it allows for team members
277 to read bug updates without being overwhelmed and have time to add input.
278