Skip to main content

GIT Co-Author Helper Script

Phil Hadviger

Phil Hadviger

Principal Site Reliability Engineer @ GLG

GIT Co-Authors#

GitHub and GitLab both support the idea of co-authors which allow a user to attribute a commit to more than one author by adding one or more Co-authored-by trailers to the commit's message.

Co-author attibuting looks somethink like the following in the commit message.

Co-authored-by: name <name@example.com>
Co-authored-by: another-name <another-name@example.com>

Terraform Repo and Workspace Layout Part 1

Phil Hadviger

Phil Hadviger

Principal Site Reliability Engineer @ GLG

Infrastructure Breakdown#

I prefer using a monorepo approach for my Terraform configuration, based on a primary provider. So take this example folder structure, where I work with Sumo Logic and AWS and then read more below on how all this works out in practice.

security -> CODEOWNERS
tooling -> /.dev
provider -> /aws
account -> /management-account
purpose -> /core
purpose -> /cloudtrail
/modules
component -> /aws-trail
component -> /sumologic-source
account -> /dormant-ninja-prod
purpose -> /core
purpose -> /tokyo
/outsourced
tooling -> /.dev
purpose -> /project-x
purpose -> /project-y
provider -> /sumologic
account -> /dormant-ninja
purpose -> /jp

Multi-line Regex In Javascript with Comments

Phil Hadviger

Phil Hadviger

Principal Site Reliability Engineer @ GLG

Regular Expressions are great, but not easy to look at!

Let's take for example a regular expression in Javascript for parsing an email adddress.

^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$

To a trained eye this is likely as least readable enough, that they can guess that this parses an email address. But most people I work with, and myself included aren't going to be able to tell if there are any obvious bugs in this.