Skip to content

docs: Sprint 5 caching ADR and XML doc stubs - #119

Closed
mpaulosky wants to merge 1 commit into
sprint/5-redis-cachingfrom
squad/114-docs-sprint5-caching
Closed

docs: Sprint 5 caching ADR and XML doc stubs#119
mpaulosky wants to merge 1 commit into
sprint/5-redis-cachingfrom
squad/114-docs-sprint5-caching

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner

Summary

Working as Frodo (Tech Writer) · closes #114

Assessed documentation impact for the Sprint 5 IBlogPostCacheService extraction and produced two deliverables for the team.

Changes

docs/adr/sprint5-caching-abstraction.md

Architecture Decision Record documenting the decision to extract a dedicated IBlogPostCacheService interface from the four BlogPost CQRS handlers. Captures:

  • Context: Inline duplication of L1/L2 cache options, JsonSerializerOptions, and hardcoded key strings across all handlers
  • Decision: Introduce IBlogPostCacheService, BlogPostCacheService, and BlogPostCacheKeys
  • Status: Accepted
  • Consequences: DRY handlers, single-mock testability, one additional indirection layer

docs/sprint5-xml-doc-stubs.md

Ready-to-paste XML doc comment stubs for Sam to apply when implementing:

  • IBlogPostCacheService – all 6 interface methods (GetAllAsync, SetAllAsync, GetByIdAsync, SetByIdAsync, RemoveAllAsync, RemoveByIdAsync)
  • BlogPostCacheKeys – class and two constant members
  • BlogPostCacheService – class-level <remarks> block
  • README.md update assessment: which sections need editing post-merge (Technology Stack, Learning Objectives)

Notes

⚠️ README.md itself is not updated in this PR — the stubs file documents what needs to change so it can be done as part of the Sprint 5 merge or a follow-up. The README still references the old in-memory repository model; those lines should be updated when the caching layer lands.

…print5)

- Add docs/adr/sprint5-caching-abstraction.md (ADR for IBlogPostCacheService)
- Add docs/sprint5-xml-doc-stubs.md (XML doc stubs for Sam to apply)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 02:05
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ PR Added to Squad Triage Queue

This PR has been labeled with squad and added to the triage queue.

Next steps:

  • The squad Lead will review and assign to an appropriate team member
  • A squad:member label will be added after triage

If you know which squad member should handle this, you can add the appropriate squad:member label yourself.

@github-actions github-actions Bot added the squad Squad triage inbox — Lead will assign to a member label Apr 24, 2026
@mpaulosky

Copy link
Copy Markdown
Owner Author

Closing as redundant. Both docs/adr/sprint5-caching-abstraction.md and docs/sprint5-xml-doc-stubs.md were already committed to sprint/5-redis-caching via the squash merge of PR #115 (commit c9117e6), which picked up Frodo's work through the shared worktree. The sprint branch already contains these files — this PR is a no-op. Issue #114 will be closed manually.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Sprint 5 documentation artifacts to support the upcoming caching abstraction work by recording the architectural decision and providing implementation-ready XML doc stubs.

Changes:

  • Added an ADR documenting the decision to extract IBlogPostCacheService/BlogPostCacheService and centralize cache keys.
  • Added a “ready-to-paste” XML doc stub pack for the new caching types and noted README sections needing follow-up updates.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docs/adr/sprint5-caching-abstraction.md New ADR capturing context/decision/status/consequences for the caching abstraction.
docs/sprint5-xml-doc-stubs.md New markdown document containing XML doc comment stubs and README update guidance for Sprint 5.

Comment on lines +1 to +2
# Sprint 5 — XML Doc Comment Stubs

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

This markdown file doesn’t follow the repo’s markdown validator rules: it starts with an H1 and has no YAML front matter. Per .github/instructions/markdown.instructions.md, docs should include YAML front matter and avoid H1 headings (start content at H2+). Add the required front matter block and change the first heading to ## (or restructure so there’s no H1).

Suggested change
# Sprint 5 — XML Doc Comment Stubs
---
post_title: "Sprint 5 — XML Doc Comment Stubs"
author1: "Frodo"
post_slug: "sprint5-xml-doc-stubs"
microsoft_alias: "unknown"
featured_image: ""
categories: []
tags:
- xml-docs
- caching
- redis
- sprint-5
ai_note: "No"
summary: "XML documentation comment stubs for the Sprint 5 blog post caching abstraction and related README updates."
post_date: "2026-04-23"
---
## Sprint 5 — XML Doc Comment Stubs

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +75
/// <summary>
/// Removes the all-posts cache entry from both L1 (in-memory) and L2 (Redis).
/// Call this after any write operation that affects the full post list
/// (create, edit, delete, publish/unpublish).
/// </summary>
/// <param name="ct">A <see cref="CancellationToken"/> to observe while waiting for the task to complete.</param>
/// <returns>A <see cref="Task"/> that represents the asynchronous invalidation operation.</returns>
Task InvalidateAllAsync(CancellationToken ct);

/// <summary>
/// Removes the per-post cache entry for the given identifier from both
/// L1 (in-memory) and L2 (Redis).
/// Call this after any write operation that modifies or deletes a specific post.
/// </summary>
/// <param name="id">The unique identifier of the blog post whose cache entry should be removed.</param>
/// <param name="ct">A <see cref="CancellationToken"/> to observe while waiting for the task to complete.</param>
/// <returns>A <see cref="Task"/> that represents the asynchronous invalidation operation.</returns>
Task InvalidateByIdAsync(Guid id, CancellationToken ct);
}

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

The PR description says the stubs cover RemoveAllAsync/RemoveByIdAsync, but the stubs here define InvalidateAllAsync/InvalidateByIdAsync. Please align the PR description and the doc stubs (method names + any references) so the intended API surface is unambiguous for the implementer.

Copilot uses AI. Check for mistakes.

### Registration

`BlogPostCacheService` is registered in `Program.cs` as a scoped or singleton service alongside `IMemoryCache` and the Redis `IDistributedCache`.

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

The ADR should capture a concrete decision, but this line says the service is registered as “scoped or singleton”. Please choose the intended lifetime (and ideally note why that lifetime is correct given the dependencies like IMemoryCache/IDistributedCache) so implementers don’t make inconsistent DI choices.

Suggested change
`BlogPostCacheService` is registered in `Program.cs` as a scoped or singleton service alongside `IMemoryCache` and the Redis `IDistributedCache`.
`BlogPostCacheService` is registered in `Program.cs` as a singleton service alongside `IMemoryCache` and the Redis `IDistributedCache`, because it is a stateless wrapper over shared cache dependencies and does not require per-request state.

Copilot uses AI. Check for mistakes.
@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.38%. Comparing base (7813f99) to head (461d7d0).
⚠️ Report is 5 commits behind head on sprint/5-redis-caching.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           sprint/5-redis-caching     #119      +/-   ##
==========================================================
- Coverage                   78.19%   70.38%   -7.81%     
==========================================================
  Files                          40       43       +3     
  Lines                         642      672      +30     
  Branches                      107      111       +4     
==========================================================
- Hits                          502      473      -29     
- Misses                         95      147      +52     
- Partials                       45       52       +7     

see 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mpaulosky
mpaulosky deleted the squad/114-docs-sprint5-caching branch April 24, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad Squad triage inbox — Lead will assign to a member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants