[CLD-7567] Deprecate Self Serve: Second Pass (#26853)

* Deprecate Self Serve: First Pass

* Fix ci

* Fix more ci

* Remmove outdated server tests

* Fix a missed spot opening purchase modal in Self Hosted

* Fix i18n

* Clean up some more server code, fix webapp test

* Fix alignment of button

* Fix linter

* Fix i18n server side

* Deprecate in product true up

* Add back translation

* Remove client functions

* Put back client functions

* webapp deprecation

* Deprecate Self Serve: Second Pass

* Fix various pipeline issues

* Fix linter

* Fix pipelines

* Fix handlers_test.go

* Fix console.error around hostedCustomer in reducer

* PICKY LINTER PLEASE

* Fix webapp tests, various other fixes for the CI pipelines

* Fix i18n

* Updates to accomadate enterprise code removal

* Fix mocks

* More removal

* Fix

* Adjustments from PR

* Fixes for QA Feedback

* Update

* Add migrations to remove true up review history

* Fix migrations check

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: maria.nunez <maria.nunez@mattermost.com>
Этот коммит содержится в:
Nick Misasi
2024-05-02 09:15:15 -04:00
коммит произвёл GitHub
родитель 6028cbe4e2
Коммит f1019d076e
127 изменённых файлов: 169 добавлений и 8222 удалений

Просмотреть файл

@@ -5,7 +5,6 @@ package einterfaces
import (
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/shared/request"
)
type CloudInterface interface {
@@ -14,11 +13,7 @@ type CloudInterface interface {
GetSelfHostedProducts(userID string) ([]*model.Product, error)
GetCloudLimits(userID string) (*model.ProductLimits, error)
CreateCustomerPayment(userID string) (*model.StripeSetupIntent, error)
ConfirmCustomerPayment(userID string, confirmRequest *model.ConfirmPaymentMethodRequest) error
GetCloudCustomer(userID string) (*model.CloudCustomer, error)
GetLicenseSelfServeStatus(userID string, token string) (*model.SubscriptionLicenseSelfServeStatusResponse, error)
UpdateCloudCustomer(userID string, customerInfo *model.CloudCustomerInfo) (*model.CloudCustomer, error)
UpdateCloudCustomerAddress(userID string, address *model.Address) (*model.CloudCustomer, error)
@@ -28,32 +23,17 @@ type CloudInterface interface {
ChangeSubscription(userID, subscriptionID string, subscriptionChange *model.SubscriptionChange) (*model.Subscription, error)
RequestCloudTrial(userID, subscriptionID, newValidBusinessEmail string) (*model.Subscription, error)
ValidateBusinessEmail(userID, email string) error
InvalidateCaches() error
// hosted customer methods
SelfHostedSignupAvailable() error
BootstrapSelfHostedSignup(req model.BootstrapSelfHostedSignupRequest) (*model.BootstrapSelfHostedSignupResponse, error)
CreateCustomerSelfHostedSignup(req model.SelfHostedCustomerForm, requesterEmail string) (*model.SelfHostedSignupCustomerResponse, error)
ConfirmSelfHostedSignup(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error)
ConfirmSelfHostedExpansion(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error)
ConfirmSelfHostedSignupLicenseApplication() error
GetSelfHostedInvoices(rctx request.CTX) ([]*model.Invoice, error)
GetSelfHostedInvoicePDF(invoiceID string) ([]byte, string, error)
CreateOrUpdateSubscriptionHistoryEvent(userID string, userCount int) (*model.SubscriptionHistory, error)
HandleLicenseChange() error
CheckCWSConnection(userId string) error
SelfServeDeleteWorkspace(userID string, deletionRequest *model.WorkspaceDeletionRequest) error
SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error
// Used only for when a customer has telemetry disabled. In this scenario, true up review telemetry will be submitted via CWS.
SubmitTrueUpReview(userID string, trueUpReviewProfile map[string]any) error
ApplyIPFilters(userID string, ranges *model.AllowedIPRanges) (*model.AllowedIPRanges, error)
GetIPFilters(userID string) (*model.AllowedIPRanges, error)
GetInstallation(userID string) (*model.Installation, error)

Просмотреть файл

@@ -6,7 +6,6 @@ package mocks
import (
model "github.com/mattermost/mattermost/server/public/model"
request "github.com/mattermost/mattermost/server/public/shared/request"
mock "github.com/stretchr/testify/mock"
)
@@ -45,36 +44,6 @@ func (_m *CloudInterface) ApplyIPFilters(userID string, ranges *model.AllowedIPR
return r0, r1
}
// BootstrapSelfHostedSignup provides a mock function with given fields: req
func (_m *CloudInterface) BootstrapSelfHostedSignup(req model.BootstrapSelfHostedSignupRequest) (*model.BootstrapSelfHostedSignupResponse, error) {
ret := _m.Called(req)
if len(ret) == 0 {
panic("no return value specified for BootstrapSelfHostedSignup")
}
var r0 *model.BootstrapSelfHostedSignupResponse
var r1 error
if rf, ok := ret.Get(0).(func(model.BootstrapSelfHostedSignupRequest) (*model.BootstrapSelfHostedSignupResponse, error)); ok {
return rf(req)
}
if rf, ok := ret.Get(0).(func(model.BootstrapSelfHostedSignupRequest) *model.BootstrapSelfHostedSignupResponse); ok {
r0 = rf(req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.BootstrapSelfHostedSignupResponse)
}
}
if rf, ok := ret.Get(1).(func(model.BootstrapSelfHostedSignupRequest) error); ok {
r1 = rf(req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ChangeSubscription provides a mock function with given fields: userID, subscriptionID, subscriptionChange
func (_m *CloudInterface) ChangeSubscription(userID string, subscriptionID string, subscriptionChange *model.SubscriptionChange) (*model.Subscription, error) {
ret := _m.Called(userID, subscriptionID, subscriptionChange)
@@ -123,162 +92,6 @@ func (_m *CloudInterface) CheckCWSConnection(userId string) error {
return r0
}
// ConfirmCustomerPayment provides a mock function with given fields: userID, confirmRequest
func (_m *CloudInterface) ConfirmCustomerPayment(userID string, confirmRequest *model.ConfirmPaymentMethodRequest) error {
ret := _m.Called(userID, confirmRequest)
if len(ret) == 0 {
panic("no return value specified for ConfirmCustomerPayment")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, *model.ConfirmPaymentMethodRequest) error); ok {
r0 = rf(userID, confirmRequest)
} else {
r0 = ret.Error(0)
}
return r0
}
// ConfirmSelfHostedExpansion provides a mock function with given fields: req, requesterEmail
func (_m *CloudInterface) ConfirmSelfHostedExpansion(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error) {
ret := _m.Called(req, requesterEmail)
if len(ret) == 0 {
panic("no return value specified for ConfirmSelfHostedExpansion")
}
var r0 *model.SelfHostedSignupConfirmResponse
var r1 error
if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) (*model.SelfHostedSignupConfirmResponse, error)); ok {
return rf(req, requesterEmail)
}
if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) *model.SelfHostedSignupConfirmResponse); ok {
r0 = rf(req, requesterEmail)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.SelfHostedSignupConfirmResponse)
}
}
if rf, ok := ret.Get(1).(func(model.SelfHostedConfirmPaymentMethodRequest, string) error); ok {
r1 = rf(req, requesterEmail)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ConfirmSelfHostedSignup provides a mock function with given fields: req, requesterEmail
func (_m *CloudInterface) ConfirmSelfHostedSignup(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error) {
ret := _m.Called(req, requesterEmail)
if len(ret) == 0 {
panic("no return value specified for ConfirmSelfHostedSignup")
}
var r0 *model.SelfHostedSignupConfirmResponse
var r1 error
if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) (*model.SelfHostedSignupConfirmResponse, error)); ok {
return rf(req, requesterEmail)
}
if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) *model.SelfHostedSignupConfirmResponse); ok {
r0 = rf(req, requesterEmail)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.SelfHostedSignupConfirmResponse)
}
}
if rf, ok := ret.Get(1).(func(model.SelfHostedConfirmPaymentMethodRequest, string) error); ok {
r1 = rf(req, requesterEmail)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ConfirmSelfHostedSignupLicenseApplication provides a mock function with given fields:
func (_m *CloudInterface) ConfirmSelfHostedSignupLicenseApplication() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ConfirmSelfHostedSignupLicenseApplication")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// CreateCustomerPayment provides a mock function with given fields: userID
func (_m *CloudInterface) CreateCustomerPayment(userID string) (*model.StripeSetupIntent, error) {
ret := _m.Called(userID)
if len(ret) == 0 {
panic("no return value specified for CreateCustomerPayment")
}
var r0 *model.StripeSetupIntent
var r1 error
if rf, ok := ret.Get(0).(func(string) (*model.StripeSetupIntent, error)); ok {
return rf(userID)
}
if rf, ok := ret.Get(0).(func(string) *model.StripeSetupIntent); ok {
r0 = rf(userID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.StripeSetupIntent)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(userID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CreateCustomerSelfHostedSignup provides a mock function with given fields: req, requesterEmail
func (_m *CloudInterface) CreateCustomerSelfHostedSignup(req model.SelfHostedCustomerForm, requesterEmail string) (*model.SelfHostedSignupCustomerResponse, error) {
ret := _m.Called(req, requesterEmail)
if len(ret) == 0 {
panic("no return value specified for CreateCustomerSelfHostedSignup")
}
var r0 *model.SelfHostedSignupCustomerResponse
var r1 error
if rf, ok := ret.Get(0).(func(model.SelfHostedCustomerForm, string) (*model.SelfHostedSignupCustomerResponse, error)); ok {
return rf(req, requesterEmail)
}
if rf, ok := ret.Get(0).(func(model.SelfHostedCustomerForm, string) *model.SelfHostedSignupCustomerResponse); ok {
r0 = rf(req, requesterEmail)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.SelfHostedSignupCustomerResponse)
}
}
if rf, ok := ret.Get(1).(func(model.SelfHostedCustomerForm, string) error); ok {
r1 = rf(req, requesterEmail)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CreateOrUpdateSubscriptionHistoryEvent provides a mock function with given fields: userID, userCount
func (_m *CloudInterface) CreateOrUpdateSubscriptionHistoryEvent(userID string, userCount int) (*model.SubscriptionHistory, error) {
ret := _m.Called(userID, userCount)
@@ -556,103 +369,6 @@ func (_m *CloudInterface) GetInvoicesForSubscription(userID string) ([]*model.In
return r0, r1
}
// GetLicenseSelfServeStatus provides a mock function with given fields: userID, token
func (_m *CloudInterface) GetLicenseSelfServeStatus(userID string, token string) (*model.SubscriptionLicenseSelfServeStatusResponse, error) {
ret := _m.Called(userID, token)
if len(ret) == 0 {
panic("no return value specified for GetLicenseSelfServeStatus")
}
var r0 *model.SubscriptionLicenseSelfServeStatusResponse
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (*model.SubscriptionLicenseSelfServeStatusResponse, error)); ok {
return rf(userID, token)
}
if rf, ok := ret.Get(0).(func(string, string) *model.SubscriptionLicenseSelfServeStatusResponse); ok {
r0 = rf(userID, token)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.SubscriptionLicenseSelfServeStatusResponse)
}
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(userID, token)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetSelfHostedInvoicePDF provides a mock function with given fields: invoiceID
func (_m *CloudInterface) GetSelfHostedInvoicePDF(invoiceID string) ([]byte, string, error) {
ret := _m.Called(invoiceID)
if len(ret) == 0 {
panic("no return value specified for GetSelfHostedInvoicePDF")
}
var r0 []byte
var r1 string
var r2 error
if rf, ok := ret.Get(0).(func(string) ([]byte, string, error)); ok {
return rf(invoiceID)
}
if rf, ok := ret.Get(0).(func(string) []byte); ok {
r0 = rf(invoiceID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
if rf, ok := ret.Get(1).(func(string) string); ok {
r1 = rf(invoiceID)
} else {
r1 = ret.Get(1).(string)
}
if rf, ok := ret.Get(2).(func(string) error); ok {
r2 = rf(invoiceID)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetSelfHostedInvoices provides a mock function with given fields: rctx
func (_m *CloudInterface) GetSelfHostedInvoices(rctx request.CTX) ([]*model.Invoice, error) {
ret := _m.Called(rctx)
if len(ret) == 0 {
panic("no return value specified for GetSelfHostedInvoices")
}
var r0 []*model.Invoice
var r1 error
if rf, ok := ret.Get(0).(func(request.CTX) ([]*model.Invoice, error)); ok {
return rf(rctx)
}
if rf, ok := ret.Get(0).(func(request.CTX) []*model.Invoice); ok {
r0 = rf(rctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Invoice)
}
}
if rf, ok := ret.Get(1).(func(request.CTX) error); ok {
r1 = rf(rctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetSelfHostedProducts provides a mock function with given fields: userID
func (_m *CloudInterface) GetSelfHostedProducts(userID string) ([]*model.Product, error) {
ret := _m.Called(userID)
@@ -749,90 +465,6 @@ func (_m *CloudInterface) InvalidateCaches() error {
return r0
}
// RequestCloudTrial provides a mock function with given fields: userID, subscriptionID, newValidBusinessEmail
func (_m *CloudInterface) RequestCloudTrial(userID string, subscriptionID string, newValidBusinessEmail string) (*model.Subscription, error) {
ret := _m.Called(userID, subscriptionID, newValidBusinessEmail)
if len(ret) == 0 {
panic("no return value specified for RequestCloudTrial")
}
var r0 *model.Subscription
var r1 error
if rf, ok := ret.Get(0).(func(string, string, string) (*model.Subscription, error)); ok {
return rf(userID, subscriptionID, newValidBusinessEmail)
}
if rf, ok := ret.Get(0).(func(string, string, string) *model.Subscription); ok {
r0 = rf(userID, subscriptionID, newValidBusinessEmail)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Subscription)
}
}
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
r1 = rf(userID, subscriptionID, newValidBusinessEmail)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SelfHostedSignupAvailable provides a mock function with given fields:
func (_m *CloudInterface) SelfHostedSignupAvailable() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for SelfHostedSignupAvailable")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// SelfServeDeleteWorkspace provides a mock function with given fields: userID, deletionRequest
func (_m *CloudInterface) SelfServeDeleteWorkspace(userID string, deletionRequest *model.WorkspaceDeletionRequest) error {
ret := _m.Called(userID, deletionRequest)
if len(ret) == 0 {
panic("no return value specified for SelfServeDeleteWorkspace")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, *model.WorkspaceDeletionRequest) error); ok {
r0 = rf(userID, deletionRequest)
} else {
r0 = ret.Error(0)
}
return r0
}
// SubmitTrueUpReview provides a mock function with given fields: userID, trueUpReviewProfile
func (_m *CloudInterface) SubmitTrueUpReview(userID string, trueUpReviewProfile map[string]interface{}) error {
ret := _m.Called(userID, trueUpReviewProfile)
if len(ret) == 0 {
panic("no return value specified for SubmitTrueUpReview")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, map[string]interface{}) error); ok {
r0 = rf(userID, trueUpReviewProfile)
} else {
r0 = ret.Error(0)
}
return r0
}
// SubscribeToNewsletter provides a mock function with given fields: userID, req
func (_m *CloudInterface) SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error {
ret := _m.Called(userID, req)