Saturday, 16 January 2021

After forty two weeks - and the start of a new year

It's the start of 2021 and gosh, hasn't this pandemic been going on for a while. I'm not going back to writing weekly updates - this has been going on for far too long for that - but since it's the first post of the year I wanted to note the passage of time.

Looking back, this time last year I was writing about having a rough January and what I was going to do to make myself feel better. Then I wrote much the same in February - little knowing what the rest of the year had in store. This year, January is again rough going - I'm starting to think that maybe I just don't like January. Rather than trying anything clever to make myself feel better, I'm going to have a think about the good that is happening at the moment and put down three things I'm going to pursue above all others.

First, the good. After a thoroughly miserable year in 2020 we're seeing some actual positive change. There is now a deployable vaccine for COVID, it's going out and real people are getting immunised. We're in a lockdown again, but it's not a stop-gap to drop the numbers so we can build them up again on the other side - combined with the vaccine we should start seeing infection rates come down and stay down. The government has also declared we're going to have a slow re-opening, which frankly will be good for people to ease back into being social again as well as eminently sensible for disease control.

In America, President Trump is finally leaving office and might actually suffer some (potentially serious) repercussions for his actions. It's a horrible mess and I'm really pleased I don't live there, but from a distance it looks slightly positive. Similarly, while I don't comment on UK politics here, I'll also say that I feel more confident in the direction of the UK than I have for a while. Both these are relative, granted, but I'm looking for the sunshine.

On a personal level, many things are terrible as they are for pretty much everyone. So I'm going to focus on three things in the short term.

First, I'm going to do what I can to approach the next four weeks in as positive a mindframe as possible. I'm going to smile, I'm going to make jokes. I'm also going to take care of myself - I intend to work more sensible hours this year, and for the moment I'm also going to do a lot more to take the time I need when I need it. That thing I tell all my people to do, then don't do myself.

Whatever is true, whatever is noble, whatever is right, whatever is pure, whatever is lovely, whatever is admirable - if anything is excellent or praiseworthy - think about such things.

Philippians 4:8

Second, I’m going to focus on my physical health. This has really suffered during lockdown (again, like many people) and I need to do something sustainable now, not in six months when things will be (hopefully) far more normal. This means I'm going to eat better and exercise more and track my progress properly. Although I'm going to measure more often, I'm going to try to judge success at the end of each month, not each week.

Third, I'm going to cook a lot more. Hopefully this won't be too much of a contradiction with my second point. I like making things, I like cooking, and once upon a time I was pretty good at it. I want to get back into practice properly and it should be entirely possible while I have no commute at all. To cook in the evening (as opposed to "place thing in oven"), I have to finish work at a sensible time and that will help with both the other points too.

I've also got an idea for an app which should help me with recording recipes and cross-referencing ingredients for better ideas. I'll write about that another time, when I’ve thought it through properly.

Welcome to 2021 everyone. Remember that it's not 2020 again, even if right now it does feel like it.




This post is from a series of shorter posts, written roughly once a week while the country is on lockdown to capture my feelings and reactions as we go. They are all tagged with coronavirus.

Thursday, 31 December 2020

The year that was, 2020

Well, shit. I'm writing this on the last day of 2020 and thank goodness this year is over. There are plenty of reasons I am very pleased to see the back of this horrible year (COVID being the obvious one) but this isn't the place to write about that. This annual post is traditionally about reviewing my new years resolutions and reminding myself of all the creative things I've managed to do. It has, after all, not all been Division and ... err ... Division 2.

  • 18 posts on this blog (19 including this one) - sixth consecutive year of a post per month
  • regular posts reflecting on life in lockdown
  • did some writing (and GMing) for a MUD
  • continued running a weekly exercise class in the park in Bath
  • another year of the Year in Pictures site - this is the sixth year and we're up to 29 photographers
  • started a Rails project linking Humble Choice to Steam tags, re-learning a load of good developer craft skills
  • rebuilt my server from scratch
  • learned about Github Actions
  • built a pihole for my home
  • renovated the home network at my parents' house (and made them a pihole too)
  • upgraded all my live projects to use a modern version of Ruby and etc
  • 298 contributions to various projects on github (well up on last year)
  • learned the basics of wood turning (and made two bowls)
  • extensive instagramming
  • loads of photos on my flickr stream

Resolution count - 6/10. Nice.

Frankly, I'm astounded that this year of all years I've managed this much. I also achieved one of my stretch goals (of five but that's not the point). This is testimony to my own levels of awesome. Or, more accurately, this is testimony to a lot of effort to not just disappear into work during lockdown.

Speaking of work, I deliberately don't reflect much on work int this post but there is something worth remembering. This year I made some decisions and moved out of London and back to Bath properly. While it has been in the middle of a pandemic, so hardly the homecoming I anticipated, it still has been fantastic to stop the commute and live in one place again.

Next year... well. I've been writing this review post for seven years now, starting way back in 2014. In the last few years each year I've written some variant of "this year has been all about work - something to change next year". Then I've utterly failed to actually follow through. With lockdowns and COVID, work and life are blurring which makes stepping away all the more difficult so this year I'm going to have to work much harder at building a non-work life. However, I've been making some progress recently with picking up programming again and as long as coffee shops reopen before too long I hope to carry this on and build on it.

Nobody knows what 2021 is going to bring. Normally, I write about wanting to do things and learn things and so on. But the world isn't set up for that at the moment. I have my normal hopes, but more importantly next year is about the people. Life is exceptionally dark at the moment, so what can I do to bring a little light?

2021. Here we go.

Sunday, 20 December 2020

A first look at Github Actions with Rails and Postgres

In my last post, I mentioned that while upgrading my Heroku tech stack I noticed Codeship was experiencing some kind of outage. This seemed to stop anything appearing in the "checks" part of a pull request (including any kind of error message, which was a long way from helpful) and I decided to investigate Github Actions for my CI/CD needs.

I've been thinking about using Github Actions for a little while, for two reasons. First, I wanted to run my linting in my CI pipeline and I know of a rather good tutorial for getting started doing this using Actions (thanks Dean!). Second, this should move my CI config to the project repository (keeping it together and putting it under version control) and remove a dependency on a third party SaaS product. I can't help feeling that the recent Codeship outage (which I only noticed because the check was missing in my PR, and could easily have missed this) vindicates this last point.

As a side note, Codeship now seems to be fully working again.

Anyway, the Rubocop implementation is actually pretty straightforward, but it took me forever to get the tests running because of a few tricks and gotchas which I thought I'd record for posterity.

Bundler

Let's start with a timesaver. I read a lot of examples while setting this up, and some had extensive Bundler config in them. However, if you're using the ruby/setup-ruby@v1 action for setting up Ruby (code here) and you put in:

  with:
    bundler-cache: true

It will just handle everything bundle-related with no more configuration. Hurrah!

Migrating Capybara driver to Apparition

I have no idea if anyone else is still using Capybara Webkit to drive their Capybara tests but I was. It has recently become a pain to install because the underlying library (QtWebKit) has been deprecated. I found this out after quite a while of trying to get the QtWebKit libraries accessible in my Action. That didn't work.

It seems Thoughtbot, the authors, agree with me and have deprecated the thing and recommend a move to Selenium or Apparition. I chose the latter because of claims of backwards compatibility and it was very easy to switch when I finally realised that this was a more sensible way forward. The changes can be seen in this commit along with the inclusion of an Action setting up the Chrome driver in my test workflow.

Configuring the database to work in a containerised world

Good grief this took me forever.

In theory, this is really easy - configure a Postgres database as a service, when the tests run connect it up, and bam. In practice it is also really easy, requiring minimal config to get it working. However, it requires getting a load of options to line up and since it's all running on Github servers, the feedback loop is annoyingly slow so painstakingly iterating through a million tiny variations to get to that simple working config took an eternity.

In the end, there were only two things to note.

First, when configuring the Postgres service one HAS to specify a port (despite it being the default port).

Second, remember to update the test database config in database.yml to accept some environment variables (and also default to allowing the tests to run locally). It's really easy to do when you actually remember to do it...

It's highly like these are more down to my own incompetence than anything hidden or surprising.

And done

And lo, it works. While it took a while to figure all the details out, the results are actually really simple and easy to duplicate for other Rails projects.

The whole change for implementing Github Actions and implementing the other updates can be seen in this PR.

Saturday, 19 December 2020

Upgrading to the Heroku-20 buildpack and Bundler 2

I figured it's about time to start moving my various running applications and kit to Ubuntu 20, now there is a new LTS version and well before v18 totally dies. I know I'm late to this party, but I've been busy.

Today I updated an application hosted on Heroku and since it wasn't 100% smooth thought I'd capture my steps, both for myself in future and anyone else who finds it useful.

The tech

  • Ruby on Rails application
  • Ruby 2.5.1 (Ubuntu 18 default version)
  • Bundler 1.17.3
  • Heroku on buildpack 18
  • Codeship for automated testing and deployment

The process

On Heroku, go to the app page then its settings. On this page you can change the stack via the big red "upgrade" button. This requires a redeploy of the application.

Back at the app, I updated by ruby version (.ruby-version file for me), installed bundler and ran bundle update --bundler to upgrade from Bundler to Bundler2. This provoked some other minor config changes, all in this diff.

Then Codeship broke. As in, it was totally down. Sigh. When this came back, the build was not working, giving me a deadlock error when running bundle install. This gotcha took a while to fix (hence writing this post). In the end, all I had to do was add gem update --system to the build setup commands before gem install bundler.

And voila, we're in the modern world and everything works.

Saturday, 14 November 2020

After thirty four weeks

It has now been around thirty four weeks of lockdown and the pandemic. After a period of the country beginning to open up, the rising number of cases and the increase in the R number has forced a return of a full England-wide lockdown.

To state the blindingly obvious, this has been a very difficult year and despite some signs that maybe the world is getting better (not least some promising news about a COVID-19 vaccine) a dip back into full lockdown, while undoubtedly the right thing to do, is a very hard pill to swallow. I deliberately stopped writing these weekly posts because, frankly, I ran out of ways to say “this week I worked hard and spent some time walking in the dark” but after a break I think I need to collect my thoughts on how I’m going to work through the next few weeks.

For me, the approaching winter combined with the loss of places to gather (ie coffee shops) means hugely increased isolation. I can no longer go somewhere to be around humans, which, as someone living alone, is very important to generate that low-level social contact. It also means I can no longer go places to do things. Outside of work, I normally take myself out of my flat to write (words or code) to put myself in a different environment which helps me think and focus. Now everything I do, whether it’s work or sleep or work or relax or write or work is all in these four walls and it makes it very hard to compartmentalise each area. That is making it hard to shut off work (especially at the end of the day), or “get things done” at the weekend.

So, with that recognised, what am I doing?

Firstly, running on low power, I’m going to make sure I set myself appropriately straightforward goals. I’m going to keep todo lists, but make them very achievable which should help motivate me to do them and give me small feelings of satisfaction if I do. I’m going to aim to do less, but aim to do it well.

Secondly, I’m going to make more of an effort to put things in my diary. Generally, I prefer a slightly more ad hoc approach to life since in work my time is dictated by the tyranny of my diary. However at the moment I think I need specific things to look forward to, and specific commitments to motivate me to get moving.

Thirdly, I’m going to pick up a new(ish) hobby. While people have been learning languages and so on, I don’t have the mental capacity to take on something completely new. However I’ve been doing a lot of photography over the years and I’ve found myself taking many pictures of the architecture here in Bath in the dark. I think I’m going to focus on this through lockdown and write a post about the pictures towards the end. It’s a mini-project that will give me some focus.

Fourthly, I need to contain my working hours. There is a lot going on at work at the moment and given my “office” is a few paces from where I’m sitting right now, it’s far too easy to still be sorting out that last thing at 8pm every night. Then a walk, then food, then the evening is more or less done. Done continuously, this way of working has a significant negative impact on those around me and it is very unhealthy for me too. So I’m doing what I can to make sure I am done by at the latest 18.30 every day. That is still a long day against my contracted hours, but it’s a positive step towards putting work in a sensible box.

So that’s four concrete steps I am going to take through lockdown 2. Let’s see how it goes.




This post is from a series of shorter posts, written roughly once a week while the country is on lockdown to capture my feelings and reactions as we go. They are all tagged with coronavirus.

Sunday, 18 October 2020

Losing Chrome URLs

 This is going to be a short one, mostly so I've got a reference for the future.

It seems Chrome as of v86 (latest at time of writing - at least on Linux) is hiding the full URL unless it is selected, instead showing only the domain. This is to highlight fraudulent websites for people who can tell the difference between www.google.com and www.google.evilsite.com but get confused when there is a huge set of valid-looking path and parameters after it. It seems that's about 60% of the web using population.

Anyway, if you're in the 40% and you find seeing the whole URL quite useful thankyouverymuch and don't want to have to select the bar to see the information, then you can disable this new feature.

Put this into the task bar: 

chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains

Then search for and disable:

omnibox-ui-hide-steady-state-url-path-query-and-ref-on-interaction

Restart Chrome and lo, the URLs are back where they should be.

For me, I was surprised by this and I was wondering why The Internet had decided to embrace loading pages into frames with javascript, before I realise the browser was doing this not the site.

Sunday, 27 September 2020

What do I want from a job?

I've been asked a few times recently what I would actually like from a job. What motivates me, what excites me, and so on. This is a question I ask my own line reports regularly so it's with some sense of my own hypocrisy that I've stumbled through my answers. It's probably a good idea to actually think about it.

This post is for me to collect my thoughts. It isn't about the most perfect job ever. It is a collection of thoughts about how my working life could evolve in the nearish future.

Important things

Being things I think are very important to me.

Problem solving

Most important to me is problem solving - and the space to be able to explore different solutions to problems. I was a mathematician at university, so I see the world as a series of problems to take apart, analyse and solve. For most of my career the medium I've used for this is technology but that's not as important as the problem itself. Basically, if I've not got a problem to solve and some space to solve it I'm not going to be happy or engaged. These days that probably means any role needs a strong strategic element.

As a Completer-Finisher, I suspect I won't be entirely happy if I don't have some hand in delivering the solution however so far I've not been able to test that theory.

People

One of the main reasons I do the job I do now is to be able to improve the lives of the people who work with me. I've written many posts along these lines on this blog and if I'm in any senior role, this is pretty much non-negotiable (I'm an INFJ / Advocate personality type). I need to be able to help those around me, and not just in a "soft" way through mentoring and the like. I want to be able to move people around so they can learn and grow, have the authority to sort out their pay when there is a problem, be able to make changes when people are upset, negotiate leave when they have life events, and so on.

This is important enough to me that the only real alternative is to go completely the other way and be absolutely clear that nobody is my responsibility at all. I'm not sure that would actually make me happy and would require some careful thought.

Technology

I've worked with (web based) technology throughout my career and this is where my core "technical" skillset lies. I'd like to remain fairly close to technology - it creates important opportunities for change in organisations, society and life in general and yet it (and particularly its limitations and ongoing maintenance requirements) is very poorly understood by those who often are making decisions about it.

This doesn't mean hands-on, of course (aside from recent strange times I haven't written production code in a long while) but I have a wealth of experience in this field, both hands-on and in communicating it and it's important to me to stay enough in the space to stay current.

Social good

I need a reason to get up in the morning, and "to make a rich person richer" isn't a good one. There are industries I know I will avoid (promoting gambling being an obvious one) and in general I want to know that I'm doing something to make the world a better place somehow.

Scope and support

While this doesn't make me excited, per se, I have been through long periods in my career where I've been expected to deliver and manage and support a huge number of things with no real support at all. That doesn't mean emotional support from colleagues and management (although that's always nice!) but, depending on the role, proper channels of delegation and people who can take on appropriate problems and tasks to take them off my plate - especially when the thinking is sorted and they are routine.

Similarly, the role should have a clear scope. What is it responsible for? How will I be judged a success (or not)? Importantly, what is NOT its responsibility?

This a long-winded way of saying that the role should be appropriately scoped and resourced.

Fairly important things

Being things I like, but are more "nice to have"s.

Management

Given what I wrote about People, it seems odd to put this here and in some ways my goals in People and the mechanisms provided by Management are inextricably linked. However, if there is a way to do the things in People without having to be a line manager then I'd be happy not having to do performance reviews and so on. I've done a lot of this, across a lot of people and I'm not scared of it and a strong culture of good formal line management is really important to keeping a strong foundation under a department. I've put it in "nice to have" because while I'm keen to do it, it's not a deal-breaker for me (with the caveats above).

Technical delivery

I like making things. I like seeing the things I've made make a difference to people's lives. I also get a bit of a kick out of seeing a big positive next to one of my projects (happier people, money saved, increased uptime, etc). So I think I'd like to be somewhere near delivery - if I'm not making a thing, I'd like to feel I'm directly responsible for a thing being made in some way. This is harder these days, and I'm experimenting with redefining "delivery" in my head - hence it being a nice to have.

Budget control

Part of implementing solutions to problems involves spending money. Sometimes that means making tough prioritisation decisions. I'm not a stranger to these things, but I have also found myself in situations where I don't control a budget so the first step of every buying or hiring (no matter how small) is an extended negotiation. If the budget holder has no stake in delivery (and this has often been the case when it comes to pay, but that's another problem) then this can be extremely draining.

The budget itself isn't as important as "the ability to spend money", although to be fair to the organisation I'd have thought those should come hand in hand.