Intro

I did not touch this blog for almost a year but having several ideas for articles to write I came back to start posting. I have written some small instructions for myself in a readme.md file like: how-to configure the blog locally, create a new post and how to publish it, for situations like this, where there was a long pause since the last touch. So as soon as I started following my own instructions I was faced with several problems.

This reminded me about the several projects that I had encountered over the years with, lets put it politely, not so technically savvy management. Where the understanding of tech is usually one of: if it is done - it is done. Meaning that a lot of people, especially none-technical, think that they’ve already paid enough for the development of a solution so the product should live forever (okay, not forever, but at least for 5-10 years) without any maintenance or upgrades. This is wrong. Anything you build - you have to maintain always! And in this article I will describe a typical “why”.

Maintenance never stops

So coming back to my blog. An idea popped up in my brain and I wanted to start writing right away. What do I usually do in this case:

  1. go to github and clone my repo (if it is not already cloned, otherwise fetch the latest changes)
  2. follow my own instructions from readme.md to run the test server to see how everything is working
  3. create a new post and start writing article
  4. merge a PR which triggers a complex auto-magic deploy (hm… could be an idea for another post? 🤔)

I already cloned repo had the latest changes on my laptop. So what went wrong today? Well… already on step #2 it failed to run a new test server with a lot of errors, something like:

1
2
3
4
5
6
7
ERROR 2022/12/29 21:42:30 render of "page" failed: 
"/Users/foobar/blog/themes/my/layouts/_default/baseof.html:38:15": execute of template failed: 
 template: _default/single.html:38:15: executing "_default/single.html" at 
 <partial "icon.html" (dict "ctx" $ "name" .icon "title" .name)>: error calling partial: 
 "/Users/foobar/blog/themes/my/layouts/partials/icon.html:1:7": execute of template failed:
  template: partials/icon.html:1:7: executing "partials/icon.html" at <isset .ctx.Site.Data.my.icons .name>:
   error calling isset: reflect: call of reflect.Value.Type on zero Value

And my initial reaction was WTF!!! I did not change anything on my machine, and I used this machine to write the last article, so what the heck?

This blog is built using hugo.

I checked my current version and it was 0.69.1, okay, what does brew say about the latest - 0.109.0.

Damn, you release a lot. So okay upgrading hugo, no problems, starting test server… and it is the same error again 💀.

I use a custom theme for hugo, so I updated this one as well.

Hugo is using Go templates and in git changes I realized that I used a lot of modifications and custom code in variables and functions which were now lost.

Bringing back my changes with custom date, colors, article previews and so on. Starting a test server… aaaannnnddd now it works! Good!

Now I can start writing a new post, right?

But following continues delivery approach, that I prefer, I decided to publish the latest version as soon as possible before starting a new article.

Creating a new PR, merging… auto-magic happens… and dies in agony 🤦‍♂️.

Build pipeline

What happened? In the pipeline definition I use a dedicated variable to download the right hugo version before build. Good idea! But I completely forgot about it during previous commit, because of the auto-magic. So updating the variable and pushing new commit

1
2
variables:
  hugo.version: '0.109.0'

Again failed… but now at least on the next step where I download the hugo package

1- script: |
2    wget -c https://github.com/gohugoio/hugo/releases/download/v$(hugo.version)/hugo_extended_$(hugo.version)_Linux-64bit.deb
3    dpkg -i hugo_extended_$(hugo.version)_Linux-64bit.deb    

Ok, going to their official github releases page and not finding any *Linux-64bit.deb packages. So now we need to use a *.tar.gz file which changes the logic in the script:

1- script: |
2    wget -c https://github.com/gohugoio/hugo/releases/download/v$(hugo.version)/hugo_extended_$(hugo.version)_Linux-64bit.tar.gz
3    tar -xzf hugo_extended_$(hugo.version)_Linux-64bit.tar.gz
4    chmod +x ./hugo    

Pushing new changes, build completes successfuly, yay!

Release pipeline

Then, after build, auto-deploy triggers automatically and fails 💀.

  1. First I used ubuntu-18.04 to perform release steps. Which was a bad choice, since it’s almost 2023 and this image is not supported. So first change - use ubuntu-latest which automatically will choose the right one even if any of them are out of support.

  2. Second - Azure CLI can no longer login to Azure to perform all release commands. Secret has expired. Fix by re-establishing a new connection for service provider in CI.

And finally it’s working as intended!

I spent 3 hours trying to understand and fix everything and completely forgot what I wanted to write in my article… But it will come back later as it always does, but now at least I am prepared to write.

Summary

This was my story how just a year of doing nothing affected my routine. If you have projects that are based on old technologies and never upgraded the past 5-6 years - I do not envy you!

If you pay the technical debt continuously and not forget about it for 5-6 years - you will at least have more pleasant start and more smooth maintenance process.

As for me - I learned from my mistakes. Not only did I add more documentation for myself and upgraded to latest versions, but I will also make sure to continuously upgrade my blog. You live - you learn - then you forget - and you’re acutely aware of the pains of being sloppy - and then you learn again.

More interesting articles about to come soon, stay tuned 😇.