00:00:13.599
hi I'm Cosmo Martinez and I work at UC Berkeley Berkeley it and I'm going to talk to you today about converting your
00:00:19.840
Oracle rails applications to postrest rails applications all right let's get into it this is essentially just an
00:00:26.679
extract transform and load process uh so so of course there's a little bit of
00:00:31.880
pre-work that you have to do uh one you got to switch out your driver gems and use PG instead of OC uh you've got to
00:00:39.399
update your schema and migrations make sure you're using the right buckets for all your data uh then you might need to
00:00:44.760
change the um like for instance integers don't have limits anymore only strings do uh first test out your app with no
00:00:52.359
data make sure it boots up all right and then try putting some data in there and seeing how it works you'll find a lot of
00:00:58.559
errors that way and do it all over again for production so first step you need to
00:01:04.360
extract your data and this is going to be in like you know your models your joint tables and then other external
00:01:11.240
tables you have to figure out a plan for that like maybe you're going to use Oracle forign data wrapper which is a postgress extension let you to connect
00:01:17.320
to Oracle from a postr database um so this is an example model table and like
00:01:23.040
we've got some binary data we've got some you know strings some dates some numbers um we're going to have to get
00:01:28.439
all that in the same way in the same form to our postrest database uh without
00:01:34.240
any losses so one thing you can do is uh you can you can use Ruby to do that
00:01:40.600
which is awesome so you got to make sure that your your data is in the right format for postgress after it comes out
00:01:47.399
of Oracle and you got to change raw queries in your application wherever using like raw queries that talk to the
00:01:53.719
Oracle database and PG plsql change that to p uh PG P PG SQL and then step three
00:02:00.840
you want to load the data so that means um you know taking it up taking it out and creating objects and inserting them
00:02:08.679
uh performing any appropriate reorganization maybe you found out okay maybe it's not a good idea to St that
00:02:14.400
Big Blob in a b in a bite a uh column maybe you should use the active storage attachment um so that's that's the time
00:02:20.959
that you would do that and then update your sequences so you don't have any conflicts um and then I almost want to
00:02:27.080
remind everyone all data is serial uh this is this might be a picture of a cat but in reality it's a 16 page essay in
00:02:33.560
binary you know um it this what you're seeing on the left is what a program is
00:02:38.599
made to show you from Reading what's on the right uh and so we're going to use
00:02:43.640
that principle here in in this technique so we're going to use active record for extraction we're going to pull our data
00:02:48.760
out like this is a user uh instance of a user model and uh then we're going to
00:02:54.800
use Ruby Marshall to turn that into serialized binary data and uh this is a
00:03:01.519
representation of that Ruby object it'll be the same no matter whether you pulled it from Oracle or postgress that's what
00:03:07.239
we're going to use here and we're going to use avra which is a data serialization uh format to store that
00:03:12.959
information store those Marshall Blobs of objects sequentially so that we don't run into memory issues when we're doing
00:03:19.720
dealing with large amounts of data uh and we're going to do that we're going to extract all that and then we're going
00:03:26.080
to reverse the process using Avro to Read that read those archives and then reading those records one by one in Ruby
00:03:32.959
and creating using Marshall load to like resurrect those objects from their
00:03:38.000
reanimate State and then insert those records there we
00:03:47.040
go gonna go fast a lot of talks Etc as we grow older we start noticing
00:03:53.360
patterns and behavior culture and Technology i' like seeing uh history repeat itself often with a modern twist
00:03:59.280
naming these patterns allows us to communicate a complex subject with a short cryptic representation like
00:04:04.640
Fibonacci uh as a kid you may have tried to outsmart your parents by hiding behind a curtain uh but your parents
00:04:09.680
knew how do they know if they Expos feet didn't give you away the lump in the curtain and the backlit Shadow surely
00:04:15.599
did uh many things in life are represented by patterns that once learned we come to
00:04:21.280
expect understanding these patterns gives us the power to create change by understanding them we can build more
00:04:26.639
inclusive accessible net Equitable futures each wave helps to define the shape of the shore uh fashion is a super
00:04:33.600
visible example of cyclical patterns I wore a p pair of baggy cargo jeans just like this in high school these are for
00:04:40.360
sale today on the Pacific Sun website if you don't know what Pacific Sun is you probably didn't go to school in the 90s
00:04:46.600
uh Cycles occur due to Nostalgia and the desire for inclusivity Trends evolve to
00:04:51.680
include diverse body types genders and cultures uh another example of this is comedy it's ch challenged Norms
00:04:57.080
throughout history often moving from controversial to mainstream Lenny Bruce in the 50s and 60s push
00:05:02.320
boundaries uh on taboo subjects got arrested for obscenity his obscenity was
00:05:07.520
making fun of the Catholic Church uh something that seems like a national P Pastime these
00:05:12.759
days so uh Joan Rivers in the 80s and 90s uh also pushed and expanded boundaries normalizing with people who
00:05:19.199
look like her on stage could say uh using biting biting sarcasm quick wit
00:05:24.319
sequins boas form fitting outfits even surgery to make her look on the outside more like she felt on the inside
00:05:30.199
uh if we fast forward from the '90s of the future what might that look like Oh wait we're here right so uh I think
00:05:36.600
today drag performers continue this cycle pushing societal norms and advocating for
00:05:41.720
lgbtq those rights uh the cycles that preceded them uh made it possible for
00:05:47.720
these uh performers to succeed and I posit that we'll look back uh in the future and think about these folks the
00:05:52.919
same way we're at technology conference though let's talk about uh uh technology tablets who remembers
00:06:02.639
the first commercially available uh tablet anyone you shout it
00:06:08.360
out of course I'm talking about 1989's grid
00:06:13.440
pad which was very expensive had the option of one or two Mega of memory and
00:06:18.560
battery life was around an hour uh from what I told I never worked with on myself um another example evolution of
00:06:26.080
uh communication technology uh so cave pointings are The Original pointto Point communication you would go to that point
00:06:32.319
and you would point at it um eventually paper and printing whatever we're in Colorado let's Jump Ahead to the Pony
00:06:38.000
Express uh you would you're able to take a rich full document and communicate that over pointto Point uh Pony pony I
00:06:48.080
don't have much time 50 years 70 years 140 years how long did the Pony Express last 18 months
00:06:55.400
that's right uh so and the reason that it uh it is no longer is because the
00:07:01.080
railroad was coming through and alongside the railroad were transmission lines which allowed instant communication instant messages maybe um
00:07:09.360
brief messages uh that were simple representations of complex messages uh
00:07:15.039
and then eventually we use those same networks for phone communication uh which allow you know uh you to hear
00:07:20.400
people vocal intonation so back to Rich messaging and then eventually we got
00:07:25.960
these things everybody you have a page boy just me all right old uh um this
00:07:31.000
literally had uh one message which was you have messages go check them uh
00:07:36.919
eventually it evolved to include LCD uh displays capable of displaying short cryptic messages of text we call them
00:07:43.160
text messages um and then eventually we got those on the phone alongside the uh
00:07:48.560
the rich communication of voice um this is the first Nokia phone that had an LCD
00:07:53.879
screen um does anybody know what the first message was Merry Christmas
00:08:00.319
um and then eventually we use those same patterns to get uh Twitter which short
00:08:06.840
cryptic messages anybody uh which was text only at the time now it's evolved to include uh all sorts of media live
00:08:14.919
Fascism and whatnot um so these Cycles are very human and
00:08:20.759
that's probably because they are based on patterns we as humans recognizing them uh from uh early adoption to uh
00:08:29.960
sorry from birth to adoption like the grid pad to maturation they become essential like today's iPad um and then
00:08:37.399
eventual decline when Technologies age they give away to new Innovations uh by recognizing these stages we can better
00:08:43.360
understand where we are within the cycle uh learn from the past build
00:08:57.200
with brand new box uh you might want want to set some context for this talk which is just about brand new box uh we
00:09:03.560
are a small rails agency there's just eight of us uh we are completely remote and that means that today we are based
00:09:11.079
in this is not going to work because I'm on a different screen
00:09:16.279
uh today we are based in Central Kansas well that kind of makes sense we're kind
00:09:21.760
of a remote company so turns out if you distribute people across the US you get Kansas for the
00:09:28.079
center uh the other thing about brand new box is uh we manage about 50 rails
00:09:33.720
apps in production across 35 different repos and that's kind of a difficult
00:09:39.720
thing um the microservices people kind of laugh at us because that's a tiny number but generally that's a lot and
00:09:45.040
like this ranges across a big uh gamut of Industry so we have we're supporting
00:09:50.320
nun singing the Gregorian chant in a monastery e-commerce home visitors visiting people in the field um americ
00:09:56.920
Americans with Disability Act recipients and the thing that these people all have
00:10:01.959
in common is none of them are tech companies um so they don't want to manage their application we kind of
00:10:09.360
begrudgingly will manage their application but uh that's hard to do and so we have created this tool called via
00:10:15.839
stands for very integrated analysis sucky acronym but uh I was in an acronymic mood when we came up with this
00:10:21.560
a few years ago and let's see can we demo via uh okay here's via this is this
00:10:29.360
is every one of brand new Box's repositories and it's a dashboard of what is happening with each of those
00:10:35.240
repositories so every time a push goes up we run some static analysis checks on them to say hey are uh are you following
00:10:42.160
all of our best practices um and so for every repository we get this red and green dashboard of are you passing all
00:10:49.480
of the checks here um these checks are a lot of fun they're just they're managed
00:10:54.519
right here in this interface um you can you can see all of them here so for
00:11:00.639
instance I heard that I should install Honeybadger at this thing
00:11:07.040
um so if I want to say figure out across my entire Suite of
00:11:14.680
applications this is hard to do far away but um there's just a little this is the
00:11:19.959
Ruby part of it there's a little Ruby DSL here um that will tell you that
00:11:26.040
you're able to configure sorry oh okay
00:11:31.440
uh yeah I should make this bigger but yeah do we have the honey badger gym
00:11:37.120
installed I think I can do that present I don't really remember um actually let me make sure if
00:11:45.000
let's go ahead and fail that if it's not the case uh so now we've got a new check we need to uh see how that's going to
00:11:52.560
operate across all of our repositories so this is our health check dashboard um and it's now going to start running
00:11:59.240
running all of our checks against every single one of our repositories that's obviously kind of a where did Honey Badger go oh it hasn't
00:12:07.120
run yet oh oh no I've done the wrong thing we're all good we're all good uh
00:12:14.079
these checks are organized into a suite of checks um so I need to come in
00:12:20.839
here we're going to put this right next to the Sentry check which is kind of awkward
00:12:31.839
yeah there you go uh so that is our new uh so now that's part of the check
00:12:37.800
suite that gets run across all of these repositories um and that's going to
00:12:43.120
start telling us there we go it's right at the beginning we're g to I mean we're going to get a big red thing because we
00:12:48.199
haven't installed honey badger on all of our uh repositories yet and so this is
00:12:54.839
how this is how brand new box and I can actually come in here uh and I get this kind of the same like
00:13:02.639
for a specific check I can now hand this off to one of my developers and I can say like hey we need all of these
00:13:08.120
repositories to be green because this is a new policy that we're implementing um so this is how brand new box kind of
00:13:14.120
manages and make sure that makes sure that all of our applications uh are on
00:13:19.519
the newest version um You
00:13:24.639
probably what do I want to see here uh
00:13:30.480
rails I mean the nice thing yeah here we go uh you can also send messages out of these so we can see like hey exactly
00:13:36.839
which version of rails are all of these on we definitely need to do some updates on some of our applications but it's
00:13:42.120
whatever um yeah that's via that's what we use to manage all of our applications I'm giving this talk because I don't
00:13:48.240
want to finish writing this thing can somebody tell me like what's the tool that I can actually just use that already exists and I can pay for to do
00:13:53.800
this because I don't want to finish this product so if you know send me messages uh email Twitter mastedon whatever like
00:14:06.560
you I'm TJ um I've been using Ruby at work uh for a living since 1995 yes yes
00:14:15.160
1995 um haven't been to one of these Ruby conferences in a long time until Ruby comp this year I did go to that one again my my really good friend Jeremy
00:14:21.399
gave a talk there and I I heard of some someone talk about Roa here which is cool I love this conference um it seems
00:14:27.639
like everyone's not talking about rails which when I tell someone I do Ruby and
00:14:32.680
they say rails I go no I don't do rail I've never done rails I started Ruby because I was doing systems
00:14:37.880
Administration and I didn't like Pearl and my friend who lived in Japan found this brand new language Ruby was like it
00:14:44.240
kind of does all the same stuff Pearl doesn't so I got in on it I didn't care it was slow Pearl was slow none of that mattered at the time none of this stuff
00:14:50.440
where people say you shouldn't do Ruby mattered at that time so I got in it um okay fast forward we're a long time
00:14:56.240
later I'm trying to get under my five minutes uh we're doing distribut stuff now who here works with only one programming language at their job
00:15:03.240
anybody many microservices you got things you talk to things I want I talk to you all this stuff so you got Json
00:15:09.519
RPC I can name a million things and this is the ways that someone said you have to speak with this other thing um found
00:15:16.000
this deal about a year ago called Dapper DPR D apr. I don't have to show the slide for you to remember
00:15:22.199
D.O look it up it's got 13 components made for distributed systems you've got a distributed lock you've got Pub sub
00:15:29.040
you've got all of these things and all you have to do as an application developer is just sign up I want Dapper
00:15:35.440
and then you say I'm going to use this Pub sub for this thing I was going to show you two or three lines of Ruby they gave you a distributed lock but if I say
00:15:42.360
two or three lines of Ruby you know what I mean it's that easy um for all of the things that you might not all of the things but it's got 13 components um the
00:15:50.120
thing is a year ago when I got into it I'm like this is great and we use go and we use a few of languages that work it didn't have a ruby SDK so
00:15:59.360
and I'd only gotten back into Ruby because I'd been doing devops and you know all that infrastructure side of thing for a while so I wrote my first
00:16:04.480
gem about a year ago the Dapper ruby gem for the Dapper Ruby client we now have a Dapper Ruby SDK I need help I've got
00:16:11.160
three of the 13 components done please help please help build this Dapper Ruby out because it's great every all these
00:16:17.279
other languages can talk to it just as simply um and you don't have to worry about whether you're talking to go or
00:16:22.920
this thing or you want to propose an API your contracts it uses a cloud event which that's your contract for talking to everything else really good it's got
00:16:29.440
a spec all on its own and many things use it um go for it take a look at Dapper it's worth it and if you want to
00:16:35.160
do dapper and work on this thing uh prize picks the company I work for definitely hiring for this thing right
00:16:46.800
it okay um so I'm going to talk about doc linting with Ruby uh I work for Dev
00:16:52.800
tools company uh we're like off zero but better and we have a lot of docs and we
00:16:59.000
tend to use automation to improve our docs these are things that are kind of out of the box like link Checkers or
00:17:05.319
Veil which is really cool even though it's written go it's a very cool like way to lint your Pros to make sure
00:17:12.120
you're not using weasel words and things like that um to some more custom ones like we put GitHub issues in our docs
00:17:19.959
and when they get closed we should remove them from our docs um and so I wrote a little script to do that anyway
00:17:26.000
I also wrote one that uh helps lint our API docs um we're API we're an API first
00:17:32.440
product our admin UI and other applications use our apis and when we expand the product we you know add new
00:17:40.240
fields or entire entire new apis sometimes the docs don't track what the
00:17:46.000
code has done however even though we don't autogenerate our docs we do autogenerate our sdks and that gives us
00:17:54.559
something like oh my gosh sorry need move this down there we are
00:18:00.280
so we basically ingest Java and sorry um
00:18:05.440
that's two strikes right um we ingest Java and turn it into Json and then we can actually take this Json and with
00:18:12.320
Ruby we can compare that to our docks to see that all fields that are present in
00:18:19.000
the Json which is what our code uses are also present in the docks and so we do
00:18:24.320
that with Ruby um I picked Ruby because I like Ruby um because it this is a
00:18:31.440
script that runs that uh it fits nicely into our GitHub workflows and we also
00:18:37.960
ingest HTML and Ruby I actually come from Pearl myself way back when and Ruby
00:18:44.159
seemed like a natural fit for solving this problem um and how it works is again we uh pull from this set of conf
00:18:52.480
Json configuration and you can see some of this stuff like name is oh gosh is
00:18:58.840
simple and then other stuff is kind of more nested objects and our API docs
00:19:04.400
have the same same similar format and so basically I iterate the Json I then
00:19:10.880
build um the uh URL which again is kind of well
00:19:17.280
formed so even if a do our docs are created manually they're at least consistent and then I look on that page
00:19:24.280
for all the fields that should be in that um I think that this is interesting
00:19:30.159
from like vaguely interesting from a ruby perspective but it's really interesting from like a GSD perspective
00:19:36.960
it's not perfect because if a field is present one time on this page it will
00:19:45.080
pass my linting but it might need to be present on multiple pages but it is way
00:19:50.960
better than what was there before which was basically omitted Fields um and it's definitely caught
00:19:56.960
issues as we've done new releases so that is all I have if you want to
00:20:02.720
learn more about Fusion o or read some of our copious documentation I think we
00:20:08.159
have five or 600 pages of documentation last time I checked um check it out so
00:20:14.679
thank you all right so since TJ did not want
00:20:22.120
to talk about rails I'll talk about rails so I'm going to tell you a little bit about turb morphing um by the way
00:20:29.320
I'm Ron chanal nice to see you guys so we rolled out turbo morphing as quickly
00:20:34.480
as we could I have to work on the full stack I prefer to work on the API but
00:20:39.799
every now and then you have to do something on the front end and turbo morphing is something that really helped out with that process so it's kind of
00:20:47.039
the question of why even bother what's the big deal why is everybody talking about it well the nice thing is you get partial page
00:20:53.000
updates on your front end without all the complexity that you're used to having so basically you post to the
00:20:59.640
server it redirects to the Happy path the morphing engine takes care of everything else which is right now is
00:21:06.559
idiomorph is what they're using on this and then there's no full page reload so it's really fast you get the benefits of
00:21:14.080
doing all the little pieces but it's just simple could be one line of code it just
00:21:19.520
really helps minimize the clutter in the code base to say it another way Jorge man
00:21:25.760
rubia did a blog post and there's a link to that if you guys want to see that where is it's basically about developer
00:21:31.440
happiness like if we don't have to jump through the hoops and we can just write less code and get good results or better
00:21:37.600
results uh let's do it so how do you go about getting turbo morphing you need
00:21:44.720
turbo 8 which at this point is rail 7.1 or higher uh you need a meta tag to tell
00:21:50.559
it tell your application how to handle the morphing and then if you want to do things like maintain the scroll position
00:21:56.679
on your page you can add another meta metat tag for that that works out really great like I that can get in the way
00:22:04.159
sometimes but the maintaining the scroll condition position in itself is just a really nice little freebie that you can
00:22:11.559
get with it so what are some of the gotas that we came across when doing this
00:22:17.720
um our app has code that I think is as old as maybe
00:22:23.760
2013 2012 somewhere in that range so we have sort ort of a combination of
00:22:30.799
there's some coffee script and there's some JavaScript and uh there's plain old turbo frames and kind of a whole mix of
00:22:38.159
things that spans all these various years and so we turned on turbo everywhere when we turned it on and then
00:22:44.559
we had to go in and selectively disable it in various different places because it would mess up the coffee script or
00:22:50.520
something like that would happen so look out for places where you've explicitly disabled it because guess what it
00:22:56.039
doesn't work if youve turned it off in the div the top of the page and you're trying to do something down in the
00:23:01.400
middle another one that that uh you have to look out for is link twos will not
00:23:06.480
work for morphing because it requires a post to the server so link to is just a get and that's not going to work so you
00:23:13.559
can strip out all the link toos and replace those with button toos and take care of that issue the other ones uh you need to post
00:23:20.520
to the top of the document not just like within a frame or something like that uh
00:23:25.919
so you may have to do some things like this if you're working with a turbo frame and you need to just post to the
00:23:31.240
top of the document to make sure that you don't run any problems with that the other thing that gets a little funky is modals because sometimes they'll stay on
00:23:38.480
the page sometimes they'll go away when you want them to stay and it's just all kinds of weird stuff that happens so you
00:23:43.520
may need to figure out some things with showing it or hiding it or removing it like if you need to upload a document you want your modal to go away but not
00:23:50.760
be visible but still exist uh you can work through some things like that and kind of figure out how to get it to work
00:23:56.559
the way you need it to and so a couple couple things that just to remember about it uh rendering whatever action
00:24:03.000
gives you the same benefit as redirecting to whatever path um you may
00:24:08.559
need to use a remote form we had scenarios where we had a form and then we needed to take one of these um
00:24:15.039
actions that we wanted to do a a complete page reload or Turbo morph and so we just had to tell that to go to a
00:24:21.159
remote form because the link no longer works like I mentioned before um you may
00:24:26.399
need to conditionally prevent form feels from being updated because it will just nuke everything and there's a tag for
00:24:32.679
that and you may want to disable instant click that is not a tur a a morphing thing but it comes with turbo8 and so
00:24:40.320
you may not want that to happen and you can use Dev tools for Network throttling to slow it down because it is really
00:24:46.840
fast and then there's that new Hotwire Dev tools extension that Marco mentioned but pick the tool that writes
00:24:53.360
for you it could be morphing could be a turbo frame could be a turbo stream
00:24:58.840
and enjoy the purge you get to get rid of all this stuff when you do it that's
00:25:07.799
it I'm Dan Fitzpatrick I wrote this framework called wax which I've been using for a long long time anyway it's
00:25:15.559
not a nothing against rails but I don't like rails no no offense to all you
00:25:20.880
people who love rails so this is a uh this is rest and RPC had a baby and it's
00:25:28.640
wax and wax is a it's kind of a rest uh
00:25:34.399
way of doing rpcs and it spits out all these different kind of stuff I buil
00:25:41.000
Enterprise applications for Fortune 500 companies and some startups and I build
00:25:46.960
huge systems that are super complex so this is uh made to make that easy and
00:25:53.600
it's very fast so it's it's functional programming there's no classes
00:25:59.200
I can get about 8,000 requests per second on a CPU uh there's no routes everything is
00:26:05.399
done by calling functions and my biggest system I built has 1,800 tables and 2200 DB views that
00:26:13.480
this thing talks to in one monolith basically um it's very easy to
00:26:19.320
maintain and it includes a whole uh access control
00:26:24.880
system so basically the uh there's no classes like I said you route to these
00:26:31.039
Runners and a runner is a just a hash a description access control and then
00:26:39.039
functions for all those different HTP methods So when you say get person list
00:26:45.320
there's a module which is an app person there's a list Runner and then there's a
00:26:51.080
get method which is an anonymous function and you go get the data and then you render
00:26:56.440
it and then this is a a put so you pass in after the person record you pass in
00:27:03.120
one two three which maps to the ID down here and then the key is the next thing
00:27:09.840
so it's basically you're calling functions with your URL and then it has views which are like
00:27:17.520
they basically map to database views and tables they're not like rails views and
00:27:23.039
then on your view you list all the fields that are on your view and you can just say get the data from this view for
00:27:30.919
this ID or this query or whatever and it has these you basically
00:27:36.720
create a view and all of this stuff is included automatically if you want it to be you got to say you know display it as
00:27:43.559
these different things but it's basically for basically business applications you can use it for blogs or
00:27:49.559
whatever else you want and uh anyway that's wax oh I do want to say I do want
00:27:55.559
to throw this up so this is how you do functional program and Ruby instead of having a class you just use modules you
00:28:03.000
extend self and then you define your functions and then down here you
00:28:08.559
basically just say fruit. getet 2 and it calls that so from anywhere in your app
00:28:14.440
you can just have a the module is just a namespace so you can have the same
00:28:20.360
function names all over your app but they're in a different Nam space and then with functional programming I I say
00:28:28.120
say fruit. eat and it's uh something that came out of the
00:28:33.799
fruit module but I can also just pass in a hash because that's all it is so you
00:28:38.840
can use these functions all over your your app and they'll behave however you
00:28:45.200
make your function app uh work anyway that's wax so
00:28:56.120
before during lunch so very you go
00:29:02.960
all right my name is Ryan STL um I'm out of turning 2102 so T is a great school
00:29:09.760
gave me a good start uh I've been three and a half years at a company called
00:29:15.440
software this right here is my baby his name is J uh any guesses of
00:29:24.240
breed no he's pure bread now he's pink belly 100% pink
00:29:32.120
belly it's um I don't know if it's like a like an albino thing but every day I
00:29:37.559
kiss his little pink belly and uh gives me a little bit of magic as I'm
00:29:43.760
coding so uh this slide or this presentation isn't about my baby it's about my children um so I'm three and a
00:29:51.080
half years out of Turing anybody want to take a guess how many children zero no
00:29:56.399
300 close 108 children right now uh 976 are in
00:30:05.720
production uh that's pretty impressive that's 976 bugless children in
00:30:10.960
production there's a few that had bugs but those were step children actually children so this is
00:30:17.600
just an example what it looks like when you look at our GitHub for our company just a long list of my children so
00:30:28.240
78 correction there so um I started thinking of my like contributions as
00:30:34.080
children because uh I noticed I had a few co-workers that had some poll requests and I wasn't sure if they were
00:30:39.720
taking them seriously so I tried to lay it out for them why I think um like you can think of it this way and
00:30:47.480
you will care a little bit more about your your poll request as they're making it through so obviously the first step is conception right so there's a couple
00:30:54.679
different reasons why you might start with a poll request um there's obviously a to-do list when you go to work you
00:31:01.279
might just have like a good idea you um you might have like an itch that you want to scratch or maybe you need to
00:31:08.039
rebuttal a coworker and and prove a point right so this is where they come from the next phase is a secret and I
00:31:15.279
think anyone with children knows that there's there's a part where maybe you're you haven't released this work
00:31:20.679
that you've put in for a child right so um you know you're you're figuring out
00:31:26.840
is the code I'm working on is it worthwhile does it make any sense and then at some point you uh you decide to
00:31:33.039
have a reveal right so this is where you push your code up and um at this point
00:31:38.679
it's time to like drop your ego a little bit right like uh you want your
00:31:44.200
co-workers to take a look at this and give them as much feedback as possible right so stay humble and know that
00:31:51.240
people are going to pick on your children a little bit right so it might be time to uh just listen to their
00:31:57.240
criticism and and move forward so know that there are going to be obstacles
00:32:02.440
right there's going to be obstacles and the way that I approach the obstacles when people are dealing with my children
00:32:08.639
is uh I like to hover but also surrender so by hovering I'm kind of like um you
00:32:15.720
know constantly responding and if if I have good feedback I'll make those changes and then push that up but at
00:32:22.120
times uh opinions are strong and it really helps at times if you can surrender a little bit to those opinions
00:32:31.000
right when you get a green on your on your poll request go ahead and merge it uh even if you think there might still
00:32:37.120
be problems right because if you merge that and there are problems everybody will have to come in and join you to
00:32:44.360
know fix those problems so before you were working on something alone and now you have like a collective group of
00:32:50.760
people that are helping you fix the problems before it goes to production right so um yeah that'll suck the team
00:32:57.960
in quick um so in summary uh just like
00:33:04.200
raising a children it takes a village right to to get PLL requests into your
00:33:09.880
code base and you want everybody involved um another suggestion is
00:33:15.080
multiply your children right like don't put up a poll request with 20 commits break that out into 20 children and work
00:33:23.679
really hard to get each one of those in because if your coworker can view something really fast then you can get
00:33:29.919
the green and just merge that um another good point is you don't want to let uh
00:33:35.799
your good commits suffer from your bad commits this has happened to me often early in my career I have a commit that
00:33:42.679
nobody's objecting to it looks really good and I'd love to see that get into the code base but because the commit
00:33:48.000
right after is terrible that PR will sit up you know for a while so um create as
00:33:54.639
many as possible and do whatever you can to get them into production so thank
00:34:03.760
you hey y'all I'm Davis um I I'm one of those Juniors that's trying to land on the moon so uh love to talk after
00:34:11.760
presentation I'm also this is my first lightning talk so I'm freaking
00:34:17.440
out uh thank you uh internet's kind of shabby so I downloaded a PDF uh let's do
00:34:23.800
this thing um so I'm going to talk a bit about rails Docker and development um basic containerization for development
00:34:30.399
um and compos as well let's get going um recently last six six to eight months
00:34:36.919
I've been working in Docker professionally and personally um I think it's awesome it's it provides consistency quick setups kind of BS I
00:34:44.359
don't know why I put that in there it's never quick uh stupid okay so moving on uh the idea
00:34:54.079
here is that rail 7 plus will generate unless you specifies other wise with a Docker file uh aimed at production and
00:35:02.000
I've looked at that file for a long time and kind of wondered like all right what's going on here you know we've got lots of very meticulous uh configuration
00:35:09.720
um one of the main things is that it's optimized for production and it lacks Live code reloading uh which is very uh
00:35:17.280
it's that's not good for development so how do we make another Docker file that we can Target development more with um
00:35:24.920
here you can see some of the things that we're doing uh one of the main things we can get rid of is asset pre-compilation
00:35:31.480
we also need to Target the development environment and uh rails is smart enough working with Docker to just Target that
00:35:37.960
environment when you're building it um also uh we're getting rid of the entry point script and just using the basic
00:35:43.680
command to do that there um and then the next thing too is also making sure that we have our dependencies back because
00:35:49.200
that's something that is uh removed in production um another aspect is setting up a quick compose file so that we can
00:35:56.079
containerize our database um one of the things that you notice here we're just targeting postgress 13 um and we're
00:36:02.040
actually providing some environment variables because when you're uh locally developing you most likely got postgress
00:36:07.359
or whatever database you're working set up there rails won't know where to look for that once you have your things
00:36:12.720
separated into containers so we need to make sure that we're pointing at our Docker app development we're also
00:36:18.960
volumizing here because we don't want to lose any development data uh while we're in when we spin the containers back down
00:36:25.680
and then of course this very ambiguous 5432 5432 with colon in the middle is just where we're targeting the
00:36:32.160
containers uh default po uh port for postgress uh because containers run in
00:36:37.880
isolation so you have to network them out and so that you can access them specifically so that web can access um
00:36:46.079
and also this is where we're going to set up Live code reloading uh this mounts the app uh and again Docker does
00:36:54.280
a great job of being verbose we have a period and a colon and that is Live code
00:36:59.599
reloading um and then also I'd love to talk more about this if
00:37:05.640
I'm totally off I I'd love to hear about it um and then here's where we actually fetch uh we set those environment
00:37:11.160
variables and we fetch them so that we can talk to our database and then we're saying hey it's volumized here uh the
00:37:16.880
final config is actually hitting the database yaml and setting that up so we can fetch them and talk to our database
00:37:24.400
um and then we got basically four more steps we build the container we have to make sure to
00:37:31.160
migrate the database so that we can actually get the schema set up and then uh we can start
00:37:36.560
the services up and then a nice way to test your database connection um is to jump into a bash session uh jump into a
00:37:43.880
rails console and then you can just check on the orm here and check your versioning uh that's it for now um i'
00:37:52.680
I'd love to talk about Docker with anybody out there um and thanks for listening
00:38:03.560
all right uh working with Legacy code uh so one of my favorite books especially
00:38:09.040
when I want some light reading is working effectively with Legacy code by Michael feathers uh this book was
00:38:14.839
mentioned by Alan and fedo yesterday so I'm glad I'm not the only fan um so I just want to talk a little bit about
00:38:20.800
working with Legacy code first question like what is Legacy code
00:38:28.720
yeah all those are are pretty right my favorite definition is code you wrote
00:38:34.280
yesterday so we all work with Legacy code regardless of how Green Field your application is all right what causes
00:38:41.480
changes in code so we have features bug fixes really anything that involves doing our job so if the code's not
00:38:47.800
changing we're out of work so we want to make changes to our code um there are two ways to make changes to code
00:38:57.720
edit and pray or cover and modify this is according to Michael feathers I have
00:39:03.079
references and citations um so how do we make changes safely uh we want to
00:39:08.280
identify our change points we want to find places we can put tests in so test points break dependencies if required
00:39:15.240
write tests because we're going to cover and modify we're not going to edit and pre and then we're going to make the
00:39:20.640
changes in refactor so some of these refactoring techniques are intermediate steps others
00:39:27.680
are like the final thing so a lot of times we have to make our code uglier to make it prettier again thank you Alan
00:39:32.880
and feto all right so I want to talk about one useful methodology uh because there
00:39:38.000
are hundreds and this one is simple so I can actually get to it in five minutes um so um a new requirement comes in it
00:39:46.119
should be done at the same time as another operation uh the way you do this is you extract the existing code into a
00:39:52.119
new method with an um with uh the an appropriate name like a specific name
00:39:57.440
you call the new method from the original method now here's the key the original method has to keep the same
00:40:02.839
public signature and now you create another new method with the new functionality so let's take a look at
00:40:08.040
some code um here we're going to process sending an invite email to new subscribers I'm not very creative so I
00:40:13.599
just like said things happen so um so things happen and we are sending
00:40:19.520
invitations to a new subscriber and our new requirement is we also want to add this new subscriber to our CRM at the
00:40:25.560
same time um so what we could do is this we just keep the old function call the
00:40:33.280
old processing add in the new functionality could do that um but it's
00:40:38.800
more maintainable to do this now the key here is the
00:40:44.560
public um the public signature is stayed the same we have I can't even see I need
00:40:51.280
glasses all right we've extracted the original functionality into a new method we're calling that new method from the
00:40:56.760
original and now the new functionality is in another method that we are also calling
00:41:02.240
from the original method so anyone who is calling into this method nothing has to change so we don't risk runtime bugs
00:41:09.119
um in production because we haven't changed anything with the external API of this function call um also don't
00:41:14.640
forget to add or modify tests um in order to match I can only get to one
00:41:19.960
there are tons there are so many including how to manage classes that get too big um I've worked on Thousand line
00:41:26.240
controllers before I don't know if you have um and so this is just one example touching surface I hope you all buy this
00:41:32.160
book uh that's an Amazon link if you want to look it up and uh we all work with Legacy code so let's have fun doing
00:41:43.599
you my name is Cindy bman and I'm the owner of confreaks We Are a video production company that specializes in
00:41:50.240
filming conferences specifically Tech events confreaks was started in 2007 by
00:41:56.680
Kobe ran Quist and Carl Youngblood you may wonder why I'm telling you all of this or wondering even more why would a
00:42:02.800
video production company want to give it a lightning talk at a ruby conference well did you know confreaks was started
00:42:09.200
because of Ruby in 2006 Kobie and Carl were attending Ruby comp in Denver Colorado
00:42:16.920
and Yuki hero Matsumoto better known as matz was the keynote speaker at the conference it was one of the earliest
00:42:23.520
conferences in the US that M spoke at about Ruby there was so much information
00:42:28.599
at this conference and matz had used nearly 400 slides in slides in his
00:42:34.240
keynote Kobe and Carl talked afterwards about how great it would have been if they could watch his talk again but the
00:42:41.079
conference wasn't recorded at the at that time this is what spurred the start of confreaks if you'd like more details
00:42:47.960
on the history of confreaks through 2016 you can watch the talk a bit of
00:42:53.000
History by Kobe ranquist that he gave at Garden City Ruby in India in 2016 so
00:42:58.800
moving on these two Ruby programmers started a side company to film Ruby
00:43:03.880
conferences which allowed them to go to more Ruby conferences for free they were
00:43:09.079
friends with those that were already putting on Ruby events and would offer to come and record them if their costs
00:43:14.720
were covered or for a deeply discounted price after several years Kobe bought
00:43:19.760
out Carl's ownership and it was a one-man show Kobe had a real job and did confs on the side it would take up to 3
00:43:26.839
months for him to edit videos for an event in his spare time so he hired me full-time at the beginning of 2012 and I
00:43:34.040
was con freak's first official employee so why did Kobe hire me well Kobe is my
00:43:40.359
brother so I needed a job I was recently divorced from a very bad 12year marriage
00:43:46.400
and I had two kids I hadn't been allowed to work while I was married so I was going to school and struggling
00:43:52.280
financially my kids and I had moved in with my parents and Kobe needed someone to edit and start working full-time
00:43:58.760
since he wasn't able to put a lot of time into confreaks his Tech job definitely was the money maker so
00:44:05.400
confreaks was more of a passion project to him by 2011 he was running two
00:44:10.800
conferences with a few friends called Ruby on El's that was in Bend Oregon and La Ruby comp Kobe introduced me to a lot
00:44:18.559
of people in the Ruby Community I got to know people like Aaron Patterson sandy Mets Katrina Owens Sarah May Jim wrick
00:44:26.079
Ryan Davis uh jonan sheffler Jim ramsi and many others the Ruby Community was really
00:44:32.040
important to Kobe and it became important to me we didn't just film events for money we filmed Tech
00:44:37.839
conferences because it meant something to us we did many conferences for the cost of flight and hotel we give
00:44:44.160
discounts to conferences that agree to release the videos to the public for free on YouTube it was important to Kobe
00:44:50.599
that people in other countries and areas where they just couldn't afford to go to a conference could still have the
00:44:56.440
opportunity to learn from these amazing events in 2013 we filmed 23 conferences
00:45:02.559
and 13 of them were Regional Ruby conferences there was La Ruby comp Ruby
00:45:07.720
on L's Mountain West Ruby comp Midwest Ruby uh goo which was Gotham Ruby lonar
00:45:13.200
Ruby Burlington Ruby Madison Ruby Rocky Mountain Ruby Buffalo Ruby Golden Gate Ruby Cascade Ruby and Ruby comp we grew
00:45:20.680
and eventually had a had four full-time employees Kobe stepped further away from confreaks in 2015 and signed the
00:45:27.599
paychecks as I took things over by 2019 we were filming 30 plus conferences a
00:45:33.520
year and the largest conference we'd ever filmed happened that year it was a 12 track conference in Nashville
00:45:38.960
Tennessee at the end of the year in 2019 I bought confr from Kobe so January 1st
00:45:45.440
of 2020 it was officially in my hands and the pandemic kit so I had to let my other employees
00:45:53.280
go and was barely able to keep things going on my own through 2020 and 2021 conf is up to filming 7 to nine
00:46:01.520
conferences a year and I'm the one employee I hire contract workers to help with larger conferences and My Hope over
00:46:08.640
the next few years is to get back to where confreaks was in 2019 my whole purpose with this
00:46:14.400
lightning talk is that I want you to know that confreaks isn't just a video production company we are part of the
00:46:19.920
Ruby Community we have filmed Ruby comp since 2007 and reals comp reals comp
00:46:26.559
since 2012 except for this year's R comp because Detroit has the tightest Union I've ever run into and we weren't
00:46:33.160
allowed to film so I did edit the unions filming though and we've filmed many
00:46:40.319
Regional Ruby and rails events throughout the years through the pandemic a lot of that knowledge has been lost so many changes to event
00:46:46.920
organizers conference boards have completely changed and not all information gets passed oh dear gets
00:46:53.160
passed on these uh conferences are important to me just as they were to my brother from the perspective of someone
00:46:59.680
that is on the outside it's an amazing Community to be a part of I have filmed
00:47:04.880
hundreds of tech conferences and the Ruby Community is my favorite you are the kindest and most supportive
00:47:10.839
community that I have seen so if you see confreaks at an event come and say hi ask questions if you're a speaker a
00:47:18.079
volunteer or an organizer and you need help with something come and ask I really do want to help confreaks is on
00:47:35.000
thanks hi again my name is still Allen and I'm still with Cisco maraki but I
00:47:40.319
want to talk to you about something completely different today I want to talk about gardening so there's this amazing quote
00:47:47.559
by Alexander danher that goes like this when a flower doesn't Bloom you fix the
00:47:53.559
environment in which it grows not the flower now when I first came across this quote
00:47:59.160
it really resonated with me deeply but there were some folks on the internet who
00:48:05.200
expressed alternative perspectives um some were of the opinion
00:48:10.559
that you should just find a different flower if the one that you have isn't thriving in your garden go get a
00:48:15.800
different one and others questioned why the flower was entitled to special
00:48:21.920
treatment other all the other flowers were doing just fine so why should we treat this one any differently
00:48:28.240
now these are valid perspectives but they both come from a fixed mindset they
00:48:33.520
assume that the garden cannot or should not be modified to meet the needs the unique needs of each individual flower
00:48:41.040
but I contend that if you want to be a successful Gardener you kind of need to take on a growth mindset I mean
00:48:48.119
literally a growth mindset um you kind of have to believe that the flower actually can bloom and
00:48:54.359
you really need to want that to happen happen which you know shouldn't be hard you chose the flower now it's this
00:49:01.559
belief that it can bloom and the desire to see it happen that should motivate
00:49:06.680
you to invest time and energy into making a space in your garden that is uniquely suited to that
00:49:12.359
flower and there are so many ways you can do that as a gardener you're empowered to change just about anything
00:49:18.079
about the garden you could fertilize the soil or not you could water the plant
00:49:23.680
regularly or not you could transplant the flower to a sunnier or shadier spot
00:49:29.960
or not but every one of those decisions or indecisions has an impact on the
00:49:35.760
environment in which that flower grows so you need to start by really understanding what that flower's unique
00:49:42.079
needs are instead of just randomly throwing stuff at it that may have worked for a previous uh previous plant
00:49:49.119
in the in the garden now it's hard work yes but when the gardener pays attention
00:49:55.240
to the unique needs of every flower the results can be spectacular look at
00:50:00.280
this that is your reward as the gardener seeing the flowers bloom knowing exactly
00:50:06.599
what it took to make sure that every one of them could Thrive now hopefully by now you realize
00:50:13.520
I'm not talking about flowers but I'm going to drop the metaphor just in case folks the flower
00:50:20.680
is a person a person with the ability to grow the garden is a team with the
00:50:26.880
potential to perform and the gardener that's the person who enables the individuals on the team to reach their
00:50:33.839
full potential together by tending to everyone's unique needs so let me ask
00:50:41.079
you who is your Gardener and whose Gardens are you tending
00:50:48.839
thanks one real quick thing I came here to meet as many of you as possible and I haven't done that yet
00:50:55.720
so if you could please take a picture of that QR code and link to me on LinkedIn I've got 10 seconds
00:51:02.440
N8 seven six couple more that Buzzard no I'm at
00:51:10.880
three and a half I'm good all right thanks okay things that
00:51:17.280
do stuff um one would think that that is most of the things that we write and
00:51:22.799
that is true uh I broadly divide things into things that are stuff things that
00:51:28.559
do stuff and things that both do and are stuff you can imagine a little trademark symbol but I did not have time to find
00:51:34.160
it in the keymap um data objects service objects
00:51:40.079
and object-oriented code we've all read well many of us have
00:51:45.200
read a bunch of books about how to write object-oriented code and all of our Frameworks are written in it and all of
00:51:50.839
the gems that we use are largely objectoriented code um
00:51:56.640
very little of our business logic is really necessarily object or oh my is
00:52:03.240
over here is really necessarily no it's
00:52:10.319
not V is a slides show program right is really dang
00:52:18.839
it really necessarily object oriented code it's almost
00:52:23.920
all imperative it's blocking the little section top of the screen down here um
00:52:29.839
it's almost all imperative because business processes are all processes generally like a controller action it's
00:52:35.920
doing a thing it's doing work a model method that you're extracting into a
00:52:41.960
piece of code that is going to do a lot of work it's being extracted into a service object most of the time that
00:52:48.799
service object is going to do some work it's not going to represent an abstraction of an object that does stuff
00:52:55.480
it is just doing stuff and the vast bulk of the things that I've built are
00:53:01.640
just at the core an object that has a method called perform that does a bunch
00:53:06.839
of work and that work is organized into a bunch of other objects that do a bunch of work and each of those objects does
00:53:12.559
more work uh there's an a hierarchy tree in the file system uh actually that's on
00:53:18.640
the next slide um that uh represents all of the organization of
00:53:24.920
that work but it's all just doing thing after thing and it would be really really complex if it were all in one
00:53:30.640
file but it doesn't generally end up that way but
00:53:35.720
uh if you structure your code that way such that you make it all in one file you end up with a massive class right
00:53:42.240
it's doing a lot of work it has it seems like it has more than one responsibility it's kind of one responsibility it has one thing that it's doing but it's
00:53:49.599
touching a lot of other things it has a lot of a lot of test files um so you
00:53:55.079
break out you extract pieces is um you extract other service objects from it and you end up with a bunch of other
00:54:00.280
service objects and it's sort of a tree and that's what this looks
00:54:06.839
like I don't have an example here sorry I showed an example last last year you were all here last year right
00:54:13.839
um and it tests in a way that is very convenient because each of those service
00:54:20.000
objects does stuff and in the unit testing case which all of the uh every
00:54:25.640
little bit of the thing should be unit tested you get to in other languages you would have to inject the dependencies so
00:54:32.240
that you could mock all the the unit tested bits all the things that were implemented in other service objects
00:54:37.680
would have to be injected so that you could mock them but in Ruby you don't have to do that you can just mock them
00:54:43.319
as they are by as I I shouldn't Point down there up here
00:54:48.599
uh the microphone's over here um by mocking new on the class um and this is
00:54:56.520
the helper that I used to do that all over the place uh I'm confident that almost every senior dev has invented
00:55:02.000
something similar to this because writing two lines is far too much work um but I probably probably use this
00:55:10.480
method 20 or 30 times in every PR um because you just need it that often when
00:55:16.920
you're testing service objects and that's all I do um oh but you also need integration
00:55:24.760
tests and in this case because integration test means almost anything you want it to mean uh I mean integrate
00:55:31.240
or testing the entire set of service objects in a big stack Al together and only mocking the externalities to your
00:55:37.920
system but I'm not going to show you what that
00:55:50.799
like read me uh is not documentation that's very important and these things
00:56:10.880
this talk is called once upon a time in the Ruby ecosystem um I'm Ben I just co-founded a
00:56:16.799
rails consultancy with two friends we specialize in staff augmentation and building applications from the ground up
00:56:22.640
uh you can feel free to get in touch uh there's the email address also building some experiments you can check at that
00:56:27.920
website and I mean like we're brand new we just opened a bank account like last week and those are that's nice uh so
00:56:34.720
cool um and we're setting up everything including chat uh we needed chat to get work done we could have gone with slack
00:56:40.839
but we decided to try uh the pay wants campfire um from 37 signals it gets the
00:56:46.400
job done but it could use a few more features uh so we started adding a bot
00:56:52.480
and I had previously added chat Bots at other jobs and there's this Ruby framewor called Lita uh that connects to
00:56:58.760
chat platforms like slack and campar and whatever else um I'm a big fan of Ruby so that's that's perfect but um I also
00:57:05.280
hacked together a campfire uh adapter pretty fast and added some new features via handlers too but Le is archived and
00:57:14.440
isn't getting worked on anymore and that's no fun and there's no other highly developed alternative in Ruby um
00:57:22.839
and a lot of even so a lot of companies still use lad every day and are
00:57:28.920
completely dependent on it in this like right now in 2024 um it works it needs a
00:57:35.000
couple changes to run on Modern Ruby um but I I think that's embarrassing for the Ruby Community you know like we have
00:57:41.960
this abandoned project pattern that's going getting more and more common uh in everything that we do um it doesn't make
00:57:48.839
Ruby look good to Outsiders and if too many projects go dark will people still
00:57:54.599
use Ruby or would they stop and I get it you know like I it's okay that
00:58:00.160
maintainers don't want to maintain their projects for free indefinitely like I that I I get that I've been hit that
00:58:06.000
wall before but what should we do um well first if you're a maintainer reach
00:58:11.319
out to your community if you feel overwhelmed there's probably probably more people willing to help out than you
00:58:16.559
realize you just need to put up your hand I've done this with a couple things that I maintain uh one's called ma
00:58:21.880
another's called tap Carousel and many wonderful people have just come out of of nowhere and started working with me
00:58:28.599
which is amazing uh and I've moved those projects to their own organizations and it's mostly other people working on them
00:58:35.039
now um and after building some trust I just gave out access to as as much as I could and those people are running with
00:58:41.480
it so if you no longer want to maintain a project it's important to let go and
00:58:47.480
let somebody continue um and if you're a user try reaching out to an abandoned project you
00:58:53.880
know it might not work out you might have to Fork you might have to rename um I got in touch with the maintainer of
00:58:59.640
Lita and found out that forking and renaming is the only option um
00:59:04.720
unfortunately um so now it's it's time to Fork Lita I guess so let's call Lita
00:59:11.319
by a new name uh and I chose Rita uh honestly not trolling it just works
00:59:18.480
out really well um and so can we get some help on Rita uh we have interest in
00:59:25.599
using Rita but for now we're just scratching our own our own itch and
00:59:30.880
trying to move forward make it just work but ultimately I think it should be a community project if so many people
00:59:36.280
depend on it um so if you use leita or are interested in having a chat bot in your chat room uh can you help make Rita
00:59:43.920
a reality could you please get in touch um I already made this repo it's blank
00:59:49.160
you know but you can can look at it if you uh need to find information about us
00:59:55.480
and if if I've been learning about a lot about how how it works so if you want some chatbot Consulting uh I can talk
01:00:02.079
through that uh we can work with you on that um so how do we fund that long term
01:00:07.920
uh I have a lot of ideas about how to address the wider abandoned project problem um that I've described I'm
01:00:14.520
talking with some key people I don't really want to get into details here because I don't think there's enough time but I think there's some ways we
01:00:20.240
could help make this better at scale uh and that's really important to open source in general but I think we can
01:00:25.720
focus on on Ruby and see how how things go uh so if what I just described as
01:00:30.920
interesting or important to you please come find me I'd really appreciate it and that's it thank you so
01:00:43.200
okay uh here we go working as cfic technologist so my name is Alberto as
01:00:48.440
you know I mentioned yesterday work for the government um and many of you asked me during the hallway and during launch
01:00:53.839
uh how does it look working for the government or how could I work for the government so I got some feedback so
01:00:59.920
just a little bit of a story um so in I guess many of you mentioned during
01:01:05.839
launch like healthcare.gov so long story short in October 2013 uh healthcare.gov launch and it
01:01:12.520
couldn't sustain the load and it failed it was in the news it was everywhere uh was a big deal it meant that people
01:01:18.039
couldn't get access to healthcare so it wasn't a trivial issue um so after that an organization called the United States
01:01:24.400
digital service was created so in 2016 I had the opportunity to join the United States detal service and that had
01:01:30.440
basically steered my career into federal government for the past few years so uh but why did I do this and
01:01:37.480
why should I do it why you should you do it so I'm going to read this quote from Jennifer paa who's the co-found like the
01:01:45.000
founder of an organization called code for America um this is this isn't our
01:01:50.039
work this is everyone's work and it can be your work you don't have to be a Steve Jobs figure in a black turtleneck
01:01:55.400
to do innov in government you just have to have the guts to apply a different Playbook I think this speaks pretty
01:02:00.599
clearly why why it makes sense to have people from all ways of life working in government so anyone here's early career
01:02:07.599
like you're in college or just recent graduates so I got some info for you so
01:02:12.680
if you're in college there's an organization called coding it forward it it's kind of like a first of its kind program uh it's for early career
01:02:19.240
Technologies to work in government so if you're in college University you can participate in their fellowship program
01:02:25.160
and basically you you have a paid internship and you go to work with local state or federal government agencies using the skill sets you possess and the
01:02:31.920
ones you're learning then if you recently graduated
01:02:37.039
though um there's still good news so there's an organization called the US digital core this organization lives out
01:02:43.680
of the general Services Administration and it's also for early career technologist so it allows you to be
01:02:49.079
hired as a fellow you work for the federal government you're sent to an agency you work for two years over there
01:02:55.079
in that agency and the expectations that the agency will hire you and they're bringing like software Engineers data scientists
01:03:02.079
product managers security engineers and other roles so let's say you're like past
01:03:08.839
college right uh you have a work so if you're mid career there's like four options these four options I'm going to
01:03:14.279
mention are what's called like it's called Turn limited which means that you can work from one to two to four years
01:03:20.000
generally so first of all you have to Congress so have you ever dreamed of a Congress that works better for all of us
01:03:27.240
right so if you do dream of that so you can use your skill set go there a tour of Duty work for a couple uh years or
01:03:34.359
months or whatever it is and basically bring Tech to the policymaking process
01:03:39.960
um if not you can like become like as Technologies advisor across government agencies you're sent to an agency as a
01:03:46.599
presidential Innovation fellow this is another program out of the general Services Administration and you can bring your skills to basically work on
01:03:52.640
hard problems uh across the federal government uh maybe you're looking for something
01:03:58.319
like that's like two to four years that maybe like it's remote friendly so you should join ATF ATF is a team out of the
01:04:05.119
general Services administration too and it brings like Technologies to work with the rest of the federal government and
01:04:10.680
special projects and agencies or you can do a tour of Duty at the United States digital service the
01:04:16.839
one I joined at the beginning uh that I mentioned so you here come and work with a group of product managers designers
01:04:23.000
bureaucracy hackers uh engineers and some of the hardest problems the government has so there's also cool
01:04:29.760
teams across the federal government in the interest of time I'm just going to give a shout out to my team like the team at the C for Medicare there's a
01:04:35.359
detail service at CMS there's another team at the Veterans Administration the Department of Agriculture and there's
01:04:40.799
like many teams across all of the federal government um there's also state government teams that are cool so if you
01:04:46.480
are from Colorado but there's some great news so there's a Colorado Digital Services so imagine like the best rubies
01:04:53.119
in Colorado transforming into state so you should apply um maybe this government things you say like this is
01:04:59.440
this is not for me so there's also another option they can just volunteer there's the United States digital
01:05:05.480
response is an organization that came up during the pandemic and they bring volunteers for short period of times to
01:05:11.240
work like at all levels of the federal government of government so what can you do whether it's about improving small
01:05:17.799
businesses lives helping taxes being easy and friendlier and free uh bringing
01:05:23.640
open source to the rest of the government or you possess like some of the hottest best skill sets that the
01:05:29.279
government doesn't really have then you should come and make things better so
01:05:34.400
what should you do take a picture this is a Playbook that has been created by the tech Talent project it gives you
01:05:40.400
like a very structured guide answers all the questions you may have and it's a guide to basically how to apply to a
01:05:46.319
federal government guys no one's coming it's up to us that's
01:05:54.079
it all right my name is name is Warren I am a developer uh I work in
01:05:59.680
Ruby and like all of us he's gonna hit the button yep uh today I'm going to be
01:06:06.799
talking about how to shoot yourself in the foot with active record uh this is a skill that I learned uh in
01:06:13.319
2010 uh working as a uh application support engineer where my job was to fix
01:06:19.319
corrupted data in production so you start with a basic um
01:06:26.680
thing on the screen uh you start with a basic class like a user uh it this doesn't do
01:06:34.319
anything ignore the private methods they don't do anything yet there are no validations there are
01:06:40.400
no um after call
01:06:48.039
methods so I have a new
01:06:53.559
user okay this is is large enough is this large enough
01:07:01.480
perfect and the user has uh a
01:07:09.240
name and and email I cannot talk and type at
01:07:15.240
the same time I apologize
01:07:26.039
all right so I successfully made the user and then our code changed we needed
01:07:31.599
to add validation to our and save um to
01:07:39.760
our user to make sure that we have valid emails um it just so happens that our validation is crap and always returns
01:07:52.880
false and I need to change this user
01:08:12.720
email and it works because I didn't reload reload the user I tested this last night took me 15
01:08:21.319
minutes I'm glad I tested it because that's more than five um
01:08:42.600
um and I did save the
01:08:53.440
user and it succeeds of course nothing like live coding live
01:09:01.759
demos so we reload the console it's been a
01:09:15.719
while fortunately I have a lot of
01:09:22.480
emails I mean it doesn't matter because my validation is
01:09:30.440
crap aha it's an invalid email and now I also cannot
01:09:41.199
change my name
01:09:49.679
because my validation is crap um but fortunately active record has this
01:09:56.239
method that bypasses validation use that your own
01:10:06.280
risk and that is update
01:10:11.600
column or columns uh the difference is minimal oh I am out of time almost uh
01:10:19.040
but it's mainly this is the meat of it it's update
01:10:24.320
columns you give it the column name and the
01:10:30.199
value and it updates it for you doesn't care what your validations are it also bypasses your after
01:10:39.440
save um or or anything else so if you want to completely corrupt your
01:10:45.120
database use update columns and if that doesn't
01:10:52.360
work uh I don't quite have time for it but it's called find by SQL and you can
01:11:00.080
drop your
01:11:11.400
new product called wcape that lets you take long console scripts like this and
01:11:16.560
turn it into a UI that you can share with your team uh instantly and I want
01:11:21.719
to talk about how I used active model to build a dynamic form to power this uh
01:11:27.600
Power this UI and you all should use active model more will be the takeaway so active model is one of
01:11:34.640
the what 12 13 core Ro rails gems now uh it's included by an active record by
01:11:40.920
default and it does all the stuff that doesn't involve connecting to the database so very basic usage is like
01:11:48.000
using it as a form object so a lot of times you might have like a registration form that has things that need to be
01:11:53.320
saved into multiple models but you want to keep your code simple and have the controller and view only see that as a
01:11:59.719
single model and just have the back end write it to multiple models so you can do something like shown
01:12:07.159
here so yeah that was just the example of a plain old Ruby object is not much different from a basic active model
01:12:13.040
model on line uh just add be include on line 13 and then you get something that
01:12:19.520
looks very similar but has a lot of methods included in in it uh from that module so you get validation
01:12:25.880
errors uh the the um the attributes like Mass assignment methods things like that
01:12:32.560
and so uh you can use that to make a form object and I always like to put these in the app models directory I know
01:12:38.280
the couple talks ago about all the services and things like that I guess the apps I work on aren't that complicated where we need that level but
01:12:45.280
it's it's nice to be able to have something that's not saved to the database and the models directory for representing things so how do I make
01:12:52.840
this uh in how do I make the dynamic forms like I showed you with fun Ruby Meta Meta programming is where we're
01:12:58.719
going to go next so for wcape the user provides a parameter definition we can't quite make
01:13:05.639
these automatic yet but you define the the the name of the input Fields the types the whether they're required or
01:13:11.360
not you can provide default values and then at runtime we use uh Ruby's meta
01:13:19.159
programming to create a new class for that specific form so the the task is
01:13:24.760
the the thing that the user is creating and then they Define all the parameters and when we want to then run the task the
01:13:31.600
dynamic class is created it includes active model model also adds active
01:13:36.639
model attributes which is like a strongly typed version of the basic active model and the serialization
01:13:41.960
helpers so we can save this back to a Json object in our database I then iterate over all the
01:13:48.400
parameters dynamically defining class attributes or calling class methods to Define attributes uh based on the
01:13:54.159
configuration and uh and then add any other there's some other required methods to make this
01:14:00.199
work like the model name and then I can use my new form model in the controller just like I
01:14:05.840
would use any other rails model and in the view I just have to do conditional dispatch based on the the type of the
01:14:12.480
type of parameter that I want to display a field for uh and we get this fun attribute
01:14:17.679
names method which plugs right right into strong parameters and I now have a dynamic field Form controller in rails
01:14:23.800
so that's my talk if you want to learn more about wcape check out wcape dodev or reach out to me