refactor: rename _clearMutex to _dbMutex in MongoDbResourceBuilderExtensions#267
Merged
Merged
Conversation
…ensions The semaphore guards all three MongoDB dev commands (Clear, Seed, Stats), not just the clear operation. Rename to _dbMutex for clarity. Closes #266 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
There was a problem hiding this comment.
Pull request overview
This PR renames the process-wide semaphore in MongoDbResourceBuilderExtensions from _clearMutex to _dbMutex to better reflect that it serializes all MongoDB dev commands (Clear, Seed, Stats) rather than only the clear operation.
Changes:
- Renamed the shared
SemaphoreSlimfield_clearMutex→_dbMutex. - Updated all call sites to use the new field name and adjusted the top-level comment accordingly.
| @@ -45,7 +45,7 @@ private static void WithClearDatabaseCommand( | |||
| executeCommand: async context => | |||
| { | |||
| // AC2: Non-blocking acquire — return immediately if another clear is already in flight. | |||
Comment on lines
50
to
51
| context.Logger.LogWarning( | ||
| "Clear MyBlog data skipped on {ResourceName} — a clear operation is already in progress.", |
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #267 +/- ##
=======================================
Coverage 86.57% 86.57%
=======================================
Files 44 44
Lines 1043 1043
Branches 116 116
=======================================
Hits 903 903
Misses 96 96
Partials 44 44
🚀 New features to boost your workflow:
|
10 tasks
mpaulosky
added a commit
that referenced
this pull request
May 8, 2026
## Sprint 18 — AppHost MongoDB Dev Commands Refactor This release promotes all Sprint 18 work from `dev` to `main`. ### What's included #### Feature work - **#262** — `refactor(apphost): extract WithClearDatabaseCommand into MongoDbResourceBuilderExtensions` - **#263** — `feat(AppHost): add WithSeedDataCommand for local dev seeding` - **#264** — `feat(AppHost): add WithShowStatsCommand for local dev stats` - **#267** — `refactor: rename _clearMutex to _dbMutex in MongoDbResourceBuilderExtensions` #### CI fixes - **#270** — `fix(ci): Blog → README Sync — push to dev instead of main` - **#271** — `fix(ci): add pre-flight token validation and fix permissions block in squad-mark-released` ### CI status - ✅ **Squad CI** (`ci.yml`) — green on latest `dev` commit -⚠️ **Test Suite** — 1 flaky test failure: `SeedMyBlogData Concurrent Invocations Allow Only One Run` (timing-sensitive concurrency test; race condition in test harness, not production code). All other 47 tests pass. Squad CI gate is the authoritative pass/fail gate. ### Notes - Last release tag: `v1.5.0` - `dev` is 55 commits ahead of `main` - No open Sprint 18 issues, no open PRs - Merge strategy: squash merge per playbook --- ## Release Checklist - [ ] Latest `dev` Squad CI is green ✅ - [ ] Release scope reviewed (Sprint 18 milestone closed, all 4 issues merged) - [ ] Breaking changes documented (none — additive AppHost extension methods only) - [ ] Flaky test acknowledged (`SeedMyBlogData Concurrent` — timing race in test, not prod) - [ ] Release notes drafted (see sprint summary above) - [ ] Aragorn approval received - [ ] Boromir confirms branch state and workflow health - [ ] PR CI passes before merge - [ ] Merge to `main` with squash merge - [ ] Tag `main` with appropriate `vX.Y.Z` after merge + CI green Closes the Sprint 18 release gate. Working as Boromir (DevOps) --------- Co-authored-by: Boromir <boromir@squad.dev> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Renames the shared semaphore
_clearMutex→_dbMutexinMongoDbResourceBuilderExtensions.The semaphore guards all three MongoDB dev commands (Clear, Seed, Stats), not just clear. The old name was misleading.
Changes
src/AppHost/MongoDbResourceBuilderExtensions.cs: rename field declaration and all 6 usage sites (3× WaitAsync + 3× Release) plus updated commentTesting
Closes #266
Working as Sam (Backend / .NET)