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

[AC-3020] Remove unused jslib code - services #575

Merged
merged 19 commits into from
Sep 4, 2024
Merged

Conversation

eliykat
Copy link
Member

@eliykat eliykat commented Sep 2, 2024

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Jira ticket: https://bitwarden.atlassian.net/browse/AC-3020

This is a first pass at removing unused jslib code from directory-connector - specifically, unused services.

My strategy here was to iteratively delete services (both the abstractions and implementations) which were unused by any other class. Carving up partially used services was out of scope - I was only removing services that were wholly unused. After doing this, I used depcheck to identify unused dependencies and removed the couple that I could.

This is a huge diff but most of it is just file deletion. There is no refactoring other than to update dependency injection to no longer instantiate these deleted classes. The proof is largely that the build still passes and the app bootstraps OK.

I have not removed non-service code. Most models are imported by ApiService and StateService - that is probably a separate effort to extract what's actually used from those classes.

Code changes

  • file.ext: Description of what was changed and why

Screenshots

Testing requirements

Before you submit

  • I have checked for linting errors (npm run lint) (required)
  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

@eliykat eliykat requested a review from a team as a code owner September 2, 2024 03:44
@eliykat eliykat requested review from r-tome and addisonbeck and removed request for r-tome September 2, 2024 03:44
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (f47806d) to head (3a0f272).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #575   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         56      56           
  Lines       2552    2534   -18     
  Branches     462     462           
=====================================
+ Misses      2552    2534   -18     

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

Copy link
Contributor

github-actions bot commented Sep 2, 2024

Logo
Checkmarx One – Scan Summary & Details7edbebed-2f52-4376-892b-8b9ad9ef1bf5

Fixed Issues

Severity Issue Source File / Package
LOW Client_Password_In_Comment /jslib/common/src/services/userVerification.service.ts: 25
LOW Client_Password_In_Comment /jslib/common/src/services/userVerification.service.ts: 25

@eliykat eliykat changed the title [AC-1995] Remove unused jslib code - services [AC-3020] Remove unused jslib code - services Sep 2, 2024
@eliykat eliykat merged commit eae9cac into main Sep 4, 2024
25 checks passed
@eliykat eliykat deleted the remove-unused-services branch September 4, 2024 22:11
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