Slide 1

Slide 1 text

! Ruby on " Guard(Rails) Mike McQuaid (@MikeMcQuaid)

Slide 2

Slide 2 text

me #

Slide 3

Slide 3 text

Project Leader of Homebrew (Homebrew Maintainer 2009 – Present)

Slide 4

Slide 4 text

Engineer at AllTrails (2012 – 2013)

Slide 5

Slide 5 text

Principal Engineer at GitHub (GitHub 2013 – 2023)

Slide 6

Slide 6 text

CTO/Cofounder at Workbrew (2023 - Present)

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

workbrew.com

Slide 9

Slide 9 text

background ⏮

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

you? %

Slide 14

Slide 14 text

why? &

Slide 15

Slide 15 text

! Ruby is great ' for moving fast ( (and breaking things)

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

) Go compiler * Rust compiler + Ruby interpreter

Slide 18

Slide 18 text

what? ,

Slide 19

Slide 19 text

the solutions to these problems is …

Slide 20

Slide 20 text

the solutions to these problems is entirely dependent on what you’re optimising for

Slide 21

Slide 21 text

What is Mike optimising for?

Slide 22

Slide 22 text

1. - developer happiness 2. .customer/user happiness 3. / velocity/quality balance 4. 0 robot pedantry, human empathy

Slide 23

Slide 23 text

how? 1

Slide 24

Slide 24 text

developer happiness

Slide 25

Slide 25 text

developer happiness == ! Ruby

Slide 26

Slide 26 text

customer/user happiness

Slide 27

Slide 27 text

customer/user happiness == software that works

Slide 28

Slide 28 text

customer/user happiness == bugs caught in test

Slide 29

Slide 29 text

customer/user happiness == low MTTR

Slide 30

Slide 30 text

customer/user happiness == bugs fixed quickly

Slide 31

Slide 31 text

velocity/quality balance

Slide 32

Slide 32 text

velocity/quality balance == ship fast with few bugs

Slide 33

Slide 33 text

velocity/quality balance != ship fast with no bugs

Slide 34

Slide 34 text

velocity/quality balance != ship slow with no bugs

Slide 35

Slide 35 text

velocity/quality balance != ship fastest, many bugs

Slide 36

Slide 36 text

robot pendantry, human empathy

Slide 37

Slide 37 text

0 Robot Pedantry, 2 Human Empathy https://mmq.lol/robot https://mikemcquaid.com/robot-pedantry-human-empathy/

Slide 38

Slide 38 text

robot pendantry, human empathy == automate (almost) everything

Slide 39

Slide 39 text

be specific? 3

Slide 40

Slide 40 text

linters 4

Slide 41

Slide 41 text

1. 4 rubocop 2. 5 erb_lint 3. 6 better_html 4. 7 prosopite 5. 8 licensed 6. 0 actionlint 7. 9 eslint 8. % GIVE ME MOAR LINTERS

Slide 42

Slide 42 text

group :development do gem "better_html" gem "erb_lint" gem "licensed" gem "rubocop-capybara" gem "rubocop-performance" gem "rubocop-rails" gem "rubocop-rspec" gem "rubocop-rspec_rails" end

Slide 43

Slide 43 text

require: - rubocop-performance - rubocop-rails - rubocop-rspec - rubocop-rspec_rails - rubocop-sorbet - rubocop-capybara AllCops: TargetRubyVersion: 3.3 ActiveSupportExtensionsEnabled: true NewCops: enable EnabledByDefault: true Layout: Exclude: - "db/migrate/*.rb"

Slide 44

Slide 44 text

# Bulk create BrewCommandRuns for each Device. # Since there are no callbacks or validations on # BrewCommandRun, we can safely use insert_all! # # rubocop:disable Rails/SkipsModelValidations BrewCommandRun.insert_all!(new_brew_command_runs) # rubocop:enable Rails/SkipsModelValidations

Slide 45

Slide 45 text

tests :

Slide 46

Slide 46 text

1. : rspec 2. ; simplecov 3. < playwright 4. = vcr 5. > parallel_tests 6. ? CodeCov 7. 0 GitHub Actions

Slide 47

Slide 47 text

https://justin.searls.co/posts/running-rails-system-tests-with-playwright-instead-of-selenium/

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

$ bin/parallel_rspec Using recorded test runtime 10 processes for 80 specs, ~ 8 specs per process ............................................................... ............................................................... ............................................................... ............................................................... ............................................................... ............................................................... ............................................................... ......................................................... Coverage report generated to /Users/mike/Workbrew/console/ coverage. Line Coverage: 100.0% (6371 / 6371) Branch Coverage: 89.6% (1240 / 1384) Took 15 seconds

Slide 52

Slide 52 text

group :test do gem "capybara-playwright-driver" gem "parallel_tests" gem "rspec-github" gem "rspec-rails" gem "rspec-sorbet" gem "simplecov" gem "simplecov-cobertura" gem "vcr" end

Slide 53

Slide 53 text

monitoring @

Slide 54

Slide 54 text

1. A sentry 2. B logtail 3. C Better Stack

Slide 55

Slide 55 text

group :production do gem "sentry-rails" gem "logtail-rails" end

Slide 56

Slide 56 text

types D

Slide 57

Slide 57 text

D sorbet

Slide 58

Slide 58 text

# typed: strict class TapsController < ApplicationController sig { void } def initialize super @tap_packages = T.let(nil, T.nilable(T::Hash[String, T::Array[String]])) @homebrew_core_count = T.let(nil, T.nilable(Integer)) @homebrew_cask_count = T.let(nil, T.nilable(Integer)) @homebrew_cask_font_count = T.let(nil, T.nilable(Integer)) end ... end

Slide 59

Slide 59 text

gem "sorbet-runtime" group :development do gem "rubocop-sorbet" gem "sorbet" gem "tapioca" end group :test do gem "rspec-sorbet" end

Slide 60

Slide 60 text

easy for you… E

Slide 61

Slide 61 text

Workbrew/console (2023 - Present)

Slide 62

Slide 62 text

Homebrew/brew (2009 – Present)

Slide 63

Slide 63 text

github/github (~2007 – Present)

Slide 64

Slide 64 text

cheating F

Slide 65

Slide 65 text

questions? G [email protected] @MikeMcQuaid https://mmq.lol/guardrails