Skip to content

858/07: peel EventGuide into EventGuideDbContext#1119

Open
peterdrier wants to merge 2 commits into
858/06-surveysfrom
858/07-eventguide
Open

858/07: peel EventGuide into EventGuideDbContext#1119
peterdrier wants to merge 2 commits into
858/06-surveysfrom
858/07-eventguide

Conversation

@peterdrier

Copy link
Copy Markdown
Owner

Peel 7 — the final peel of the stacked sequence for nobodies-collective#858. Base = 858/06-surveys. Merge bottom-up.

Tables owned

events, event_categories, event_venues, event_guide_settings, event_moderation_actions, event_favourites, event_preferences (7 tables; four intra-section FKs verified behavior-identical to the old chain; all user/camp references are bare Guid columns). The Shifts-owned event_settings and event_participations are explicitly NOT part of this section and remain in the main pile — verified in both models.

What's in the peel

  • EventGuideDbContext mapping only the seven tables; own __EFMigrationsHistory_EventGuide; real-up baseline 20260715112050_BaselineEventGuide (7 CreateTable + 13 indexes incl. the NullsDistinct(false) per-occurrence favourites unique index + the 8-row event_categories seed) under Migrations/EventGuide/; registered via AddSectionDbContext<EventGuideDbContext>(sentinel: "events").
  • Config move: seven EventGuide configurations from the Configurations root into Configurations/EventGuide/ (namespace-only renames).
  • HumansDbContext stops mapping the tables; snapshot-only PeelEventGuide migration with hand-emptied Up/Down (Peter-authorized exception, documented in-file). Snapshot diff = exactly the seven entity blocks + relationships (401 deletions, 0 insertions; reviewer verified the removed content is character-identical to the section snapshot — a verbatim model move).
  • EventRepository switches to IDbContextFactory<EventGuideDbContext> incl. its private MatchingFavourites helper; EventRepositoryTests migrated (its removed EnsureUser/EnsureCamp seeders were only feeding rows no assertion read — verified).
  • CI context loops + SectionMigrationRunnerTests case (with seed probe) extended.
  • Rider (flagged): one 3-line commit correcting two audit-count typos in the design doc (event_categories seed = 8 not 11; Surveys jsonb defaults = 8 not 7), surfaced by this peel's review. Doc-only; kept here to avoid re-running CI on the whole stack.

Audit dispositions applied (design doc §5 / §5.1)

The seed evolution got a dedicated review check: the old chain seeded 8 category rows once (AddEventsSection) and never touched them again; config HasData, baseline InsertData, Designer, and section snapshot all agree row-by-row (ids/slugs/IsSensitive/DisplayOrder). Index evolution (AddEventFavouriteDayOffset's drop-and-rebuild, Description 300→450, Host column) verified folded into the baseline. Physical-defaults audit: clean.

Verification evidence

  • Build clean; dotnet format --verify-no-changes clean.
  • Full suite green on first run (no flakes): 271 domain / 225 analyzers / 365 web / 3865 application / 119 integration (Docker).
  • has-pending-model-changes clean for all eight contexts.
  • Both baseline paths + schema equivalence proven for EventGuide on real Postgres (parameterized runner tests).
  • Proof-of-benefit: throwaway Designer = 432 lines / 7 entities; removed cleanly.
  • EF-migration-reviewer agent: PASS (its one note corrected the review brief itself, not the code).
  • Preview note: stacked PRs (base≠main) don't get preview deploys; mark-applied proof via runner tests, real preview at merge-time retarget.

nobodies-collective#858

🤖 Generated with Claude Code

@github-actions github-actions Bot added the db PR includes EF Core migration label Jul 15, 2026
@claude

claude Bot commented Jul 15, 2026

Copy link
Copy Markdown

Reviewed commit cc98741 — no issues found.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

PR Surface Report

Compared b0df743f...bdf16719. Scored with reforge 0.21.2.

Summary: 22 changed file(s) | EF migrations: 2 file(s), max 1/1 per context

Reforge Surface Score

metric base head delta
total 60777 60777 0

Section Deltas

No section score changes.

Rule Deltas

No rule score changes.

Interface Surface

No new interfaces or interface methods.

Diff Size

bucket added deleted
code 91 16
migrations 1174 804
tests 10 44
docs 3 3
other 3 3

New Files

  • src/Humans.Infrastructure/Data/EventGuideDbContext.cs
  • src/Humans.Infrastructure/Data/EventGuideDbContextFactory.cs
  • src/Humans.Infrastructure/Migrations/20260715112146_PeelEventGuide.cs
  • src/Humans.Infrastructure/Migrations/EventGuide/20260715112050_BaselineEventGuide.Designer.cs
  • src/Humans.Infrastructure/Migrations/EventGuide/20260715112050_BaselineEventGuide.cs
  • src/Humans.Infrastructure/Migrations/EventGuide/EventGuideDbContextModelSnapshot.cs

EF Migrations (OK)

  • src/Humans.Infrastructure/Migrations/20260715112146_PeelEventGuide.cs
  • src/Humans.Infrastructure/Migrations/EventGuide/20260715112050_BaselineEventGuide.cs

@peterdrier

Copy link
Copy Markdown
Owner Author

Ready for review — EventGuide peel (final of the stack), all DoD verified (reviewer PASS, CI green incl. the doc-count rider).

peterdrier and others added 2 commits July 16, 2026 08:33
…ive#858)

Move the EventGuide section's seven tables (events, event_categories,
event_venues, event_guide_settings, event_moderation_actions,
event_favourites, event_preferences) out of HumansDbContext into a
dedicated EventGuideDbContext with its own __EFMigrationsHistory_EventGuide
table and migrations under Migrations/EventGuide/.

- Add EventGuideDbContext + EventGuideDbContextFactory (internal-sealed,
  explicit configuration application; history table
  __EFMigrationsHistory_EventGuide). The Shifts-owned event_settings and
  event_participations tables stay in HumansDbContext.
- git mv the seven EventGuide entity configurations into
  Configurations/EventGuide/ and renamespace them accordingly.
- Remove the seven EventGuide DbSets from HumansDbContext and register the
  EventGuide configuration namespace in PeeledConfigurationNamespaces.
- Register the section context via AddSectionDbContext<EventGuideDbContext>
  (sentinel events).
- Switch EventRepository to IDbContextFactory<EventGuideDbContext> and its
  private MatchingFavourites helper to EventGuideDbContext.
- Add BaselineEventGuide (creates the seven tables, their intra-section FKs
  and indexes incl. the NullsDistinct=false per-occurrence favourites unique
  index, and the event_categories HasData seed) and the snapshot-only
  PeelEventGuide migration (emptied bodies per the #858 execution brief).
- Add EventGuideDbContext to the build.yml pending-model-changes and
  per-section-baseline apply loops, and add the EventGuide SectionCase to
  SectionMigrationRunnerTests (workshop-category seed probe). Migrate
  EventRepositoryTests to seed through EventGuideDbContext, dropping the
  now-modelless User/Camp seed helpers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
event_categories seed is 8 rows (verified by the peel-7 EF review against
the old chain — the 11 was an audit typo, never a divergence), and Surveys
carries 8 model-declared jsonb defaults, not 7.

nobodies-collective#858

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db PR includes EF Core migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant