Skip to content

Conversation

@justindbaur
Copy link
Member

@justindbaur justindbaur commented Feb 21, 2025

🎟️ Tracking

📔 Objective

When attempting to integrate the SDK into the Core and Api projects in bitwarden/server I ran into a couple problems with how the SDK was constructed. Before, we were including the IFeatureService into the compilation of each project but that has the problem where something like where Api references Core will get two copies of IFeatureService that will break dependency injection so we need there to be a single reference. To do that we need it to be pre-built into an assembly, so this puts all the features code into a new nuget package Bitwarden.Server.Sdk.Features, it's not expected that anyone would use it directly but there is nothing keeping that from working. Now only a single reference of this service will exist and DI will work fine.

I also opted for not including the Bitwarden.Server.Sdk entrypoint i.e UseBitwardenSdk in non web sdk projects. Various parts in that file rely on packages that are implicitly included in the web sdk. Instead of just forcing those packages on consumers directly it makes more since to just leave out the entrypoint and instead allow them to reference things like IFeatureService only.

The main brunt of changes is to allow the tests to reference a fake nuget feed including the Bitwarden.Server.Sdk.Features nuget package.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@codecov
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.75%. Comparing base (907ae9c) to head (e734cf8).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
- Coverage   37.06%   36.75%   -0.31%     
==========================================
  Files          37       36       -1     
  Lines        1071     1012      -59     
  Branches       91       86       -5     
==========================================
- Hits          397      372      -25     
+ Misses        642      609      -33     
+ Partials       32       31       -1     

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2025

Logo
Checkmarx One – Scan Summary & Details99c20417-f303-41ff-bc78-3ee904dd2493

Great job, no security vulnerabilities found in this Pull Request

dani-garcia
dani-garcia previously approved these changes Feb 21, 2025
@sonarqubecloud
Copy link

@justindbaur justindbaur enabled auto-merge (squash) February 21, 2025 19:16
@justindbaur justindbaur merged commit 50210c9 into main Feb 21, 2025
10 checks passed
@justindbaur justindbaur deleted the server-sdk-prep-for-inclusion branch February 21, 2025 19:25
@justindbaur justindbaur changed the title Server sdk prep for inclusion [PM-18071] Server sdk prep for inclusion Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants