Use the ADR slug as its unique ID
Oct 16, 2020
Petr Ruzicka
Context and Problem Statement¶
Currently, ADR files follow this format: NNNN-adr-title.md
, with NNNN being an incremental number from 0000
to 9999
.
It causes an issue during a git merge
when two developers have created a new ADR on their respective branch.
There is a conflict because an ADR number must be unique.
Decision¶
From now on, we won't use ADR numbers anymore.
An ADR will be uniquely identified by its slug (ie. its filename without the extension), and its filename will have the following format: YYYYMMDD-adr-title.md
, with YYYYMMDD
being the date of creation of the file.
As a result, there won't have conflicts anymore and the files will still be correctly sorted in the IDE thanks to the date.
Finally, the ADRs will be sorted with these rules (ordered by priority):
- By Date field, in the Markdown file (if present)
- By Git creation date (does not follow renames)
- By file creation date if no versioned yet
- By slug
The core library is responsible for sorting.
Links¶
- Supersedes Use the ADR number as its unique ID