►
Description
Ticket: https://gitlab.com/gitlab-org/incubation-engineering/ai-assist/meta/-/issues/13
A
Hello,
welcome
back
to
another
update
of
ai
assist.
Let's
talk
about
doctor
today.
So
doctor
is
the
product
that
I've
been
working
on
for
the
last
couple
of
weeks
today
I
will
explain
what
it
is,
how
it
works
and
also
how
it
fits
into
gitlab.
So
at
first
glance
it
might
seem
that
doctor
has
a
linter,
but
it
goes
a
bit
further
than
a
linter.
A
What
it
tries
to
do
is
build
secure
images,
smaller
images
as
well
in
the
future,
build
it
faster,
follow
best
practices
and
pretty
format
your
dockerfile,
so
it
has
a
lot
of
s
aspects
of
a
linter,
but
it
goes
one
step
further.
So
just
as
a
quick
recap
of
what
it
does
normally
a
linter,
you
would
say:
okay,
we'll
give
it
a
a
a
docker
file
in
this
case,
we're
going
to
give
it
a
full,
a
very
faulty
one,
and
what
happens?
Is
we
get
a
bunch
of
warnings,
foundations
of
rules?
A
A
However,
what
we
can
also
do
is
we
can
correct
these
docker
files,
so
in
this
case
I've,
given
it
the
s
command
and
now
it
will
give
us
the
new
dockerfile.
This
is
the
new
dockerfile
and
it
will
basically
write
down
everything
how
it
should
be
and
most
of
the
rule
variations
are
automatically
corrected.
So,
if
I
give
it
a
minus
w,
it'll
actually
write
it
to
the
file.
A
We
can
actually
see
all
of
the
differences,
so
in
this
case
we
had
a
violation
of
where
is
it
yeah
this
one
chain
multiple
run
instructions
together
to
reduce
the
number
of
layers
and
size
of
the
image.
So
here
we
have
two
times
the
run
instruction,
and
now
what
has
happened?
It
has
become
one
instruction
run
and
it
has
chained
all
of
the
commands
together,
but
probably
in
a
future
version.
We
could
optimize
these
commands
as
well,
but
for
now
this
is
the
first
step
in
actually
reducing
the
layer
size.
A
A
Well,
in
this
case,
that
is
not
what
was
happening,
so
we
changed
it
to
copy
other
than
that.
Some
formatting,
like
a
new
line
between
an
instruction
and
a
comment,
and
also
changing
grouping
labels,
for
example
together
and
the
copies
there's
a
bunch
more
formatting
and
rules
that
is
applied,
though
they
don't
apply
to
this
specific
one.
Now,
let's
see
how
this
integrates
into
gitlab
in
a
ci
flaw,
so
I
have
a
project
called
playground
and
what
I've
done
is
I
created
a
new
commit
and
basically
it
integrates
doctor
into
it.
A
A
We
see
that
the
code
quality
report
has
been
written
to
a
location
and
the
new
dockerfile
is
written
to
the
dockerfile
that
we
were
analyzing.
So
since
it's
filled,
we
are
running
an
afterscript
command
and
that
adds
the
docker
file
to
to
our.
That
stage
is
the
dockerfile
and
it
commits
it
with
implement
fixes
from
doctor.
It
then
pushes
it
to
a
doctor
branch
and
creates
a
merge
request.
A
So
if
I
go
to
that
merge
request,
I
can
go
to
changes
and
I
can
actually
see
all
of
the
changes
that
were
suggested
by
docker
in
this
merge
request.
So,
basically
now
I
have
other
fixing
of
issues
that
were
found
so
now
I
can
just
merge
this,
and
in
this
case
my
pipeline
will
still
be
failing,
because
I
have
more
issues
than
it
could
be
resolved
automatically,
but
that's
at
least
how
I
think
we
can
help
developers
write
more
secure
code
by
integrating
our
tools
in
this
case.