[CLD-6430] Remove telemetry check from true_up_review (#26073)

* Remove telemetry check from true_up_review

* Fix bug

* Fix linter

* fix tests
Этот коммит содержится в:
Nick Misasi
2024-02-21 09:50:47 -05:00
коммит произвёл GitHub
родитель 521844fed5
Коммит 01e1eebc07
4 изменённых файлов: 26 добавлений и 13 удалений

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

@@ -351,10 +351,8 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// True-up is only enabled when telemetry is disabled.
// When telemetry is enabled, we already have all the data necessary for true-up reviews to be completed.
telemetryEnabled := c.App.Config().LogSettings.EnableDiagnostics
if telemetryEnabled != nil && !*telemetryEnabled {
// Only report the true up review to CWS if the connection is available.
if err := c.App.Cloud().CheckCWSConnection(c.AppContext.Session().UserId); err == nil {
err = c.App.Cloud().SubmitTrueUpReview(c.AppContext.Session().UserId, profileMap)
if err != nil {
c.Err = model.NewAppError("requestTrueUpReview", "api.license.true_up_review.failed_to_submit", nil, err.Error(), http.StatusInternalServerError)

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

@@ -486,6 +486,7 @@ func TestRequestTrueUpReview(t *testing.T) {
cloud := mocks.CloudInterface{}
cloud.Mock.On("SubmitTrueUpReview", mock.Anything, mock.Anything).Return(nil)
cloud.Mock.On("CheckCWSConnection", mock.Anything).Return(nil)
cloudImpl := th.App.Srv().Cloud
defer func() {