Skip to content

Conversation

@stephaniehobson
Copy link
Contributor

One-line summary

Workflow to comment with code review checklists on PRs.

Significant changes and points to review

The idea is to create a GitHub workflow which will post appropriate checklists in a comment when a pull request is opened if some file types have been added. So, these are a little general in places. But, I'm hoping they can help keep our code base consistent-ish as we have more new developers contributing.

The conditions where the checklists should post are:

  • new files with type html, css, js, or ftl
  • new files with the word experiment in the name
  • html edits to lines with <a or <button
  • js edits to lines with addEventListener and simmilar
  • js edits to line that include experiment_view
  • py edits which include variations = [ and the array is not empty
  • if there are no checklists to add it will not post a comment

=> each condition should only trigger relevant checks

Add checklists for:

  • HTML
  • CSS
  • JS
  • Analytics
  • Experiments
  • Localization
  • General (not in use by workflow)
  • Tests (not in use by workflow)
  • Media (not in use by workflow)

Did a bit of markdown cleanup too.

Issue / Bugzilla link

n/a

Testing

You can see an earlier version of the script at work on the pulls here: https://github.com/stephaniehobson/bedrock/pulls

I'll re-run with the most recent version of the script tomorrow.

Stephanie Hobson added 2 commits August 1, 2025 11:17
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

Thank you for your pull request. Based on the contents you may need to double-check these things:


📊 Analytics Checklist

Links <a href="">

  • 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
    • utm_source is 'www.firefox.com or www.mozilla.org
    • utm_medium is referral
    • if the query string is in a variable it is called params and the string includes the ?
  • 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">

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

🧪 Experiment Checklist

If you want to suggest an improvement to this script please comment in mozmeao/springfield#396

@stephaniehobson stephaniehobson added Needs Review Awaiting code review Review: M Code review time: 1-2 hours labels Aug 1, 2025
@stevejalim
Copy link
Contributor

py edits which include variations = [ and the array is not empty

I don't see this behaviour in there any more - was it dropped?

Also, I guess it'd be good to put the docs in mozmeao/platform-docs now instead

- [ ] 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all looking great! 🥇 One best practice CSS suggestion (non-blocking)

Suggested change
- [ ] No commented out code
- [ ] No commented out code
- [ ] Prefer top-level classes (avoid unnecessary nesting or specificity)

@stephaniehobson
Copy link
Contributor Author

Hm. I guess I need to break up the docs changes and put them in platform-docs but keep the workflow here and in springfield.

@stephaniehobson stephaniehobson marked this pull request as draft September 17, 2025 20:45
@stephaniehobson stephaniehobson removed the Needs Review Awaiting code review label Sep 17, 2025
@janbrasna
Copy link
Collaborator

Would it be feasible to catch inline style attributes in HTML and JS and remind the author to check the CSP limits do not break that for them?

[[ "${{ steps.checklists.outputs.css }}" == "true" ]] && append_checklist "🧾 CSS Checklist" "docs/docs/checklists/css.md"
[[ "${{ steps.checklists.outputs.analytics }}" == "true" ]] && append_checklist "📊 Analytics Checklist" "docs/docs/checklists/analytics.md"
[[ "${{ steps.checklists.outputs.l10n }}" == "true" ]] && append_checklist "🌍 L10n Checklist" "docs/docs/checklists/l10n.md"
[[ "${{ steps.checklists.outputs.experiment }}" == "true" ]] && append_checklist "🧪 Experiment Checklist" "docs/docs/checklists/experiment.md"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason the example comment above shows an empty "🧪 Experiment Checklist" (the idea is for sections without any content to stay hidden right?)

@janbrasna
Copy link
Collaborator

Idea: if any TODO or FIXME or TKTK is present in the additions, add a checkmark to make sure it's either deliberate, or resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review: M Code review time: 1-2 hours

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants