Back to Dependabot

I have started looking at dependabot again.

With the loss of the Heroku free tiers the old solution I used no longer works.

The first problem to solve is to detect PRs in need of merging.


declare -a arr=(“name1” “name2” “name3” )

for i in “${arr[@]}”
do
gh pr list -R owner/$i
done

The above is a bash script which requires you to have the gh cli tool installed and configured to access your repos.

This will help give you a report of the pending PRs to merge. It may need adapting if you have too many.

The next step is to start merging them.

Dependabot text commands are useful here. You can use `@dependabot merge` to assist with this.

The step beyond that is detecting the number of merged PRs to deploy. You don’t want a huge deploy in case it needs to be reverted.

You will never be clear of the upgrade treadmill. The best solution is to fully automate it.

To use that you need several things:

– a fast reliable deploy/rollback process

– a sufficient test suite

The best option is to automate the merging of dependabot PRs that pass all the tests. Beware false positives that other integrations can give (snyk).

You will also need an automated deploy process. Deploying the latest build every day at a fixed time would help this (this also ensures that you could at least deploy yesterday).

It is possible to rate limit dependabot to only having 10 open PRs at a time. This could help but could be problematic if you are in a fast moving environment like javascript.

Mermaid Diagrams

I will be giving a talk at work about how to use mermaid diagrams.

Here is a set of examples that make great starting points.

https://mermaid.js.org/syntax/examples.html

I have a confession: I can’t draw well,

However I can create useful diagrams,

Important Formula:

Cost To Create + Cost to Maintain > Value of diagrams

Mermaid allows cheap creation and maintenance allowing the ability to achieve value in cases where other techniques will be prohibitive.

The perfect is the enemy of good enough.

No Diagram is perfect.

It’s easier to offer suggestions to improve a diagram than a large text document.

It’s amazing how much you learn building a diagram.

Diagrams need to have a key. (Although with some diagram types the key can be shared)

Each symbol you use needs to have the same meaning everywhere.

Map vs Diagram – a map is a special kind of diagram where space has meaning.

Documenting Software Architectures: Views and Beyond.

Build them by copying and editing.

The friends:

These can be a bit more complex. Typically they require a command line tool to transform a file into an image

Graphviz (https://graphviz.org/gallery/)
Plantuml (https://plantuml.com/)

For interactive diagrams there is the excellent
d3js. (https://d3js.org/)