Repository navigation
Apply the best-practices review: SQLite, paging, list summaries, health checks and build rules - #24
Merged
Merged
Conversation
- Turn on nullable reference types and fix every warning - Page the search and list tools with offset and limit, returning nextOffset instead of a cursor - Pass the CancellationToken through every tool, resource and prompt - Let reviews_write change only the stars of an existing review - Store data in SQLite with EF Core migrations, seeded once at startup with a fixed seed - Run tests against a throwaway in-memory SQLite database - Register the DbContext and repositories as scoped, fixing concurrent request failures - Only publish from stphnwlsh/CleanModelContextProtocol - Remove committed coverage reports
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24 +/- ##
==========================================
- Coverage 98.97% 98.51% -0.47%
==========================================
Files 68 73 +5
Lines 686 741 +55
Branches 41 51 +10
==========================================
+ Hits 679 730 +51
- Partials 7 11 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…checks - Check code style and the recommended analyzers on every build and treat warnings as errors - Move package versions into Directory.Packages.props and check formatting in CI - List movies and authors as summaries with a review count and average stars worked out in SQL - Add queries that fetch the reviews of many movies or authors in one call - Seed sample data only when Database:SeedSampleData is on - Give each repository test its own in-memory database - Add /health/live and /health/ready, and a HEALTHCHECK in the image - Run the container as the non-root app user with the database on a volume - Send HSTS outside local runs and redirect to HTTPS early in the pipeline - Pin the Seq image and let Dependabot update it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This applies the decisions from the best-practices review, plus the follow-ups from the second pass.
Shared layers, identical in all five repos:
Database:SeedSampleDatais on, which it is in the local and Docker settings and nowhere else.LIKEwith escaping, so it translates to SQL.MovieSummaryandAuthorSummary, with a review count and average stars worked out in SQL, so a page no longer loads every review. The by-id queries still return the reviews. NewGetReviewsForMoviesandGetReviewsForAuthorsqueries fetch the reviews of many movies or authors in one call.ExecuteDeleteAsyncandExecuteUpdateAsync, and the CancellationToken flows from the presentation layer down to EF Core.Directory.Build.props: code style and the recommended analyzers are checked on every build and warnings fail it. Package versions live inDirectory.Packages.props, and CI runsdotnet format --verify-no-changes..github/release.yml: breaking changes, new features, bug fixes, documentation, build and pipeline, and dependencies.*.dbfiles and coverage reports are now ignored.MCP server:
movies_search,authors_searchandreviews_listtakeoffsetandlimit, and returnnextOffset(null on the last page) instead of a cursor.movies_searchandauthors_searchread the review count and average from the summaries. WithincludeReviewsthey fetch the reviews of the whole page in one query.reviews_writewith areviewIdchanges only the stars.movieIdandauthorIdare only needed to create a review./health/liveand/health/readyanswer without a token.appuser, keeps the database on a volume at/app/data, and has aHEALTHCHECK.Related issues
None.
Type of change
Shared layers
Checklist
dotnet buildanddotnet testpass locally with no warnings.