Skip to content

[PM-15159] Create SelfHostedOrganizationSignUp command #6089

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

r-tome
Copy link
Contributor

@r-tome r-tome commented Jul 15, 2025

🎟️ Tracking

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

📔 Objective

Extract the method SignUpAsync from OrganizationService into a command.

⏰ 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

Copy link
Contributor

github-actions bot commented Jul 15, 2025

Logo
Checkmarx One – Scan Summary & Details53dedede-e1b9-4786-82c1-686d190a17bc

New Issues (1)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
HIGH Path_Traversal /src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs: 55
detailsMethod PostLicenseAsync at line 55 of /src/Api/Controllers/SelfHosted/SelfHostedOrganizationLicensesController.cs gets dynamic data from the model...
ID: 3ZPgFdAbYBljfrl3SPq64VnQ6T4%3D
Attack Vector
Fixed Issues (4)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
HIGH CVE-2022-37620 Npm-html-minifier-4.0.0
MEDIUM Use_Of_Hardcoded_Password /src/Core/Constants.cs: 203
LOW CVE-2025-5889 Npm-brace-expansion-2.0.1
LOW CVE-2025-5889 Npm-brace-expansion-1.1.11

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 94.40559% with 8 lines in your changes missing coverage. Please review.

Project coverage is 48.30%. Comparing base (9b65e9f) to head (70e1c79).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...ganizations/SelfHostedOrganizationSignUpCommand.cs 96.40% 3 Missing and 2 partials ⚠️
...Hosted/SelfHostedOrganizationLicensesController.cs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6089      +/-   ##
==========================================
- Coverage   51.48%   48.30%   -3.19%     
==========================================
  Files        1730     1728       -2     
  Lines       76302    76342      +40     
  Branches     6844     6821      -23     
==========================================
- Hits        39287    36878    -2409     
- Misses      35466    37979    +2513     
+ Partials     1549     1485      -64     

☔ View full report in Codecov by Sentry.
📢 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.

@r-tome r-tome marked this pull request as ready for review July 15, 2025 15:13
@r-tome r-tome requested review from a team as code owners July 15, 2025 15:13
@r-tome r-tome requested a review from jrmccannon July 15, 2025 15:13
Copy link
Contributor

@jrmccannon jrmccannon left a comment

Choose a reason for hiding this comment

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

Normally we break these up into separate files:

SelfHostedOrganizationSignUpRequest
SelfHostedOrganizationSignUpResult
ISelfHostedOrganizationSignUpCommand
SelfHostedOrganizationSignUpCommand

Personally, I'm fine with them being in the same file but I think the pattern is separate files for every class.

We can fix this later if we decide to make more improvements later.

jrmccannon
jrmccannon previously approved these changes Jul 16, 2025
@r-tome r-tome marked this pull request as draft July 16, 2025 12:57
@r-tome r-tome force-pushed the ac/pm-15159/create-selfhostorganizationsignup-command branch from 33bdd2a to d24725d Compare July 16, 2025 12:57
r-tome added 2 commits July 16, 2025 14:04
…ISelfHostedOrganizationSignUpCommand interface to reflect nullable types for organizationUser and collectionName.
Copy link

@r-tome
Copy link
Contributor Author

r-tome commented Jul 16, 2025

Normally we break these up into separate files:

SelfHostedOrganizationSignUpRequest
SelfHostedOrganizationSignUpResult
ISelfHostedOrganizationSignUpCommand
SelfHostedOrganizationSignUpCommand

Personally, I'm fine with them being separate but I think the pattern is separate files for every class.

We can fix this later if we decide to make more improvements later.

I've reverted back to having the full input parameters and the result tuple. I also moved the interface into its own file. I'll leave the CommandResult pattern refactor for another time, its outside the scope for this task.

@r-tome r-tome requested a review from jrmccannon July 16, 2025 13:19
@r-tome r-tome marked this pull request as ready for review July 16, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants