Skip to content

Conversation

@stephaniehobson
Copy link
Contributor

@stephaniehobson stephaniehobson commented Jul 31, 2025

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.

@stephaniehobson stephaniehobson marked this pull request as draft July 31, 2025 00:02
@stephaniehobson stephaniehobson changed the title Add code review checklists Workflow to comment with code review checklists on PRs. Jul 31, 2025
@stephaniehobson
Copy link
Contributor Author

Looks like it fails on PRs that are not on the same repository...? It's failing here anyway.

Comment on lines +3 to +5
on:
pull_request:
types: [opened, synchronize, reopened]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah yeah that was a good call to try from a fork. For this type of things (not actually executing foreign code, however running from the context of the base repo default branch) you may need to trigger this on pull_request_target instead:

That might be necessary for the createComment, updateComment APIs to actually have the token access to write to the PR anyways.

@stephaniehobson
Copy link
Contributor Author

Superseded by #16472

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants