►
From YouTube: BE Pairing - 20230301 - Discussing large-scale refactors
Description
In this session we discuss how to roll out large refactors that cannot be handled by a single engineer or even a single group of engineers. Strategies discussed include: named Ruby arguments, code comments, Dangerbot warnings, CI failures, custom Rubocop rules. We also discuss how to create custom Rubocop rules as part of this discussion.
B
B
B
Talked
about
how
to
safely
refactor
a
permission
right
like
we
talked
about
test
harnesses
and
writing
tests
and
I
was
able
to
come
up
with
like
a
shared
example.
We
can
use
so
I
feel
pretty
good
about
that,
and
then
I've
also
come
up
with
some
other,
like
strategies
for
how
to
refactor
and
the
where
I
find
myself
now
is
I
actually
found
that
I
am
not
the
first
person
to
have
considered
this
refactor.
There
is
a
larger
effort
from
another
group.
C
B
Don't
even
I
guess
they're,
not
part
of
PODS,
like
the
organization
group
to
unify
groups
and
projects.
B
So
let
me
look
at
this
conversation.
I
was
having
because
there's
some
good
links.
B
Exactly
exactly
so,
there's
this
larger
effort
happening
from
that
group.
I,
don't
know
the
exact
status
of
that
large
project,
but
it's
a
large
project
right.
It
touches
many
parts
of
the
code
base
and
then,
as
part
of
that,
we're
going
to
want
to
consolidate
group
and
project
policies.
B
So,
as
we
unify
everything
group
and
project
into
one
thing
for
namespaces
we're
also
going
to
want
to
unify
the
policies,
I
I
was
able
to
quantify
yesterday.
This
is
why
I
was
looking
at
my.
This
is
why
I
was
looking
at
my
activity,
because
I
was
trying
to
find
the
issue
I
created,
and
the
issue
is
where
is
there
an
easy
way
to
find
like
issues
I
created
recently,
I
opened
this
issue
to
search.
B
Okay,
okay,
well,
I
found
it
in
my
activity.
So
that's
good.
It
wasn't
too
far
away.
So
this
is
a
big
effort.
We
currently
have
354
abilities
in
Project
policy
and
192
abilities
in
group
policy,
and
so
I've
come
up
in
this
issue
with
a
way
to
like
you
know,
on
a
one-off
basis.
How
do
we
consolidate
but
I
I
guess
the
larger
conversation
I
wanted
to
have
is?
B
B
A
One
large
refactor
here
that
he
shared
with
me
as
inspiration
for
a
refactor
that
I
have
yet
to
do.
Okay,
so
I
know,
at
least
at
least
in
my
divide,.
A
B
D
Like
yeah,
every
wave
factor
is
different,
but
the
you
just
have
to
sort
of
break
it
down.
The
one
General
piece
of
advice,
I,
think
is
this
is
maybe
even
more
applicable
since
we're
now.
Finally,
on
Ruby
three
is
to
try
to
introduce
some
type
safety
like
even
before
Ruby
3
like
have
named
parameters
rather
than
just
positional
parameters
like
when
I
was
doing
like
some
of
the
for
the
captcha
stuff.
D
D
So
what
I
did
is
an
initial
refactor
to
introduced
named
parameters
into
the
central
point
that
it
was
being
called
and
then
at
least,
if
there
was
any
unit
test
coverage
executing
the
line
of
code
for
the
caller,
it
would
fail
because
it
was
not
passing
unnamed
parameter,
was
passing
a
positional
so
that
let
me
find
all
these
places
that
was
touching
this
code,
that
otherwise
I
would
have
had
no
no
way
to
even
know
where
they
were
so
I
have
no
idea,
if
that's
applicable
to
this
policy
stuff.
B
B
Okay,
so
when
you
did
that,
when
you
added
that
name
to
parameter
that
would
have
caused
everything
that
was
calling
that
service
to
fail,
because
it
was
just
doing
positional
arguments,
but
then
that
makes
it
sound
like
you
just
fixed.
All
of
that
yourself
is
that
how
it
went
you
just
did
a
big
fix
or.
D
The
way
it
worked
out
like
I
in
this
particular
case
because
of
the
services
there
was
like
multiple
services
and
just
sort
of
inheritance.
Unfortunately,
not
composition,
hierarchy
and
I,
like
only
fixed
one,
little
piece
of
that
that
tree
and
I
never
got
to
the
other
stuff,
there's
still
like
a
pending
issue.
So.
D
D
You
didn't
pass
the
BAM
param
argument
here
and
in
the
future
when
people
don't
do
that
and
it
it
worked
out
well
because
I'm
like
okay
in
the
future,
when
people
try
to
make
changes
that
will
also
let
them
know
hey.
If
that's
when
you
need
to
pass
fan
pram
here,
maybe
I
should
think
about
the
implications
of
capture
here
and
whether
I
need
to
pass
this
rather
than
just
like,
ignore
it
and
pass
nil
and.
D
Up
with
a
community
contribution
and
like
they
were
just
going
to
ignore
it
and
I
somehow
got
mentioned
on
the
EMR
and
I
said
no.
We
really
we
especially
for
this,
which
was
like,
while
creating
epics
that
like
this,
is
actually
an
attack
vector
and
I
asked
security
and
they're
like
yeah.
This
is
kind
of
an
attack
Vector
for
caption
or
for
bulk
Banning,
and
therefore
we
should
add
spam
protection
here,
but
that
holds
important
Community
contributor
into
he
had
to
pull
off
another
piece
of
his
branch
and
modify.
D
You
know
dozens
of
files
which
oh
it
started
on
a
separate,
Mr
and
then
got
bogged
down
and
never
did
it
and
then
I
felt
like
bad,
but
I'm
like
this
had
to
be
done.
It
was
a
security
thing,
but
now
I've
like
sidetracked,
his
feature
by
making
him
do
the
three
factor
that
we
didn't
finish
ourselves
and
that's
where
it's
Dan,
so
it.
D
It
did
what
it
was
supposed
to
do,
but
then
the
marath,
the
code,
debt,
that
is
the
get
lab
monolith
negatively
impacted
the
ability
for
everyone
to
contribute
that
the
end
of
that
story.
D
B
B
D
A
Now
we're
like
we
just
keep
adding
more
stuff
onto
it,
so
it's
not
gonna
be
yeah.
It's
fine,
though,
is
this.
It.
A
It
like
no,
that
is,
the
search
service,
but
there's
actually
like
no
execute
method,
and
there
has
like
other
methods
that
it
has
to
run
to
like
actually
execute
the
work,
and
it
serves
up
like
three
or
four
different
types
of
results.
It's
just
very
confusing
what
I
had
refactored
that
was
kind
of
related
to
this
is
we
also
have
a
method
called
search
service
in
this
file
and,
like
instance,
variables
called
search
service
which
sometimes
were
like
search
present
search,
presenters,
I,
don't
know
it's
just
like
there
were
so
many
search.
A
Services
I
find
it
really
hard
to
like
explain
how
this
code
Works
to
people
who
were
trying
to
work
with
it,
who
aren't
familiar
with
it
like
new
people
that
join
our
team
or
someone.
That's
like
trying
to
review
the
code,
so
I've
been
slowly
like
chipping
away
at
things,
but
yeah
eventually,
I
would
like
to
like
redo
this
whole
page.
A
A
B
D
Like
went
to
kotlin
and
like
I,
don't
call
Java
type
State,
it's
just
like
annoying
annoyingly,
but,
like
my
brief
experience
with
Elm
and
kotlin,
it's
like.
Oh,
this
is
wonderful
I.
Don't
it
catches
all
of
my
stupid
errors
for
me,
I
don't
even
have
to
ride
all
of
the
middle
of
the
pyramid
tests.
The
compiler
does
it
for
me,
so
I
would
love
to
move
more
towards
that
world
in
Ruby
and
yeah.
A
D
Inference
like
Java
makes
you
declare
everything
everywhere,
but
modern
languages
like
West
or
Elm
or
kotlin.
They
have
good
typing
for
it.
You're,
like
you,
declare
it
once
and
then
they'll
compiler
knows
every
other
place.
You
use
that
function
everywhere
in
your
code,
like
it's
going
to
tell
you.
If
you
got
the
types
wrong
as
opposed
to
Java,
you
have
to
like
annotate
it
every
single
place
everywhere,
like.
B
D
D
Ruby
three,
maybe
RBS,
is
a
better,
less
verbose
way
because,
like
that,
like
once
you
get
to
like
three
four
five
arguments
like
you're
like
hitting
the
line
link
like
every
single
time
and
having
to
wrap
it
and
then
you're
like
okay.
Well,
what's
the
pattern
from
the
gang
of
four
I
have
to
pull
out
a
parameter
object
to
this?
And
it's
like?
Oh
really,.
C
D
B
D
C
I,
don't
I
don't
want
to
be
the
bad
person.
The
first
time
we
meet.
D
B
So
in
terms
of
this
particular
refactor
or
like
what
I'm
thinking
about
here,
I
guess,
the
interesting
thing
I
discovered
is
I
found
this
whole
history
of
another
group
that
had
basically
been
like,
and
this
conversation
has
more,
but
basically
they
were
like
yeah
we
wanted.
Basically,
we
want
to
take
everything
out
of
project
policy
and
now,
let's
remember
their
project
policy
is
huge.
B
B
Oh,
we
want
to
move
everything
to
project
namespace
as
part
of
this
effort
of
moving
from
project
and
group
to
namespace
I've,
never
known
that,
like
I'm
on
the
off
team,
I,
probably
added
quite
a
few
things
to
project
policy,
because
because
I
just
didn't
have
the
not
knowledge
that
that
was
even
an
effort
that
was
underway,
so
I
guess
the
question
I
have
for
this
particular
effort
is
how
could
we
better,
like
I,
feel
like
you
can't
even
socialize
changes
like
this
right?
B
D
D
Yeah,
like
I've
done
that
before,
like
Time
Bomb
type
tests
that
usually
I
only
do
that
like
if
there's
a
config
or
something
or
like
there's
a
you,
know
this
this
golden
list
of,
like
all
of
the
things
that
you
need
to
handle
all
of
the
cases
and
they
all
need
to
have
like
a
class
implementing
them,
for
example,
and
like,
if
you
add
a
new
case
like
blow
up
to
say
all
right.
D
A
D
The
code,
the
services
was
that
that
wasn't
in
the
place
of
the
services
like
the
old
Uber
super
class
for
the
services
hierarchy
likes
that
don't
use
this
one
use
the
new
one
and
that's
a
good
approach
too.
Like
a
layering
comment
right
at
the
top.
A
A
D
And
if
you
write
the
failing
test
like
you,
can
have
a
like
a
custom
matcher
in
our
spec
or
whatever
that's
what
they
call.
Customers
like.
Have
that
thing
just
spit
out
a
paragraph
explaining
exactly
what
they
need
to
do
and
why
and
get
the
link
to
this
and
instructions
how
to
do
it
and
all
of
that.
B
C
D
You
don't
even
need
to
write
a
custom
match
or
you
can
just
have
this
test
living
I,
don't
know
some
random
place.
That
does
this
check
and
it
fails
right.
So
when
it
fails
they're
going
to
go
to
the
line
and
then
right
there,
you
can
just
have
the
wall
of
tech
like
a
block
up
of
it.
Important
read
this
here's.
What
you
need
to
do
be
be
a
good
citizen.
Don't
do.
D
D
C
Could
it
be
done
without
with
danger
instead,
because
with
danger,
you
could
check
if
that
file
is
modified
and
maybe
throw
a
warning
on
the
on
the
comment,
because
there's
also
one
thing
to
keep
in
mind
with
the
movement
to
namespaces.
Is
that
not
everything
is
actually
ready
to
move
to
namespaces
because
there
are
some
bugs.
So
if
you
write
aspects
that
always
fails,
you
kind
of
block
people
from
doing
something.
D
D
D
B
B
D
A
I
feel
like
if
it's
like,
if
the
danger,
if
danger
is
set
to
fail,
then
you
can,
but
if
it
is
a
warning
like
you'll,
get
warnings
like
oh
the
title's,
not
you
know
whatever
or
like
you
need
to
add
subtype
label
and
you
didn't.
D
In
that
case,
I
think
RoboCop.
If
you
can
write
the
rule,
which
you
can't
always
do
sometimes
it's
hard
to
write.
River
cop
rules
is
better
and
then
you,
you
know
in
the
big
list
of
ignored
things
to
you.
You
have
that
file
of
the
the
river
traffic
noise,
rather
than
doing
it
on
a
per
line
level
everywhere,
and
then
that
is
at
least
a
an
indicator
for
the
future,
like
hey,
here's
all
the
ones
that
we
couldn't
do
it
for
put
it.
B
B
Yeah
no
I
think
I
could
do
a
Robocop
world
because
I
I,
we
can
count
the
number
of
abilities
per
policy
class,
and
so
we
could
say
if
the
number
goes
up
raise
an
error
with
your
book.
Hop
like
it
could
always
go
down,
which
is
good
like
we
want
to
be
chipping
away
and
removing
abilities
from
Project
policy
RB.
But
if
that
number
ever
increased
with
an
MR,
then
we
could
say:
oh
you
know
divided,
you
add
a
policy
to
this
class.
It
should
be
added.
B
D
C
D
B
B
And
that's
what
I
thought
Peter
did
the
something
really
cool.
So
this
is
a
little
bit
of
a
different
issue,
but
it
relates
to
policies.
He
added
us
back.
Actually
this
is
not.
Is
it
it's
not
repo
cop
or
is
it
basically,
we
had
an
issue
where
people
were
adding
policies
that
don't
exist.
So
if
you
add
a
policy
check
that
doesn't
exist,
it
actually
doesn't
raise
an
error.
It
just
returns
false
every
time.
B
So
this
was
a
problem
because
in
some
cases
we
had
these
in
the
code
and
there
was
not
an
obvious
way
to
know
so
Peter
and
this
Mr
added
this
chat
back
and
then
it
was
cool
because
there's
this
whole
ignore
file.
These
are
all
of
the
policies
we
have
referenced
in
the
code
that
don't
actually
exist,
so
they
always
return
false
I
guess
this
is
the
to
do.
A
D
B
B
There
was
basically
someone
was
saying
that
we,
oh,
is
it
code
reused
or
is
it
what
is
the
one
where
it
doesn't
want
you
to
use
active
record?
Oh.
B
Yeah,
and
so
the
I
thought
it
was
really
interesting.
If
we
look
at
the
issues
not
helpers
but
just
code
readers,
someone
was
saying
that
we
basically
like
we.
B
We
ignore
this,
so
often
that
like
we
should
just
get
rid
of
it.
It
was
an
interesting
discussion
yeah
if
anyone
wants
to
chime
in
because
this
was
actually.
This
is
actually
very
on
topic,
because
I
think
the
original
idea
behind
this
cop
was
that
we
were
going
to
do
a
big
refactor,
where
we
stopped
using
all
active
record
methods
outside
of
active
record
models,
which
makes
sense,
but,
like
nobody
ever
took
on
that
effort,
and
so
instead
we
just
have
a
cop.
B
D
Yeah,
the
rules
are
under
RoboCop
cop
I
I
think
what
I
was
thinking
of
is
like
that.
If
you
break
a
bass,
roll
that
like
lives
in
Robocop
itself,
and
you
have
to
sort
of
go
yeah.
D
A
A
A
C
B
A
B
Great
yeah
I
was
thinking,
I
needed
some
kind
of
a
mass
import
of
issues
or
something
I.
Don't
know,
I
need
to
figure
out
how
to
even
Define
those
issues.
Because
again,
there
are
354
policies
in
here,
354
abilities,
defined,
I,
think,
project
policy.
What.
C
A
D
B
B
C
C
All
right
are
actually
quite
often
taken
on
yeah.
They
do
a
lot
of
these
issues
during
hackathons,
because
my
last
three
hackathons
that
I
participated.
There
were
people
going
through
these
kind
of
issues
like
there's.
This
amount
of
cops
or
errors
and
broken
down,
for
example,
in
chunks
of
10,
and
each
contributor
goes
over
one
of
those
issues
and
closes
that
issues.
B
Yeah
yeah
it's
a
little
checkboxes
make
it
a
little
harder
to
know
who's
working
on
what
before
they've
completed
it.
That's
for
sure,
but
yeah.
Okay,
so.
B
Oh
yeah
I
think
I
am
happy
with
either
a
path.
I
would
say.
I
was
first
gonna
because
you
were
saying,
let's
find
a
cop.
That
does
something
similar
and
so
I
was
thinking.
What
are
we
even
doing
here
because
I,
like
I,
had
that
one
idea
of
counting
the
number
so
the
way
you
can
count
the
number
of
abilities?
Oh,
my
gosh
I
have
so
many
cabs
open
that
are
all
just
the
same
thing.
B
Where
is
it
here?
So
if
you,
you
can
call
ability
map
and
that
will
give,
and
then
the
map
is,
is
a
hash.
So,
let's
look
at
this.
It's
really
quick
wrote
the
decision
to
get
ideas
because
there's
one
idea,
which
is
we
actually
look
at
the
number
of
ability,
like
hash
keys,
to
tell
if
the
number
of
abilities
there
are
and
compare
that
on
Master
versus
the
current,
or
we
can
just
say
like
if
anybody
makes
a
change
to
the
group
policy
file
and
adds
a
line.
B
So
these
are
all
of
our
abilities
and
so
I
guess
the
idea
here
and
then,
if
we
did,
that
map
dot
length,
there's
353
items,
and
so
we
could
say
if
the
number
goes
up
to
354.
We
raise
an
error.
B
D
Yeah
with
the
RoboCop
stuff,
I'm,
not
sure
how
easy
it
is
to
do
the
thing
of
like
comparing
to
the
the
Upstream,
like
that's
more
of
a
contextual
thing,
I.
C
D
B
B
B
B
I
guess
the
other,
like
the
dumbest
approach
in
terms
of
like
easiest,
would
be
to
just
hard
code,
the
current
number
of
policies
and
then
raise
if
the
number
changes
and
then
Force
the
person.
Anyone
who
creates
who
removes
the
policy
to
change
that
number.
B
D
B
B
B
Okay,
great
I,
love
that
so
anyone
have
a
vote
for
looking
at
the
river
cop
docs
versus
looking
at
our
existing
cops
I.
D
B
A
A
D
D
B
B
B
D
D
B
Okay
so,
which
so
director
are
you
gonna?
Add
this
into
RoboCop
cop.
D
Well,
where
do
the
what's
the
module
hierarchy
of.
B
B
B
C
You
could
try
to
have
a
look
at
the
code
reuse
because
I'm
I
had
to
look
at
it
and
it's
checking
the
part
of
the
file
it
looks
like
and
then
it's
also
checking
accessing
the
instance
of
the
class
inside
that
file.
Maybe.
B
C
C
A
It
looks
like
the
one
that
we
were
looking
at.
The
policy
rule
has
a
return
on
Line
39
that
it
looks
at
lines
that
have
that
rule
like
a
method.
It's
using
that
rule
a
method
called
Rule
and
that's.
Oh,
it's
figuring
out.
So
that's
pause.
Okay,
okay,
cool
I,
don't
know
if
that
will
work
exactly
what
we
need.
I
wonder
if
what
Marcus
suggested
with
that
and
combined
with
that.
B
Yeah
we
want
it
to
be
specifically
for
project
policy.
We
might
want
this
for
like
a
few
different
like
for
group
policy
as
well,
for
example,
but
I
think
we
could
start
with
just
project
policy,
so
we
wouldn't
want
it
to
be
on
any
rule
method,
but
we
could.
It
seems
like
if
we
re,
if
we
use
this
in
finder
method,
which
then
in
app
directory,
like
there's,
probably
names.
B
And
like.
B
B
D
B
Yes,
project
policy
being
yeah,
yeah
I
mean
I,
hardly
do
but
project
policy
itself
would
have
to
be
modified
for
us
to
be
adding
a
new
ability
to
project
policy.
Okay,.
D
B
Group
project
Merkel
may
be
a
good
idea.
Group
project
consolidation,
you
name
space,
something.
C
B
I
have
a
policy
consolidation
like.
B
D
D
D
Give
you
a
tour
and
I
have
like.
If
you
go
to
my
my
gitlab
profile
page
and
my
readme,
there's.
C
A
D
C
A
well
I
actually
was
able
to
set
up
debugging
on
Visual
Studio
code,
so
I
was
able
to
debug
back-end
stuff
on
that.
D
Yeah
it's
great
like
I've
used
IDs.
Basically,
almost
since
there
there
were
Ides
the
early
days
of
visual
age,
but
the
thing
I
like
most
about
jetbrains
is
when
I
change
ecosystems
like
I'm
writing,
go
which
I
don't
know
like
I'm,
very
productive,
because
I
completely
understand
the
editor
environment.
I
don't
have
to
find
all
the
plugins
and
that
for.
D
C
D
B
B
I
know
I,
know
I'm
a
dinosaur
here,
gotta
modernize,
my
wife.
So
do
we
think
we
use
on
class
or
on
block
or
do
we
have
to
go
to
the
docs?
Now.
B
B
D
D
So
ability
map
is
a
a
class
method,
so
it
would
be
like
on
node
and
whatever
the
RoboCop
DSL
is
like
to
match
that
class
method.
Then
you
would
I,
don't
know,
maybe
I
honestly
I,
don't
know.
This
is
the
point
at
which,
like
I'm
I,.
B
A
D
So
this
is
probably
like
General
rules
for
how
we
do
it,
but
like
just
basically,
you
might
just
want
to
read
the
and
15
minutes
or
half
hour
with
the
RoboCop
touch
themselves
and
the
tutorial
to
understand.
B
Remember
looking
at
this
thing,
what
is
this
okay
cool?
So
this
is
how
you
do
the
matching.
D
A
I
think
we
can,
we
can
finish
up,
but
thanks
for
all
the
good
discussion,
everyone,
this
is
cool.
Yeah
I
want
to
see
what
gets
created
out
of
this
yeah.