Project Management

1. Setting up git

WHAT:

WHY:

Installing git locally

Git is already installed on the laptop.

Here’s a quick way to find out if you have it installed and working properly.

Console showing the version of git

Generating an SSH key

Git is a distributed (and standalone) version control system, but most people use store a copy of the code on a central server (github, gitlab, bitbucket, etc.)

Git can use HTTPS as well as SSH for authentication.

🔐 Protocol 👍🏻 Pros 👎🏻 Cons
HTTPS Easy to setup, no keys required It will make you enter your userid/password every time
HTTPS Very ubiquitous. Easy to traverse proxies transparently Proxies are fairly rare in today’s environments. This is barely an advantage!
SSH Much more secure (no need to remember a password!) You have to generate keys and configure it, but only once!
SSH The de-facto standard for auth. If your private key gets leaked, you need to revoke it and generate/upload a new one.

Authenticating against gitlab

In my case, I already had a keypair that I use for other purposes (a home git server that I use for personal projects), so instead of creating a new one, I decided to copy the private key to my laptop and upload the public key to gitlab.

console showing my private key and the known hosts file

Once the key is imported into gitlab, we can see its hash.

gitlab page showing my public key has been imported

And validate that we can connect to gitlab.

console showing gitlab recognises me when I try to connect to it via SSH

Git workflow

The current git workflow is similar to the one I use as a software developer

Small and Atomic commits help readers understand what changes were done (and why)

What git is and what it isn’t

Git is not:

Git is:

Here’s a 1-panel comic that explains it fairly well:

git as described by xkcd

xkcd, always finding a way to explain life in a single panel.

💡 Closing thoughts

Getting setup with git/gitlab was not a hassle since it’s a process that I’ve had to do multiple times, and I’ve already been bitten in the past. However, I wanted to take 5 minutes to write down some common pitfalls that I’ve seen around the lab while helping fellow students get their PCs setup.

If you’re setting up your PC with git/gitlab, these are some common things to watch out for:

Unintuitive User Interfaces end up harming users.

Avoid copy/pasting commands you see on websites. It’s better to type them from scratch, particularly if the command fails when you copy/paste. I have seen lots of examples where unintuitive user interfaces harm users. Here are some examples:

  1. Copy-pasting code that contains fancy-formatted characters (curved double quotes, long dashes, etc…) from blogs, ultimately results in users pasting non-standard characters into their terminal, and the terminal being unable to parse and interpret the command. Tip to remember: A “curly double quote” is not a “double quote”, a “long dash” is not a “dash” and cannot be used for passing arguments to programs). see the difference
    • table comparison of different quotes characters
  2. Copy-pasting code that ends up with hidden characters that mess up command parsers (e.g. errors like \0231\0213\0312ssh-keygen command does not exist)

Unintuitive default behaviours/error messages cause confusion

Sometimes, the tools we use end up hurting us by not doing the reasonable/expected thing, when it really should ( especially painful if it’s a process that a novice will have to go through!).

An example is during the ssh-keygen steps, where the app suggest storing the newly generated key in ~/.ssh/whatever.pub but the .ssh directory does not exist. If the user accepts the default suggestion (which is very reasonable) they end up with an error trying to create the file, because the .ssh folder does not exist yet! This gets resolved by creating the .ssh directory manually and relaunching the ssh-keygen process, but it’s confusing that the default suggestion from the tool does not try to create the directory if it does not exist. This would be so easy to fix, and it would make the user experience a lot more smooth.

2. Setting up mkdocs

WHAT:

WHY:

Getting mkdocs installed

On linux, just like git, mkdocs can be installed using the built-in package manager. On Windows, you can install mkdocs as a module for Python3. (I had to do it in both OSes, but I won’t include picture for both processes)

console showing mkdocs is already installed

I’m currently using version 1.2.3

version of mkdocs

Running the mkdocs generation locally

console showing how mkdocs generates the doc locally

This is the locally-rendered doc page.

localhost hosting the generated page

Once we’re happy with the changes (updating the doc. contents, changing the theme, etc.), we can commit these changes and push them to gitlab to have the public-facing website re-built with the new content/look and feel.

Customizing mkdocs theme

Something we were encouraged to do was to go beyond the default theme to give our documentation a personalized flavour.

During the 2nd week of FabAcademy I decided to explore other mkdocs themes and landed on a theme called cinder-superhero, which combines the mkdocs-cinder theme and incorporates the Bootstrap-Superhero look&feel.

In true spirit of Iterative/Spiral development, I’ll leave further customizations for the future (Looking at other MkDocs themes? Maybe Jekyll? Other static content generators?), just in case I run out of things to do.

💡 Closing thoughts


Iterative development

This week, the topic of Iterative development / Spiral development has been mentioned numerous times.

I decided to slice the work to be done in this way, to always have something to show, in case I wanted to present my current progress and status.

Perfect is the enemy of Done

The benefit of this famous mantra is that, if we start with the inner-most loop and we only complete that one, we already have something we can show. Sure, it might not be perfect, but it’s ready to be presented, showcased, and used to collect feedback (most people forget that this is the most important part!).

If one of the outer iterations does not get completed, we still have a “working thing” to present on Wednesday! And we can always enrich it later, if needed, based on feedback we receive.

The other benefit is that I can drop this (stop enriching and iterating) and move on to the next urgent topic without having to bring any carryover (due to having intermediate tasks being incomplete)

Iterative development prioritizes “getting something that works” over “having a perfect idea, half implemented, that does not work in reality”

💡 Closing thoughts - During disasters

As you have already probably read, the night before the Week 1’s Wednesday presentation, my laptop 💀 ⚡ died suddenly, and with it, all the work and content I had there.

Fortunately, I had mitigations in place to contain the damage.


Nothing like a real-life reminder of the importance of iterative development to close off this exciting week.