-
Notifications
You must be signed in to change notification settings - Fork 966
Add code review checklists #16447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add code review checklists #16447
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| ## Links `<a>` | ||
|
|
||
| - [ ] Has a `data-cta-text` OR `data-link-text` | ||
| - [ ] If it has class `mzp-c-button` it is a CTA | ||
| - [ ] If it has class `mzp-c-cta-link` it is a CTA | ||
| - [ ] If there are two of the same `data-cta-text` include `data-cta-position` | ||
| - [ ] Does not have both `data-cta-text` and `data-link-text` | ||
| - [ ] If linking to another Mozilla property include `utm` params | ||
| - Download button: | ||
| - [ ] Use the appropriate helper, don't hard code these. (`download_firefox_thanks`, `google_play_button`, `apple_app_store_button`) | ||
| - [ ] include a download_location if there are multiple buttons on the page | ||
|
|
||
| # Buttons `<button type="button">` | ||
|
|
||
| - Download button: | ||
| - Download buttons are links, see above | ||
| - Not a download button: | ||
| - [ ] [`widget_action` reporting in the dataLayer](https://mozilla.github.io/bedrock/attribution/0001-analytics/#widget-action) | ||
|
|
||
| # QR Codes | ||
|
|
||
| - [ ] Use the `qr_code` helper | ||
| - [ ] Use the apps store redirects if applicable - include a product and campaign | ||
|
|
||
| # Other | ||
|
|
||
| - [ ] New custom events configured in GTM. | ||
| - If any of the following are used check that their custom events will be triggered: | ||
| - Download | ||
| - Mozilla Accounts form | ||
| - Newsletter subscribe | ||
| - Self-hosted videos | ||
| - Send to Device | ||
| - Social Share | ||
| - VPN subscribe button | ||
| - Widget Action | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| ## Responsive | ||
|
|
||
| - [ ] CSS written mobile-first | ||
| - [ ] In extremely wide viewports, the edges of backgrounds are not visible | ||
|
stephaniehobson marked this conversation as resolved.
|
||
| - [ ] In narrow viewports, content stacks in a logical reading order | ||
| - [ ] Conditional content displays under correct conditions (logged in, out, Fx, not Fx) | ||
|
|
||
| ## Best practices | ||
|
|
||
| - [ ] Passes Stylelint | ||
| - [ ] Components added locally do NOT use `mzp` prefix on classes | ||
| - [ ] Can still use [other prefix conventions](https://protocol.mozilla.org/docs/contributing/naming) | ||
| - [ ] Prefer classes over element selectors or IDs | ||
| - [ ] Use mixins and design tokens when available | ||
| - [ ] No commented out code | ||
|
|
||
|
|
||
| ## Localization | ||
|
|
||
| - [ ] Test in a RTL language (You may find the [Pseudolocalize addon](https://addons.mozilla.org/en-US/firefox/addon/pseudolocalize/) helpful.) | ||
| - [ ] BIDI mixin used for any properties which include `left` or `right` | ||
| - [ ] BIDI mixin used for any properties which assume LTR (e.g. `background-position`, shorthands like `border-width`) | ||
| - [ ] BIDI mixin used for any values which include `left` or `right` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| - [ ] Consent is respected | ||
| - [ ] There is a switch to disable it | ||
| - [ ] If there are other conditions to run, bundle the display logic into one variable | ||
| - i.e. `is_enabled = switch('switchname') && geo=US && lang.startswith('en')` | ||
| - [ ] Test all variations | ||
| - [ ] Test an unexpected variation | ||
| - [ ] With the experiment disabled experiment variations do not load | ||
| - [ ] With the experiment disabled experiment code is not loaded | ||
| - [ ] If a template was added it is `noindex` and has a canonical URL | ||
| - [ ] The events which will determine the success of the experiment are being recorded | ||
| - Usually in GA but sometimes Stub Attribution or FundraiseUp | ||
| - [ ] An `experiment_view` event is reported in the DataLayer | ||
| - [ ] No conflicting experiments | ||
|
|
||
| # Traffic Cop experiments | ||
|
|
||
| - [ ] Checks `isApprovedToRun` before activating | ||
| - [ ] Experiment activation logic is sound | ||
| - [ ] Traffic is split between variants as expected | ||
| - [ ] [Cookie support is not necessary or is included](https://mozilla.github.io/bedrock/abtest/#cookies-consent) | ||
|
|
||
|
|
||
| [Experiment documentation](https://mozilla.github.io/bedrock/abtest/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ## General | ||
|
|
||
| - [ ] Works as described | ||
| - [ ] Code makes logical sense | ||
| - [ ] Does not have unintended side effects | ||
|
|
||
| ## Maintainable | ||
|
|
||
| - [ ] Comments where appropriate | ||
|
|
||
| ## Manual Testing | ||
|
|
||
| - [ ] All breakpoints checked (320, 480, 768, 1024, 1312, 1440) | ||
| - [ ] Tested in Gecko (Firefox) | ||
| - [ ] Tested in Webkit (Safari) | ||
| - [ ] Tested in Chromium (Pick one: Chrome, Edge, Brave, DuckDuckGo, Ecosia...). | ||
| - [ ] All images in a `srcset` can be loaded | ||
|
|
||
|
|
||
| If you are new to doing code reviews you may find these resources helpful: | ||
|
|
||
| - [How to Do Code Reviews Like a Human (Part One)](https://mtlynch.io/human-code-reviews-1/) | ||
| - [How to Do Code Reviews Like a Human (Part Two)](https://mtlynch.io/human-code-reviews-2/) | ||
| - [ conventional: comments ](https://conventionalcomments.org/) | ||
| - [Code Review Anxiety Workbook](https://developer-success-lab.gitbook.io/code-review-anxiety-workbook-1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ## Best Practices | ||
|
|
||
| - [ ] Heading levels | ||
| - Only one h1 on the page | ||
| - Heading levels convey the content hierarchy. | ||
| - No heading levels skipped | ||
| - [ ] Semantic HTML | ||
| - [ ] No validation errors | ||
| - [ ] Automated a11y tests pass | ||
|
|
||
|
|
||
| ## Images | ||
|
|
||
| - [ ] Have alt text where applicable | ||
| - [ ] Use image helpers | ||
|
|
||
|
|
||
| ## Links | ||
|
|
||
| - [ ] No hard coded "en-US" in links to Mozilla sites | ||
| - [ ] External links have rel="external noopener" | ||
| - [ ] Destination does not 404 | ||
|
|
||
|
|
||
| ## SEO | ||
|
|
||
| - [ ] "noindex" pages should not have the canonical or hreflang tags (bug 1442331) | ||
| - [ ] Is there an appropriate page title and description? | ||
| - [ ] Page linked from subnav where applicable | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| - [ ] Behaves as expected | ||
| - [ ] Logs analytics events as needed | ||
| - [ ] No errors in the console | ||
| - [ ] No `console.log`s | ||
| - [ ] Conditional content displays under correct conditions (mobile vs desktop, firefox vs other, signed in to account, vs signed out) | ||
| - [ ] promise rejections are handled | ||
| - [ ] Has a sensible fallback for when JS is disabled. | ||
| - [ ] Code makes logical sense |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| - [ ] No hard coded English strings remain in the template file | ||
| - Pay special attention to hidden text like `alt` and `.visually-hidden` | ||
| - [ ] All Fluent IDs referenced exist in the Fluent file | ||
| - [ ] No unused Fluent IDs remain in the Fluent file | ||
|
|
||
| ## String conventions: | ||
|
|
||
| - [ ] Strings are grouped with sub headings (## followed by an empty line) | ||
| - [ ] Mozilla brands are Fluent IDs defined in brands.ftl | ||
| - [ ] Idioms have explanatory comments (# with no empty line after) | ||
| - [ ] [Variables have explanatory comments](https://mozilla.github.io/bedrock/l10n/#variables) | ||
| - [ ] [HTML elements do not have editable attributes](https://mozilla.github.io/bedrock/l10n/#html-with-attributes) | ||
| - [ ] Text which serves as a link has a comment with the link | ||
|
|
||
| ## ID conventions: | ||
|
|
||
| - [ ] IDs are lowercase and hyphenated (kebab case) | ||
| - [ ] IDs are prefixed with the file name | ||
| - [ ] IDs are versioned when altering a string | ||
| - [ ] [Obsolete strings kept as a fallback are dated for removal 2 months in the future](https://mozilla.github.io/bedrock/l10n/#obsolete-strings) | ||
| - [ ] Substantial changes use new IDs and do not keep misleading content as fallbacks | ||
|
|
||
| ## If a new Fluent file is added: | ||
|
|
||
| - [ ] File is added in `/l10n/en/` | ||
| - [ ] File begins with a comment that includes the url of the page on the dev server (### followed by an empty line) | ||
| - [ ] File is configured in l10n/configs/pontoon.toml | ||
| - [ ] File is associated with a template in urls.py or a view | ||
|
|
||
| ## Styleguide: | ||
|
|
||
| There exists no formal style guide, but here are some conventions this team will enforce until we're told otherwise. | ||
|
stephaniehobson marked this conversation as resolved.
Outdated
|
||
|
|
||
| - [ ] web and internet are lowercase | ||
| - [ ] spaces around em dashes | ||
| - [ ] sentence case for headings/titles | ||
| - [ ] sign in/out (not log in/out) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - [ ] Optimized | ||
| - [ ] SVG contains viewbox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ## Unit tests | ||
|
|
||
| - [ ] Existing ones are updated & passing | ||
| - [ ] Any new ones needed? | ||
|
|
||
| ## Functional tests | ||
|
|
||
| - [ ] Existing ones are updated & passing | ||
| - [ ] Any new ones needed? | ||
| - [ ] Do we need to run integration tests? |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.