Pull Requests

What are the goals of a PR? πŸ”—

Goals in order of importance:

  1. Ensure correctness
  2. Spread and share knowledge
  3. Improve the design
  4. Ensure consistency

Guide for authors πŸ”—

Who do I assign as a reviewer? πŸ”—

Timescales πŸ”—

Scope creep πŸ”—

If you get feedback that’s outside the scope of the ticket:

  1. Create another ticket. Kindly ask the reviewers to help add more details to the ticket if they are more familiar with the requirements.
  2. Link to the ticket in a comment then resolve the comment

What should be included in a PR? πŸ”—

PRs should be small and focussed.

Make sure you include everything on the PR Checklist

Guide for reviewers πŸ”—

What’s the mindset? πŸ”—

  1. To check the author’s work for correctness
  2. To prompt for better ways at approaching the problem
  3. To look at the problem through fresh eyes
  4. To encourage good design and progress of the codebase
  5. To ask for the PR to be small enough so they can productively review it
  6. To look for potentially missing automated tests

Timescale πŸ”—

@authorname I’ll review this at 10am GMT Friday 13th March

Scope creep πŸ”—

What should be included in a PR? πŸ”—

PRs should be small and focussed.

It’s your right to ask for the PR to be broken down.

Check everything on the PR Checklist

PR Checklist πŸ”—

Title πŸ”—

  1. Clear and detailed title

  2. Title and body includes Jira ticket number e.g. [BIG-6523] or [no-ticket]

Description πŸ”—

  1. Contains link to Jira ticket

  2. The why will help us understand the change 6 months from now

  3. The how is detailed and includes links to the relevant source code

  4. Manual test results included

Code πŸ”—

  1. Tested on a review app or locally

  2. Adequate automated test coverage of changes made

  3. Author has reviewed their own PR

  4. Live review scheduled if change is non trivial

For UI changes πŸ”—

  1. PR includes before and after videos or screenshots

  2. Tested on the supported browsers, videos or screenshots included in the PR

For defects πŸ”—

  1. Regression test has been written that replicates the bug

For Segment tracking πŸ”—

  1. Tested events coming through via the Segment debugger

  2. Videos or screenshots taken of the events asserting what you expect - see example

During Review πŸ”—

  1. Author responses to reviewer comments are clear

  2. When feedback has been actioned, the commit sha of the fix is in the comment and the comment has been resolved

  3. Every reviewer comment has been responded to and resolved

Example of a great PR πŸ”—

[BIG-123] Add authentication support for dashboard πŸ”—

What πŸ”—

I’ve added support for authentication to implement the dashboard. It includes model, table, controller and test.

Why πŸ”—

These changes complete the user login and account creation experience. See #JIRA-123 for more information.

How πŸ”—

This includes a migration, model and controller for user authentication. I’m using Devise to do the heavy lifting. I ran Devise migrations and those are included here.

Testing πŸ”—

🟒 When user logs in they are shown the dashboard πŸ”—

βœ… User is shown dashboard βœ… Logs indicate success

🟒 When a guest user visits the dashboard they are redirected to the home page πŸ”—

βœ… User is shown home page βœ… Warning shown in logs

Browser Testing πŸ”—

Mobile πŸ”—

Β  OS Device OS version Browser
🟒 iOS iPhone 8 13 Safari
🟒 iOS iPad 5 11 Safari
🟒 iOS iPad Mini 4 11 Safari
🟒 Android Samsung Galaxy S21 11 Samsung Internet

Desktop πŸ”—

Β  OS Browser
🟒 Windows 7 Chrome 96
🟒 Mac El Capitan (10.11) Chrome 96
🟒 Mac Sierra (10.12) Safari 10.1
🟒 Windows 10 Edge 96
🟒 Windows 7 Firefox 59
🟒 Mac El Capitan (10.11) Firefox 78

Screenshots πŸ”—

<screenshots of the user logged in>

Anything Else? πŸ”—

Let’s consider using a 3rd party authentication provider for this, to offload MFA and other considerations as they arise and as the privacy landscape evolves.

AWS Cognito is a good option, so is Firebase. I’m happy to start researching this path.

Let’s also consider breaking this out into its own service. We can then re-use it or share the accounts with other apps in the future.