Skip to content

feat(sitecore-context): add ContentDatabase, Site, Language, User to Axlis.Sitecore.Context - #54

Merged
marioarce merged 8 commits into
developfrom
feature/53-sitecore-context-content-site-language-user
Sep 14, 2026
Merged

marioarce merged 8 commits into
developfrom
feature/53-sitecore-context-content-site-language-user

Conversation

@marioarce

@marioarce marioarce commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Extends Axlis.Sitecore.Context (published v0.1.0) with four new properties, captured per-request using the same thread-safe mechanism already used for .Database, .Request, and .HttpContext:

  • ContentDatabaseSitecore.Data.Database
  • SiteSitecore.Sites.SiteContext
  • LanguageSitecore.Globalization.Language
  • UserSitecore.Security.Accounts.User

Design follows the signed-off Axlis - SitecoreContext - Implementation Plan 2 (Final).md: all seven members (including the original three) are captured once in SitecoreContextHttpModule.OnBeginRequest and served from the thread-safe store for the rest of the request. Unlike Database/Request/HttpContext, Site/Language/User can legitimately change mid-request (language switch, login/impersonation, site switch) — this is a deliberate snapshot trade-off, not an oversight, and is documented in XML docs, both package READMEs, and docs/sitecore-context/Architecture.md.

This PR ships the package-level change only. samples/Axlis.Sitecore.Context.Samples.sln updates are a deferred follow-up. Version bump to 1.0.0 and the NuGet/GitHub Release happen later, in the release branch per SOP 5 in WORKFLOWS.md — not part of this PR.

Changes

  • Context.cs: 4 new public static properties, CapturedContext grown to 7 fields, Capture(...) grown to 7 params, new fallback helpers, extensive XML doc <remarks> on the snapshot semantics.
  • SitecoreContextHttpModule.cs: OnBeginRequest now captures and stores all 7 values.
  • Axlis.Sitecore.Context.Sitecore102/README.md: documents the 4 new properties and the snapshot-semantics trade-off; extends the manual verification checklist.
  • docs/sitecore-context/Architecture.md: new section explaining why Site/Language/User are captured the same way despite being commonly mutated mid-request.
  • Root README.md: package-family table updated to list all 7 members.
  • Axlis.Sitecore.Context.Sitecore102.csproj: <Description> updated.
  • AmbientContextStoreTests.cs (Axlis.Sitecore.Context.Abstractions.Tests): fixed 10 pre-existing warnings surfaced during local build verification (missing XML doc comments, a possible-null-reference return, and 3 unnecessary ConfigureAwait(false) calls in test methods) — required for the CONTRIBUTING.md Cross-Cutting Gate (0 warnings/0 errors). Out of this PR's original scope but fixed per explicit request.
  • .github/workflows/ci.yml: added build-customizations and build-sitecore-context jobs. CLAUDE.md/CHANGELOG.md already documented these jobs as existing, but only the original Axlis.ORM build job had ever been added — this closes that documentation/reality gap, and the job names now match what WORKFLOWS.md SOP 5 references.

Local build (Visual Studio): 3 succeeded, 0 failed, 0 errors, 0 warnings.

Test plan

  • Local build succeeds with 0 warnings, 0 errors (confirmed by Mario)
  • CI passes on this PR, including the new build-sitecore-context job
  • Manual verification against a real Sitecore 10.2.x instance (per README checklist) — to be run by Mario before the release branch is cut

Closes #53

…i.yml

Closes gap where CLAUDE.md and CHANGELOG.md documented these jobs as
already existing in ci.yml, but only the original Axlis.ORM `build`
job was ever added. Adds two new jobs mirroring the restore/build/test
steps from release-customizations.yml and release-sitecore-context.yml,
named to match what WORKFLOWS.md SOP 5 already references.
@marioarce marioarce self-assigned this Sep 14, 2026
@marioarce marioarce added enhancement New feature or request package Package labels Sep 14, 2026
@marioarce marioarce linked an issue Sep 14, 2026 that may be closed by this pull request
@marioarce
marioarce merged commit 96cf657 into develop Sep 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request package Package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Axlis.Sitecore.Context: add ContentDatabase, Site, Language, User

1 participant