Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADR numbering sequence may break when merging multiple PRs #102

Open
DeniVuMedi opened this issue Oct 12, 2020 · 1 comment
Open

ADR numbering sequence may break when merging multiple PRs #102

DeniVuMedi opened this issue Oct 12, 2020 · 1 comment

Comments

@DeniVuMedi
Copy link

Let's imagine that the latest number in the ADR numbering sequence is 5.
Dev A creates a PR with an ADR (he/she denotes that ADR with number 6).
Dev B creates a PR with an ADR (he/she denotes that ADR with number 6).
Dev A and Dev B merge at a different point in time.
Now we have two ADRs with different names but the same number.

One possible solution is to have a lock file that would contain the last number. We would have to increment this number each time we create a new ADR. This way after Dev A merges, Dev B can't merge due to conflict that needs to be resolved.
The con of this solution is that a Dev may forget to modify the lock file.

Are there any other propositions on solving this issue?

@vlsi
Copy link

vlsi commented Mar 23, 2021

One of the solutions is to use dates instead of sequence.
The date can be in the filename prefix or it can be in metadata (e.g. file header or commit metadata)

That would solve the case of concurrent (long-live) branches.

An alternative way is to use an external sequencer (e.g. a dedicated branch in the repository), so the sequence is global for all PRs across all branches. However, then sequence number allocation becomes an API call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants