Another day in my shoes
• Mark Eschbach
First up on my docket is suporting the new drop of ReactNative into our iOS code base. There was a general query into what is required to build I’m highest up on the list available to answer that question. Unfortunately it’s a group fumble to figure it out! We’ve got something like the following running.
nvm instal npm install bundle install bundle exec pod repo update bundle exec pod install # this seems to have gone missing
The last step should be executed but it appears to be missing. I think this might be an attempt to optimize the execution while the author didn’t realize we are executing under a much later version of
bundle. The Travis Caching mechnaism works! That appears to be the reason why we haven’t had failures on the affected branches.
Next up is supprting the use of the Postgres extension
tablefunc. There was interesting debates on Friday if this should be within the schema migrations of the application or within the infrastructure for hte Postgres setup. My instinct definitely says it’s something specific to the database instances since it invovles dynamic libraries to exist in specific locations to be lodaed. My colleague had a great point it’s easier to manage the developer’s machines if it’s installed via the schema migrations. Both sides are valid; but I’m interested in getting Travis to be happy. We left off on Friday getting an error like the following:
django.db.utils.ProgrammingError: function crosstab(unknown, unknown) does not exist LINE 4: FROM ( SELECT * FROM crosstab( ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.
The Django statement is a bit misleading. The actual error seems to be the wrong type parameter. Supplied as the first argument is a query wrapped in
$$ as a delimiter. My hunch is this the
$$ doesn’t create a multiline string.
First up is checking the docs to make sure we’ve got the parameters correct. It looks like one of the overloads matches our types:
string, string. Well, I’m not entirely sure what is going on there. My current operational hypothesis still stands but I really want more details on what
crosstab does. After perusing CrossTab Queries in PostgreSQL using tablefunc contrib the actual text seems reasonable.
Time to examine the strange
$$ syntax. In my years using Postgres I’ve only seen that used when defining stored proceedures, never in the raw SQL itself. Ah! Bingo! Looks like it might be a valid construct. Well, definitely wrong about that.
So after confiring with my colleagues we’ve reached the conclusion it’s actually not installed. This is because Django is nice enough to destroy the test database and recreate it. To create an extension a user must be a superuser. The database user isn’t a superuser nor should be. Those in the know at StackOverflow suggest we install it into
template1. It’s a fairly old response which would make sense, I thought they did away with
template lives on. Alrighty! Time to approach it that way.
Done! Well that was a fun research project.
Caught the Heroku CLI warning in time.
In the process of updating systems we realized our hotfix environment has been updated when we expected. There are really two conditions hotfix should be updated: (1) when a release is made to production; (2) a commit is made to the hotfix branch. Condition (1) is interesting since it’s apart of the release candidate branch becoming our closest to production branch. We don’t always have our newest release candidate ready to be cut when we are ready to release, nor should we. Time to dig through some old Travis logs and find out why.
Apparently Heroku’s API is changing. Doesn’t look like they published what was being deprecated or the migration path to their v3 API. We were using the
heroku-toolbelt package; looks like they dropped the
toolbelt portion of the name to indicate a newer version. I really wish the clients were a bit more intellegent about things. Many of the articles out there are specificially targeted for the toolbelt. The simplified cases of Heroku deployment are cool too. But that doesn’t fit our totally reasonable case either.
I give up and instructed the preinstallation script to install
heroku. Well that looked promising as the run produced
5.5.5 which isn’t too bad for Ubuntu 12 LTS. Hopefully the avoids any problems on tax day with Heroku.