Skip to content

docs(adr): add Architecture Decision Records (#372)#442

Merged
nanotaboada merged 1 commit intomasterfrom
docs/add-architecture-decision-records
Apr 2, 2026
Merged

docs(adr): add Architecture Decision Records (#372)#442
nanotaboada merged 1 commit intomasterfrom
docs/add-architecture-decision-records

Conversation

@nanotaboada
Copy link
Copy Markdown
Owner

@nanotaboada nanotaboada commented Apr 2, 2026

Summary

  • Add adr/ directory with 12 Architecture Decision Records (ADRs) documenting the key architectural and technology decisions in this project
  • Add adr/README.md with ADR index, template, and guidance on when to create new ADRs
  • Update README.md with an Architecture Decisions section and ToC entry
  • Update CONTRIBUTING.md with ADR guidance for contributors
  • Update .github/copilot-instructions.md with ADR context loading instructions for AI agents

ADRs included

# Title
0001 Adopt Traditional Layered Architecture
0002 Use MVC Controllers over Minimal API
0003 Use SQLite for Data Storage
0004 Use UUID as Database Primary Key
0005 Use Squad Number as API Mutation Key
0006 Use RFC 7807 Problem Details for Errors
0007 Use FluentValidation over Data Annotations
0008 Use AutoMapper for DTO Mapping
0009 Implement In-Memory Caching
0010 Use Serilog for Structured Logging
0011 Use Docker for Containerization
0012 Use Stadium-Themed Semantic Versioning

Test plan

  • dotnet build --configuration Release — passed (0 warnings, 0 errors)
  • dotnet test --settings .runsettings — passed (39/39)
  • dotnet csharpier --check . — passed

Closes #372

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added an ADR directory with 12 Architecture Decision Records and an ADR index/template to document core architectural choices.
    • Updated README, CONTRIBUTING, and CHANGELOG to reference ADRs and require ADRs for architecture/process changes.
    • Recorded new guidance on release-tag conventions (stadium-themed semantic versioning) and containerization/operational decisions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 111837d0-6db2-4905-a030-54bc459a8c5c

📥 Commits

Reviewing files that changed from the base of the PR and between b6d6fd6 and 256c00e.

📒 Files selected for processing (17)
  • .github/copilot-instructions.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • adr/0001-adopt-traditional-layered-architecture.md
  • adr/0002-use-mvc-controllers-over-minimal-api.md
  • adr/0003-use-sqlite-for-data-storage.md
  • adr/0004-use-uuid-as-database-primary-key.md
  • adr/0005-use-squad-number-as-api-mutation-key.md
  • adr/0006-use-rfc-7807-problem-details-for-errors.md
  • adr/0007-use-fluentvalidation-over-data-annotations.md
  • adr/0008-use-automapper-for-dto-mapping.md
  • adr/0009-implement-in-memory-caching.md
  • adr/0010-use-serilog-for-structured-logging.md
  • adr/0011-use-docker-for-containerization.md
  • adr/0012-use-stadium-themed-semantic-versioning.md
  • adr/README.md
✅ Files skipped from review due to trivial changes (16)
  • README.md
  • CHANGELOG.md
  • adr/README.md
  • .github/copilot-instructions.md
  • adr/0006-use-rfc-7807-problem-details-for-errors.md
  • adr/0010-use-serilog-for-structured-logging.md
  • adr/0001-adopt-traditional-layered-architecture.md
  • adr/0003-use-sqlite-for-data-storage.md
  • adr/0012-use-stadium-themed-semantic-versioning.md
  • adr/0008-use-automapper-for-dto-mapping.md
  • adr/0002-use-mvc-controllers-over-minimal-api.md
  • adr/0009-implement-in-memory-caching.md
  • adr/0004-use-uuid-as-database-primary-key.md
  • adr/0007-use-fluentvalidation-over-data-annotations.md
  • adr/0005-use-squad-number-as-api-mutation-key.md
  • adr/0011-use-docker-for-containerization.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CONTRIBUTING.md

Walkthrough

Adds an ADR system: new adr/ directory with adr/README.md and 12 ADRs (0001–0012), plus documentation updates to README.md, CONTRIBUTING.md, CHANGELOG.md, and .github/copilot-instructions.md to integrate ADR guidance and agent context loading.

Changes

Cohort / File(s) Summary
ADR corpus
adr/README.md, adr/0001-adopt-traditional-layered-architecture.md, adr/0002-use-mvc-controllers-over-minimal-api.md, adr/0003-use-sqlite-for-data-storage.md, adr/0004-use-uuid-as-database-primary-key.md, adr/0005-use-squad-number-as-api-mutation-key.md, adr/0006-use-rfc-7807-problem-details-for-errors.md, adr/0007-use-fluentvalidation-over-data-annotations.md, adr/0008-use-automapper-for-dto-mapping.md, adr/0009-implement-in-memory-caching.md, adr/0010-use-serilog-for-structured-logging.md, adr/0011-use-docker-for-containerization.md, adr/0012-use-stadium-themed-semantic-versioning.md
Added ADR index/template and 12 ADR documents (0001–0012) following the canonical ADR structure; each file records decision, context, status, and consequences.
Repository docs & CI hints
README.md, CONTRIBUTING.md, CHANGELOG.md, .github/copilot-instructions.md
Inserted ADR references and workflow guidance: README link to ADRs, CONTRIBUTING requirement for ADRs on architecture-impacting changes, CHANGELOG entries for ADR additions, and Copilot instructions to load #file:adr/README.md for architecture questions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement ADRs using Michael Nygard template with Date, Status, Context, Decision, Consequences [#372]
Add adr/ dir with adr/README.md and ADRs 0001–0012 documenting specified decisions [#372]
Ensure ADRs are concise (1–2 pages), clear prose, and use canonical template [#372]
Mark ADR 0001 as “under reconsideration” to preserve historical context [#372]
Integrate ADR practice into workflow: update CONTRIBUTING, README, .github/copilot-instructions, and PR review checklist [#372] PR review checklist addition (or checklist file update) is not present in this diff.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits format with the 'docs' prefix, is under 80 characters (51 chars), and is descriptive and specific about adding Architecture Decision Records.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/add-architecture-decision-records
  • 🛠️ sync documentation: Commit on current branch
  • 🛠️ sync documentation: Create PR
  • 🛠️ enforce http error handling: Commit on current branch
  • 🛠️ enforce http error handling: Create PR
  • 🛠️ idiomatic review: Commit on current branch
  • 🛠️ idiomatic review: Create PR
  • 🛠️ verify api contract: Commit on current branch
  • 🛠️ verify api contract: Create PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
adr/0009-implement-in-memory-caching.md (1)

19-19: Include sliding expiration in the decision text for accuracy.

The implementation in src/Dotnet.Samples.AspNetCore.WebApi/Services/PlayerService.cs uses both a 1-hour absolute expiration and a 10-minute sliding expiration. Consider documenting both so the ADR fully reflects runtime behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@adr/0009-implement-in-memory-caching.md` at line 19, Update the ADR text to
mention that the in-memory cache uses both a one-hour absolute expiration and a
10-minute sliding expiration (matching the implementation in PlayerService and
IMemoryCache usage), so state that cached entries expire after 1 hour absolute
but their TTL is extended by 10 minutes on access; ensure wording references
IMemoryCache and PlayerService to link the decision to the runtime behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@adr/0003-use-sqlite-for-data-storage.md`:
- Line 17: The ADR uses a placeholder path for the SQLite file; update the
sentence in adr/0003-use-sqlite-for-data-storage.md (the line referencing the DB
file) to use the actual project path and filename used elsewhere
(storage/players-sqlite3.db) so it matches the repository docs and Docker volume
instructions.

In `@adr/0004-use-uuid-as-database-primary-key.md`:
- Line 17: The ADR incorrectly claims IDs are generated in application code via
Guid.NewGuid(); instead update the ADR to state that ID generation is delegated
to EF Core/database (reference entity.Property(...).ValueGeneratedOnAdd() in
PlayerDbContext and the Player.Id field initializer public Guid Id { get; set; }
= Guid.NewGuid() being superseded), and revise the positive consequences
paragraph to reflect that IDs are DB/ORM-generated; if you intended
application-side generation instead, remove ValueGeneratedOnAdd() and ensure Id
is assigned (e.g., via constructor or field initializer) before SaveChanges so
the ADR matches the chosen implementation.

In `@adr/0005-use-squad-number-as-api-mutation-key.md`:
- Line 19: The ADR text contradicts itself about using UUIDs in URLs; update the
wording at the sentence referencing Id to scope the decision to mutation and
primary lookup routes only — state that squadNumber will be used as the route
parameter for single-resource mutation endpoints (PUT /players/squadNumber/{n}
and DELETE /players/squadNumber/{n}) and for primary lookup routes where
applicable, and remove or change the documented GET /players/{id:Guid} example
so it uses squadNumber (GET /players/squadNumber/{n}) or otherwise explicitly
call out when UUID-based GETs are allowed; adjust the lines referencing GET
/players/{id:Guid} to match this scoped decision.

In `@adr/0006-use-rfc-7807-problem-details-for-errors.md`:
- Line 32: Update the sentence about the `type` field to state that while
RFC7807's canonical URI (https://tools.ietf.org/html/rfc7807) is commonly used
as a default, this project does not rely on a single global URI — individual
controllers may set custom problem `Type` URIs (see the PlayerController.cs
usage of the Type property for 409 responses). Rephrase to indicate a general
default exists but controllers like PlayerController may override the `Type`
with project- or problem-specific URIs.

In `@adr/0008-use-automapper-for-dto-mapping.md`:
- Line 17: The ADR misstates how the Player.Id is protected: instead of saying
the Id is "explicitly ignored in the PlayerRequestModel → Player mapping,"
update the text to state that PlayerRequestModel simply does not expose an Id
property so clients cannot set it (i.e., the absence of the Id on
PlayerRequestModel enforces protection), and remove the claim that this is
handled by "a single declarative line in the profile"; retain references to
PlayerMappingProfile and AddAutoMapper(typeof(PlayerMappingProfile)) so readers
know where mappings live and clarify that no explicit .ForMember(...Ignore()) is
required for Id because the request DTO lacks that property.

---

Nitpick comments:
In `@adr/0009-implement-in-memory-caching.md`:
- Line 19: Update the ADR text to mention that the in-memory cache uses both a
one-hour absolute expiration and a 10-minute sliding expiration (matching the
implementation in PlayerService and IMemoryCache usage), so state that cached
entries expire after 1 hour absolute but their TTL is extended by 10 minutes on
access; ensure wording references IMemoryCache and PlayerService to link the
decision to the runtime behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bd405eeb-2a5f-4d28-be74-51d6f9c81789

📥 Commits

Reviewing files that changed from the base of the PR and between a6e8f12 and b6d6fd6.

📒 Files selected for processing (17)
  • .github/copilot-instructions.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • adr/0001-adopt-traditional-layered-architecture.md
  • adr/0002-use-mvc-controllers-over-minimal-api.md
  • adr/0003-use-sqlite-for-data-storage.md
  • adr/0004-use-uuid-as-database-primary-key.md
  • adr/0005-use-squad-number-as-api-mutation-key.md
  • adr/0006-use-rfc-7807-problem-details-for-errors.md
  • adr/0007-use-fluentvalidation-over-data-annotations.md
  • adr/0008-use-automapper-for-dto-mapping.md
  • adr/0009-implement-in-memory-caching.md
  • adr/0010-use-serilog-for-structured-logging.md
  • adr/0011-use-docker-for-containerization.md
  • adr/0012-use-stadium-themed-semantic-versioning.md
  • adr/README.md

Comment thread adr/0003-use-sqlite-for-data-storage.md Outdated
Comment thread adr/0004-use-uuid-as-database-primary-key.md Outdated
Comment thread adr/0005-use-squad-number-as-api-mutation-key.md Outdated
Comment thread adr/0006-use-rfc-7807-problem-details-for-errors.md Outdated
Comment thread adr/0008-use-automapper-for-dto-mapping.md Outdated
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@nanotaboada nanotaboada force-pushed the docs/add-architecture-decision-records branch from b6d6fd6 to 256c00e Compare April 2, 2026 17:57
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 2, 2026

@nanotaboada nanotaboada merged commit 295043c into master Apr 2, 2026
9 checks passed
@nanotaboada nanotaboada deleted the docs/add-architecture-decision-records branch April 2, 2026 18:05
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

Successfully merging this pull request may close these issues.

Implement Architecture Decision Records (ADRs)

1 participant