2015.01.12 – Mozilla OP Internship Begins

I’m in Pittsburgh so I’m three hours ahead of my mentor. I’m still up and online looking over the bug I was last working on before taking a break for the Urban Airship Internship. It takes me a bit to get my brain back in Django mode. Ah yes, I was having a database error. I had created the model and view, did the migration and applied it. It all looked successful but the error says my table doesn’t exist. I see it when I look in the database but I don’t know a thing about databases so it’s a matter of me just not understanding what the heck is going on.

I had my tea and looked things over while waiting for Peter to log on to IRC. I’d give him a bit to get going on this Monday before pouncing on him for help. After a sufficient amount of tea and time I said hello and asked if he had time to help. He did and asked me to push whatever changes I had up to my fork on Github.

He looked things over and said he didn’t think I needed to have a RegionDefaultEnvironment table as well but I was basically implementing Regions as Locations was implemented and it had LocationDefaultEnvironment so I made one for Regions. He walked me through deleting the tables and the migration and then had me migrate again with just Regions. That all seemed to go well so I was moving forward. Or not. I was still getting that stupid error.

But nevermind that for now! I had added a new ‘region’ view to views.py but another contributor had just taken all of the various methods out of views.py and made them their own modules. Well that’s not very handy. I had to commit everything I had done, save those changes as a patch (I also had my edited branch pushed up to my fork so I had a backup), delete my changes completely, then rebase my branch onto master, THEN re-apply my changes sorta, kinda, mostly, except where they needed to be different. I also needed to make ‘regions’ its own module.

Michael, Andrew’s co-worker’s wife, invited me to lunch but all of this felt like a big mess so I opted to stay in the hotel room and eat my cold oatmeal I had skipped having for breakfast and work my way through all of it. I was making good progress but stopped to watch the Monday meeting. It’s very nice that it’s streamed on Air Mozilla! Richard gave me a shout-out as a new intern too.

Back to work! I slowly made my way through everything and then was back at the database error. I also couldn’t figure out how to rewrite the regions_edit function to exclude checking a default environment. I let Peter know I was unsure about it and he said it was for me to edit. Huh….Well ok then. Back to staring at code and trying to make sense of it. I did this until about 17:30 and then called it a day!

Andrew was done working a bit after 18:00 so he came up to get me, we put on warmer clothes and met his team and their SOs in the lobby. We all walked back down to Indian Spices for some dinner. It was delicious again 🙂

GSG was having a game night but I wasn’t feeling it so we came back to the room and talked about our days. I asked Andrew some questions about my struggle but he wasn’t too sure about how it all worked. Oh well, tomorrow is another day.

Today I learned how to undo a database migration. I’d imagine it’s a bigger pain in the ass if there is actually live data in it though.