Skip to content

[PM-40343] Extract ITableObject, IRepository, CombGuid to Data#7976

Merged
Hinton merged 2 commits into
mainfrom
extract-data-base-project
Jul 14, 2026
Merged

[PM-40343] Extract ITableObject, IRepository, CombGuid to Data#7976
Hinton merged 2 commits into
mainfrom
extract-data-base-project

Conversation

@Hinton

@Hinton Hinton commented Jul 14, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-40343

📔 Objective

Extract the shared persistence primitives — ITableObject<T>, IRepository<T, TId>, and comb-GUID generation — out of Core and into a new lightweight Data base project, so libraries that need only these primitives can depend on Data instead of taking a reference on all of Core.

Details:

  • ITableObject.cs and IRepository.cs are moved verbatim from Core to src/Data, preserving their namespaces (Bit.Core.Entities, Bit.Core.Repositories). Because the namespaces are unchanged, no consuming code changes — everything recompiles against the moved types.
  • Comb-GUID generation is extracted into a new Bit.Core.Utilities.CombGuid in Data. CoreHelpers.GenerateComb() now delegates to CombGuid.Generate() (the implementation is unchanged), so existing call sites keep working.
  • Core now references Data; the project is registered in bitwarden-server.slnx.

Pure move + delegation, no behavioral change. Verified with a full dotnet build bitwarden-server.slnx.

📸 Screenshots

N/A

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed a foundational refactor that extracts ITableObject<T>, IRepository<T, TId>, and comb-GUID generation out of Core into a new lightweight Data base project. The two interfaces are moved verbatim with their namespaces preserved (Bit.Core.Entities, Bit.Core.Repositories), and comb-GUID logic is lifted into a new Bit.Core.Utilities.CombGuid that CoreHelpers.GenerateComb() now delegates to. Verified the move is behavior-preserving: the comb algorithm and _baseDateTicks are byte-for-byte identical, namespaces are unchanged so no consumer edits are required, the internal GenerateComb(Guid, DateTime) overload remains for existing test consumers, and the empty Data.csproj builds because Directory.Build.props supplies TargetFramework, Nullable, ImplicitUsings, and RootNamespace.

Code Review Details

No findings at or above the reporting threshold. This is a clean, low-risk move + delegation refactor with no behavioral change.

@Hinton Hinton changed the title Extract ITableObject, IRepository, and comb-guid generation into a Data base project [PM-40343] Extract ITableObject, IRepository, CombGuid to Data Jul 14, 2026
@Hinton Hinton added the t:tech-debt Change Type - Tech debt label Jul 14, 2026
@Hinton Hinton requested a review from justindbaur July 14, 2026 12:28
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.56%. Comparing base (411d38a) to head (c731930).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7976      +/-   ##
==========================================
+ Coverage   61.49%   66.56%   +5.06%     
==========================================
  Files        2249     2277      +28     
  Lines       99057    99406     +349     
  Branches     8959     8980      +21     
==========================================
+ Hits        60917    66170    +5253     
+ Misses      35989    30968    -5021     
- Partials     2151     2268     +117     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/Data/Utilities/CombGuid.cs Outdated
Comment thread src/Data/Utilities/CombGuid.cs Outdated
Comment thread src/Data/Data.csproj Outdated
Comment thread src/Core/Utilities/CoreHelpers.cs
Comment thread src/Core/Utilities/CoreHelpers.cs Outdated
- Move Data project to src/Libraries/Data (slnx + Core.csproj reference)
- Remove redundant #nullable enable from CombGuid (set in Directory.Build.props)
- Make CombGuid.Generate(Guid, DateTime) internal (test-only helper)
- Mark CoreHelpers.GenerateComb() [Obsolete] in favor of CombGuid.Generate()
- Delete CoreHelpers.GenerateComb(Guid, DateTime); move comb generation tests
  into a new test/Libraries/Data.Test project (InternalsVisibleTo Data.Test/Core.Test)
- Repoint NotificationHub tests off the deleted overload
@Hinton Hinton requested a review from a team as a code owner July 14, 2026 14:42

@dani-garcia dani-garcia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Platform changes lgtm

@Hinton Hinton merged commit 85a4d5e into main Jul 14, 2026
49 of 50 checks passed
@Hinton Hinton deleted the extract-data-base-project branch July 14, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants