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-1486] Feature: SM Billing #3073

Merged
merged 31 commits into from
Jul 24, 2023
Merged

[AC-1486] Feature: SM Billing #3073

merged 31 commits into from
Jul 24, 2023

Conversation

vvolkgang
Copy link
Member

@vvolkgang vvolkgang commented Jul 5, 2023

Type of change

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

Objective

Long-lived feature branch to support billing for Secrets Manager.

Requires clients PR: bitwarden/clients#5747

Code changes

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

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

shane-melton and others added 7 commits June 29, 2023 10:40
…SubscriptionItem (#3037)

* [AC-1423] Add AddonProduct and BitwardenProduct properties to BillingSubscriptionItem

- Add a helper method to determine the appropriate addon type based on the subscription items StripeId

* [AC-1423] Add helper to StaticStore.cs to find a Plan by StripePlanId

* [AC-1423] Use the helper method to set SubscriptionInfo.BitwardenProduct
* Adding the Secret manager to the Plan List

* Adding the unit test for the StaticStoreTests class

* Fix whitespace formatting

* Fix whitespace formatting

* Price update

* Resolving the PR comments

* Resolving PR comments

* Fixing the whitespace

* only password manager plans are return for now

* format whitespace

* Resolve the test issue

* Fixing the failing test

* Refactoring the Plan separation

* add a unit test for SingleOrDefault

* Fix the whitespace format

* Separate the PM and SM plans

* Fixing the whitespace

* Remove unnecessary directive

* Fix imports ordering

* Fix imports ordering

* Resolve imports ordering

* Fixing imports ordering

* Fix response model, add MaxProjects

* Fix filename

* Fix format

* Fix: seat price should match annual/monthly

* Fix service account annual pricing

* Changes for secret manager signup and upgradeplan

* Changes for secrets manager signup and upgrade

* refactoring the code

* Format whitespace

* remove unnecessary using directive

* Resolve the PR comment on Subscription creation

* Resolve PR comment

* Add password manager to the error message

* Add UseSecretsManager to the event log

* Resolve PR comment on plan validation

* Resolving pr comments for service account count

* Resolving pr comments for service account count

* Resolve the pr comments

* Remove the store procedure that is no-longer needed

* Rename a property properly

* Resolving the PR comment

* Resolve PR comments

* Resolving PR comments

* Resolving the Pr comments

* Resolving some PR comments

* Resolving the PR comments

* Resolving the build identity build

* Add additional Validation

* Resolve the Lint issues

* remove unnecessary using directive

* Remove the white spaces

* Adding unit test for the stripe payment

* Remove the incomplete test

* Fixing the failing test

* Fix the failing test

* Fix the fail test on organization service

* Fix the failing unit test

* Fix the whitespace format

* Fix the failing test

* Fix the whitespace format

* resolve pr comments

* Fix the lint message

* Resolve the PR comments

* resolve pr comments

* Resolve pr comments

* Resolve the pr comments

* remove unused code

* Added for sm validation test

* Fix the whitespace format issues

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
* change the stripeseat id

* change service accountId to align with new product

* make all the Id name for consistent
@vvolkgang vvolkgang changed the title Feature: SM Billing [AC-1486] Feature: SM Billing Jul 5, 2023
…3036)

* Create UpgradeSecretsManagerSubscription command

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
@bitwarden-bot
Copy link

bitwarden-bot commented Jul 10, 2023

Logo
Checkmarx One – Scan Summary & Details12a09cc0-3425-4157-bf2d-75a944b9a75f

No New Or Fixed Issues Found

eliykat and others added 7 commits July 10, 2023 18:52
* This is a pure lift & shift with no refactors

* Only register subscription commands in Api

---------

Co-authored-by: cyprain-okeke <cokeke@bitwarden.com>
* Fix SM parameters not being passed to Stripe

* Fix flaky test

* Fix error message
Copy link
Contributor

@Thomas-Avery Thomas-Avery left a comment

Choose a reason for hiding this comment

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

Looks good from SM changes, one minor ask around moving the Noop.

src/Core/Repositories/Noop/NoopServiceAccountRepository.cs Outdated Show resolved Hide resolved
@eliykat eliykat marked this pull request as ready for review July 13, 2023 01:05
@eliykat eliykat requested a review from a team as a code owner July 13, 2023 01:05
@eliykat eliykat marked this pull request as draft July 13, 2023 01:05
@eliykat
Copy link
Member

eliykat commented Jul 13, 2023

Moved back into draft until we've addressed the Checkmarx feedback, which @cyprain-okeke is looking into.

@bitwarden-devops-bot bitwarden-devops-bot temporarily deployed to QA Cloud July 14, 2023 12:46 Inactive
@cyprain-okeke cyprain-okeke marked this pull request as ready for review July 19, 2023 16:21
* Reinstate target attribute but add noopener noreferrer
@eliykat
Copy link
Member

eliykat commented Jul 19, 2023

@cyprain-okeke I thought we should still have the target="_blank" attribute to open the link in a new tab, but we can solve the Checkmarx feedback another way. See #3124.

@bitwarden-devops-bot bitwarden-devops-bot temporarily deployed to QA Cloud July 20, 2023 11:15 Inactive
@bitwarden-devops-bot bitwarden-devops-bot temporarily deployed to EU-QA Cloud July 20, 2023 19:30 Inactive
# Conflicts:
#	test/Core.Test/Services/StripePaymentServiceTests.cs
cyprain-okeke
cyprain-okeke previously approved these changes Jul 21, 2023
Copy link
Contributor

@cyprain-okeke cyprain-okeke left a comment

Choose a reason for hiding this comment

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

Thanks for the conflict resolution

eliykat
eliykat previously approved these changes Jul 24, 2023
Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

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

✅ each commit is approved in a separate PR or has otherwise been reviewed & approved now
✅ list of change files does not show any unexpected changes

Adding the Hold label until the clients PR has been approved. This can be merged when both are ready.

@eliykat eliykat added the hold Hold this PR or item until later; DO NOT MERGE label Jul 24, 2023
Copy link
Member

Choose a reason for hiding this comment

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

Date of migrator script needs to be updated

@eliykat eliykat dismissed stale reviews from cyprain-okeke and themself via 2c0ff09 July 24, 2023 04:24
r-tome
r-tome previously approved these changes Jul 24, 2023
r-tome
r-tome previously approved these changes Jul 24, 2023
This reverts commit 4fcb9da.

This is required to make feature flags work on the client
Copy link
Contributor

@cyprain-okeke cyprain-okeke left a comment

Choose a reason for hiding this comment

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

Looks good to me

src/Core/Constants.cs Show resolved Hide resolved
@eliykat eliykat removed the hold Hold this PR or item until later; DO NOT MERGE label Jul 24, 2023
@eliykat eliykat merged commit 3511138 into master Jul 24, 2023
45 of 46 checks passed
@eliykat eliykat deleted the feature/sm-billing branch July 24, 2023 22:05
@eliykat eliykat restored the feature/sm-billing branch July 24, 2023 23:32
@eliykat eliykat deleted the feature/sm-billing branch July 24, 2023 23:35
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.

9 participants