Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Features to SDK #70

Merged
merged 7 commits into from
Dec 20, 2024
Merged

Move Features to SDK #70

merged 7 commits into from
Dec 20, 2024

Conversation

justindbaur
Copy link
Member

🎟️ Tracking

📔 Objective

Move the Bitwarden.Extensions.Hosting.Features into Bitwarden.Server.Sdk.Features. I slightly changed the layout of the SDK so that it can also get referenced locally. Also since the files are actually a part of the complilation of the consuming project using internal doesn't hide things from them. Instead I do my best to hide it and discourage its use with an [Obsolete] attribute. Long term, stabilized features should probably be moved into their own smaller nuget package. That would allow them to keep internal in their own assembly and define their own package references. Then the Bitwarden.Server.Sdk is just an orchestrator of features to packages.

⏰ 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

@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<Import Project="../../src/Sdk/Sdk.props" />
Copy link
Member Author

Choose a reason for hiding this comment

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

<Import props />

...

<Import targets />

Is what a <Sdk /> reference does for you under the hood so this is a good test of the SDK.

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Logo
Checkmarx One – Scan Summary & Detailse2ece568-3b83-4fb2-b6d5-724d71a7028e

No New Or Fixed Issues Found

withinfocus
withinfocus previously approved these changes Dec 19, 2024
Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

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

Couple things but nothing stopping a merge necessarily. The obsoletion approach works for me and I genuinely wonder if we'll ever get to separating these out into other packages ... seems like a lot of effort.

@@ -198,6 +146,7 @@ private static void AddSelfHostedConfig(IConfigurationBuilder configurationBuild

private static void AddLogging(IServiceCollection services, IConfiguration configuration, IHostEnvironment environment)
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 With the logic shift into these methods and since logging, metrics, etc. might not actually get added, should the methods be named differently? Not sure what the norm is here, but you're not authoritatively "adding" one of these with the method call now.

Copy link
Member Author

Choose a reason for hiding this comment

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

They are private methods only used within the class so I chose the "easy" path. I either need to add a compile time check around the entire method and in the two places it's called or just do this and leave a no-op. So I chose this only because 1 < 3.

@withinfocus
Copy link
Contributor

Just looked at the CI -- probably want to drop in a preliminary PR with a global.json since .NET 9 is now rolling out to GitHub Actions.

@justindbaur justindbaur mentioned this pull request Dec 19, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 37.06%. Comparing base (ac75a69) to head (146dcde).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...en.Server.Sdk/src/Content/HostBuilderExtensions.cs 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
- Coverage   37.88%   37.06%   -0.83%     
==========================================
  Files          38       37       -1     
  Lines        1127     1071      -56     
  Branches       99       91       -8     
==========================================
- Hits          427      397      -30     
+ Misses        666      642      -24     
+ Partials       34       32       -2     

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

@justindbaur justindbaur merged commit 99e0770 into main Dec 20, 2024
11 checks passed
@justindbaur justindbaur deleted the features-to-sdk branch December 20, 2024 14:33
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.

2 participants