You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: general/development/process/peer-review/index.md
+84-83Lines changed: 84 additions & 83 deletions
Original file line number
Diff line number
Diff line change
@@ -20,18 +20,18 @@ These are points to consider while peer-reviewing issues. Further explanation be
20
20
[] Syntax
21
21
[] Output
22
22
[] Component library
23
+
[] Icons
23
24
[] Language
25
+
[] Accessibility
24
26
[] Databases
25
-
[] Testing (instructions and automated tests)
27
+
[] Performance and Clustering
26
28
[] Security
27
29
[] Privacy (see Privacy API)
28
-
[] Performance and Clustering
30
+
[] The Moodle mobile app / web services
31
+
[] Third party code
29
32
[] Documentation
30
33
[] Git
31
-
[] Third party code
32
-
[] Icons
33
-
[] The Moodle mobile app / web services
34
-
[] Accessibility
34
+
[] Testing (instructions and automated tests)
35
35
[] Overall completeness and correctness
36
36
```
37
37
@@ -86,6 +86,14 @@ Ensure that any new User Interface feature in Moodle 4.0 or later which matches
86
86
- Has appropriate descriptions
87
87
- Respects all Moodle-supplied themes
88
88
89
+
### Icons
90
+
91
+
Are new icons being introduced? If so, ensure that:
92
+
93
+
- The icons abide by our icon guidelines with regards to size, design and format
94
+
- The icons are do not unnecessarily add new ways of expressing existing concepts
95
+
- The icons are in a pix folder that makes sense
96
+
89
97
### Language
90
98
91
99
Naming things is hard. For help with wordings for new features and improvements, add the `ux_writing` label to the issue.
@@ -100,6 +108,18 @@ Ensure that:
100
108
- Language strings have not been removed or renamed, had their meaning changed or had their parameters changed in stable branches (permitted only in main following [string deprecation policy](../../../projects/api/string-deprecation.md)); and
101
109
-[AMOS commands](https://docs.moodle.org/dev/AMOS_commands) have been specified when moving or copying language strings.
102
110
111
+
### Accessibility
112
+
113
+
Moodle should be accessible to everyone. When reviewing any changes that affects the frontend, ensure that these points have been considered:
114
+
115
+
- Automated tools: Does it pass automated accessibility checks? (e.g. via [axe DevTools](https://www.deque.com/axe/devtools/) or [WAVE Web Accessibility Evaluation Tool](https://wave.webaim.org/))
116
+
- Colours: Do the text have sufficient colour contrast against the background? If the patch introduces elements that convey information through colours, are there alternative means to convey this information to users with visual impairments?
117
+
- HTML validity: Does the patch generate a page with valid HTML? (e.g. checked via [Nu HTML validator](https://validator.w3.org/nu/#textarea))
118
+
- Keyboard navigation: Can you successfully navigate through the interface via keyboard?
119
+
- Screen reader: When using a screen reader (e.g. [ChromeVox](https://support.google.com/chromebook/answer/7031755?hl=en), [NVDA](https://www.nvaccess.org/), [JAWS](https://www.freedomscientific.com/products/software/jaws/), etc), are the UI components being properly and clearly announced?
120
+
121
+
But, remember that what you are doing here is part of a peer review. If you want to perform a systematic accessibility check, you can follow the [Accessibility checklist](./accessibility-checklist.md).
122
+
103
123
### Databases
104
124
105
125
DB calls are the greatest performance bottleneck in Moodle.
@@ -111,32 +131,21 @@ Ensure that:
111
131
- There are minimal DB calls (no excessive use of the DB); and
112
132
- The code uses SQL compatible with all the supported DB engines (check all selected fields appear in an 'ORDER BY' clause).
113
133
114
-
### Testing instructions and automated tests
115
-
116
-
It is the developer's responsibility to test code before integration. As well as verifying that the proposed change works, good tests can and should help the peer reviewer, integration reviewer, and anyone looking at this code in future to understand how it is supposed to work. They also help verify that everything that might be affected by this change was considered.
134
+
### Performance and clustering
117
135
118
-
For manual testing check that:
136
+
It is easy to write code that works sufficiently well when you are working on either small sets of data or with a small number of active users. Picking performance issues can be quite difficult and can required a complex level of understanding of both the section of code being reviewed, but also other parts that interact with it.
119
137
120
-
- The manual testing instructions:
121
-
- Are in the [correct format](./testing/guide).
122
-
- Are clear.
123
-
- Are concise.
124
-
- Are sufficient to verify that the change is working.
125
-
- Have considered what else might be affected by the change. That is, we have not just make the original issue go away, but we have done that without introducing any regressions.
126
-
- Regarding the previous point, a common thing to overlook is the Moodle mobile app users, so please consider that.
127
-
- Having said all that, the testing instructions should be no longer than necessary. There is no point testing essentially the same thing twice. Testers do a valuable job, but they have limited time. Please respect that.
128
-
- In relation to that, it is OK not to write testing instructions for parts of the fix that are already covered well enough by automated tests. Just remember that automated checks cannot see every problem that a set of human eyeballs would see.
129
-
- Look for evidence that the assignee has tested according to the instructions and verified that they are passing. (This is the responsibility of the assignee, not the peer reviewer.)
138
+
Clustering is when the same code is run on different computers and an end user could send each request to a different computer. This can produce a number of concurrency issues if not thought through. One example is; If you complete an opcache_reset(), no other server except the one you ran it on knows that it happened. So data can get out of sync.
130
139
131
-
For automated testing (PHPunit and Behat):
140
+
Ensure that:
132
141
133
-
-Automated tests are our way of verifying that Moodle works as expected, and that future changes do not cause unexpected regressions. Therefore, all Moodle code should come with tests.
134
-
-If it is a bug that is being fixed, then the fact that the bug could exist means that an automated tests was missing (otherwise we would have found the bug sooner). So every bug fix should come with test coverage. (If there is a genuine reason this is impossible, this should be explained in a tracker comment.)
135
-
-However, running automated tests takes time and energy. Check that the tests are not excessive, and that they follow best practice (e.g. Behat tests using generators, not setting things up through the UI.) Don't make MDL-15169 worse!
136
-
-Not every change in Moodle requires an entire new test. Sometimes, it is more appropriate and efficient to add some checks in an existing tests. (But this should not be taken to excess, since that could lead to a mess where it is not clear what is being tested where.)
137
-
-Check that the tests have been added in the best place. Are the tests in a place where someone working on related features in the future will expect to find them.
138
-
- As part of your review, check that the unit tests pass. Hopefully this can just be done by checking GitHub actions. (If the developer has not enabled GHA yet, encourage them to do so by linking them to [the instructions](https://moodledev.io/general/development/tools/gha).)
139
-
- Look for evidence that relevant Behat tests pass, especially when it involved UI changes. Note that Behat is not run by GitHub actions, but all the tests will be run as part of the integration process.
142
+
-Any filesystem, database or cache accesses are done in the most efficient way.
143
+
-That any code or function that appear expensive are not in critical paths. eg; They don't load on every page.
144
+
-The least possible code is running to complete the task, especially looking for hidden loops. They can appear from calling functions.
145
+
-Any code that runs is not specific to a single node. (eg opcache_reset()) This ensures clusters will run correctly.
146
+
-If the code could affect performance at all, make sure there is a comment noting what was considered.
147
+
- What they did to mitigate performance impact, or why they thought it wasn't an issue.
148
+
- Why they made certain trade-offs.
140
149
141
150
### Security
142
151
@@ -169,21 +178,28 @@ Ensure that:
169
178
See more info in [Privacy API](/docs/apis/subsystems/privacy/).
170
179
:::
171
180
172
-
### Performance and clustering
173
-
174
-
It is easy to write code that works sufficiently well when you are working on either small sets of data or with a small number of active users. Picking performance issues can be quite difficult and can required a complex level of understanding of both the section of code being reviewed, but also other parts that interact with it.
181
+
### The Moodle mobile app
175
182
176
-
Clustering is when the same code is run on different computers and an end user could send each request to a different computer. This can produce a number of concurrency issues if not thought through. One example is; If you complete an opcache_reset(), no other server except the one you ran it on knows that it happened. So data can get out of sync.
183
+
The Moodle app supports most of the student-related Moodle functionality. It is important to think about how a change in that type of functionality might affect it.
177
184
178
185
Ensure that:
179
186
180
-
- Any filesystem, database or cache accesses are done in the most efficient way.
181
-
- That any code or function that appear expensive are not in critical paths. eg; They don't load on every page.
182
-
- The least possible code is running to complete the task, especially looking for hidden loops. They can appear from calling functions.
183
-
- Any code that runs is not specific to a single node. (eg opcache_reset()) This ensures clusters will run correctly.
184
-
- If the code could affect performance at all, make sure there is a comment noting what was considered.
185
-
- What they did to mitigate performance impact, or why they thought it wasn't an issue.
186
-
- Why they made certain trade-offs.
187
+
- The issue is labelled with `affects_mobileapp` when the developer suspects that the changes can affect the app.
188
+
- New module settings are returned via the existing Web Services in the module
189
+
- When the code includes a new Web Service that will be necessary for the Moodle app, the new Web Service is included in the mobile service
190
+
- New global settings that affect new features for the app are included in the WebServices returning global settings (tool_mobile_get_config)
191
+
- The testing instructions include testing steps for the Moodle App
192
+
193
+
### Third party code
194
+
195
+
Does the change contain [third party code](../../../community/plugincontribution/thirdpartylibraries.md)? If so, ensure that:
196
+
197
+
- The code is licensed under a [GPL compatible license](http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses%7C).
198
+
- The instructions for upgrading/importing the library and contained within a readme_moodle.txt file.
199
+
- The library is recorded in a thirdparty.xml file, including licensing information.
200
+
- Third party code has been scanned to check for url accessible entry points that could be exploited. These should either be disabled, or if required functionality they should be checked for security weaknesses.
201
+
- Does not duplicate the functionality of any existing api or third party library in core.
202
+
- Any modifications to third party code are recorded in readme_moodle.txt
187
203
188
204
### Documentation
189
205
@@ -192,15 +208,16 @@ Work does not stop when code is integrated.
192
208
Ensure that:
193
209
194
210
- The PHPdoc comments on all classes, methods and fields are useful. (Comments that just repeat the function name are not helpful! Add value.)
195
-
- Where an API has been changed significantly, the relevant upgrade.txt file has been updated with information.
211
+
- Where an API has been changed significantly, ensure that [upgrade notes](../upgradenotes) have been written (or upgrade.txt on older branches).
196
212
- Where something has been deprecated, that the comments don't just say "do NOT use this any more!!!" but actually follow the [deprecation policy](../../policies/deprecation/index.md).
197
213
- Appropriate [labels](../../tracker/labels.md) have been added when there has been a function change, particularly
198
-
- docs_required (any functional change, usually paired with `ui_change`),
199
-
- dev_docs_required (any change to APIs, usually paired with `api_change`),
200
-
-`ui_change` (any functional change, usually paired with docs_required, except ui_change remains permanently),
201
-
-`api_change` (any change to APIs that devs will need to know about, usually paired with dev_docs_required, except api_change remains permanently),
202
-
-`unit_test_required` and `acceptance_test_required`, when there are api or ui changes needing improved coverage, and
203
-
-`qa_test_required` (significant functional change, not covered by unit/acceptance ones).
214
+
-`docs_required` - any functional change, usually paired with `ui_change`
215
+
-`dev_docs_required` - any change to APIs, usually paired with `api_change`
216
+
-`ui_change` - any functional change, usually paired with docs_required, except ui_change remains permanently
217
+
-`api_change`- any change to APIs that devs will need to know about, usually paired with dev_docs_required, except api_change remains permanently,
218
+
-`unit_test_required` and `acceptance_test_required` - when there are api or ui changes needing improved coverage, and
219
+
-`qa_test_required` - for significant functional changes not covered by automated tests
220
+
-`developer_notes` - for things worth calling out in [Integration exposed!](https://moodle.org/mod/forum/view.php?id=7966)
204
221
- Also, verify that the components for the issue are correctly set, so maintainers (subscribed by default) will be mailed about issues early in the process.
205
222
206
223
### Git
@@ -213,48 +230,32 @@ Ensure that:
213
230
214
231
See also the [Commit cheat sheet](https://docs.moodle.org/dev/Commit_cheat_sheet) for further guidance.
215
232
216
-
### Third party code
217
-
218
-
Does the change contain [third party code](../../../community/plugincontribution/thirdpartylibraries.md)? If so, ensure that:
219
-
220
-
- The code is licensed under a [GPL compatible license](http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses%7C).
221
-
- The instructions for upgrading/importing the library and contained within a readme_moodle.txt file.
222
-
- The library is recorded in a thirdparty.xml file, including licensing information.
223
-
- Third party code has been scanned to check for url accessible entry points that could be exploited. These should either be disabled, or if required functionality they should be checked for security weaknesses.
224
-
- Does not duplicate the functionality of any existing api or third party library in core.
225
-
- Any modifications to third party code are recorded in readme_moodle.txt
226
-
227
-
### Icons
228
-
229
-
Are new icons being introduced? If so, ensure that:
230
-
231
-
- The icons abide by our icon guidelines with regards to size, design and format
232
-
- The icons are do not unnecessarily add new ways of expressing existing concepts
233
-
- The icons are in a pix folder that makes sense
234
-
235
-
### The Moodle mobile app
236
-
237
-
The Moodle app supports most of the student-related Moodle functionality. It is important to think about how a change in that type of functionality might affect it.
238
-
239
-
Ensure that:
233
+
### Testing instructions and automated tests
240
234
241
-
- The issue is labelled with `affects_mobileapp` when the developer suspects that the changes can affect the app.
242
-
- New module settings are returned via the existing Web Services in the module
243
-
- When the code includes a new Web Service that will be necessary for the Moodle app, the new Web Service is included in the mobile service
244
-
- New global settings that affect new features for the app are included in the WebServices returning global settings (tool_mobile_get_config)
245
-
- The testing instructions include testing steps for the Moodle App
235
+
It is the developer's responsibility to test code before integration. As well as verifying that the proposed change works, good tests can and should help the peer reviewer, integration reviewer, and anyone looking at this code in future to understand how it is supposed to work. They also help verify that everything that might be affected by this change was considered.
246
236
247
-
### Accessibility
237
+
For manual testing check that:
248
238
249
-
Moodle should be accessible to everyone. When reviewing any changes that affects the frontend, ensure that these points have been considered:
239
+
- The manual testing instructions:
240
+
- Are in the [correct format](./testing/guide).
241
+
- Are clear.
242
+
- Are concise.
243
+
- Are sufficient to verify that the change is working.
244
+
- Have considered what else might be affected by the change. That is, we have not just make the original issue go away, but we have done that without introducing any regressions.
245
+
- Regarding the previous point, a common thing to overlook is the Moodle mobile app users, so please consider that.
246
+
- Having said all that, the testing instructions should be no longer than necessary. There is no point testing essentially the same thing twice. Testers do a valuable job, but they have limited time. Please respect that.
247
+
- In relation to that, it is OK not to write testing instructions for parts of the fix that are already covered well enough by automated tests. Just remember that automated checks cannot see every problem that a set of human eyeballs would see.
248
+
- Look for evidence that the assignee has tested according to the instructions and verified that they are passing. (This is the responsibility of the assignee, not the peer reviewer.)
250
249
251
-
- Automated tools: Does it pass automated accessibility checks? (e.g. via [axe DevTools](https://www.deque.com/axe/devtools/) or [WAVE Web Accessibility Evaluation Tool](https://wave.webaim.org/))
252
-
- Colours: Do the text have sufficient colour contrast against the background? If the patch introduces elements that convey information through colours, are there alternative means to convey this information to users with visual impairments?
253
-
- HTML validity: Does the patch generate a page with valid HTML? (e.g. checked via [Nu HTML validator](https://validator.w3.org/nu/#textarea))
254
-
- Keyboard navigation: Can you successfully navigate through the interface via keyboard?
255
-
- Screen reader: When using a screen reader (e.g. [ChromeVox](https://support.google.com/chromebook/answer/7031755?hl=en), [NVDA](https://www.nvaccess.org/), [JAWS](https://www.freedomscientific.com/products/software/jaws/), etc), are the UI components being properly and clearly announced?
250
+
For automated testing (PHPunit and Behat):
256
251
257
-
But, remember that what you are doing here is part of a peer review. If you want to perform a systematic accessibility check, you can follow the [Accessibility checklist](./accessibility-checklist.md).
252
+
- Automated tests are our way of verifying that Moodle works as expected, and that future changes do not cause unexpected regressions. Therefore, all Moodle code should come with tests.
253
+
- If it is a bug that is being fixed, then the fact that the bug could exist means that an automated tests was missing (otherwise we would have found the bug sooner). So every bug fix should come with test coverage. (If there is a genuine reason this is impossible, this should be explained in a tracker comment.)
254
+
- However, running automated tests takes time and energy. Check that the tests are not excessive, and that they follow best practice (e.g. Behat tests using generators, not setting things up through the UI.) Don't make MDL-15169 worse!
255
+
- Not every change in Moodle requires an entire new test. Sometimes, it is more appropriate and efficient to add some checks in an existing tests. (But this should not be taken to excess, since that could lead to a mess where it is not clear what is being tested where.)
256
+
- Check that the tests have been added in the best place. Are the tests in a place where someone working on related features in the future will expect to find them.
257
+
- As part of your review, check that the unit tests pass. Hopefully this can just be done by checking GitHub actions. (If the developer has not enabled GHA yet, encourage them to do so by linking them to [the instructions](https://moodledev.io/general/development/tools/gha).)
258
+
- Look for evidence that relevant Behat tests pass, especially when it involved UI changes. Note that Behat is not run by GitHub actions, but all the tests will be run as part of the integration process.
0 commit comments