How (not) to store build metadata in Git


DevOpsCon Munich Online
November 30, 2021

What is build metadata

Build metadata is fancy for build ID.

It identies a build and the artifacts it generates.

Spoiler

Wesley Yarde


https://github.com/wyarde
Senior Devops Engineer

Disclaimers

This talk

  • Uses fancy words
  • Is opinionated
  • Includes a live demo

You need a basic understanding of

  • Git
  • Containers
  • Build pipelines
  • (my) Humour

… in life!

Versioning

MAJOR.MINOR.PATCH

  • Describes public API
  • Incremented manually
  • Relatively static

BUILD METADATA

  • Links artifacts to commits
  • Determined by the system
  • Changes all the time


Semantic Versioning 2.0.0 - https://semver.org

For traceability

  • commit artifacts
  • 💤 Boring 💤

Keep track of all moving parts

  • commit artifacts
  • Only build what changed
  • 🎈 Fun! 🎈

Multiple moving parts

New feature, build 46

Git history

Git history

Git history

Let’s do IT!

  1. Where to store it
  2. How to manipulate it

1. Where?

  • In Git
  • …but not in commits
  • Git tags?
  • Git notes!

Git notes

Supplement a commit message without changing the commit itself

  • git notes add|remove|show|list
  • Stored as commits in refs/notes/

2. How?

Gino Keva - A simple Git Notes Key Value store https://github.com/philips-software/gino-keva

  • Store key/values in a note
  • List key/values for a commit

Demo

End

This talk

Demo

Gino Keva