From ccb010ed9a4b6666f32ce5400867c1324285a686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Andr=C3=A9=20Dinis?= Date: Fri, 3 Feb 2023 18:12:52 +0000 Subject: [PATCH] improve comments and test description --- .../proto/go/usageevents/v1/usageevents.pb.go | 22 ++-- .../teleport/usageevents/v1/usageevents.proto | 22 ++-- lib/prehog/gen/prehog/v1alpha/teleport.pb.go | 22 ++-- .../proto/prehog/v1alpha/teleport.proto | 22 ++-- lib/services/usagereporter.go | 119 ------------------ lib/services/usagereporter_test.go | 6 +- 6 files changed, 35 insertions(+), 178 deletions(-) diff --git a/api/gen/proto/go/usageevents/v1/usageevents.pb.go b/api/gen/proto/go/usageevents/v1/usageevents.pb.go index 123e3392a2ee4..c4d0e4c79532b 100644 --- a/api/gen/proto/go/usageevents/v1/usageevents.pb.go +++ b/api/gen/proto/go/usageevents/v1/usageevents.pb.go @@ -921,8 +921,7 @@ func (m *UIDiscoverDeployServiceEvent) GetStatus() *DiscoverStepStatus { return nil } -// UIDiscoverDatabaseRegisterEvent is emitted when a user registers a database resource -// and goes to the next step. +// UIDiscoverDatabaseRegisterEvent is emitted when a user is finished with the step that registers a database resource. type UIDiscoverDatabaseRegisterEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` @@ -986,8 +985,7 @@ func (m *UIDiscoverDatabaseRegisterEvent) GetStatus() *DiscoverStepStatus { return nil } -// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user configures mutual TLS for self-hosted database -// and goes to the next step. +// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user is finished with the step that configures mutual TLS for a self-hosted database. type UIDiscoverDatabaseConfigureMTLSEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` @@ -1051,8 +1049,7 @@ func (m *UIDiscoverDatabaseConfigureMTLSEvent) GetStatus() *DiscoverStepStatus { return nil } -// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is asked to run the install Active Directory tools script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is finished with the step that asks user to run the install Active Directory tools script for the Desktop flow. type UIDiscoverDesktopActiveDirectoryToolsInstallEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` @@ -1120,8 +1117,7 @@ func (m *UIDiscoverDesktopActiveDirectoryToolsInstallEvent) GetStatus() *Discove return nil } -// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is asked to run the Configure Active Directory script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is finished with the step that asks user to run the Configure Active Directory script for the Desktop flow. type UIDiscoverDesktopActiveDirectoryConfigureEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` @@ -1189,8 +1185,8 @@ func (m *UIDiscoverDesktopActiveDirectoryConfigureEvent) GetStatus() *DiscoverSt return nil } -// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is presented with the list of auto discovered resources. -// resources_count field must contain the number of discovered resources when the user leaves the screen. +// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is finished with the step that auto discovers resources (waiting until resources show up). +// resources_count field must reflect the latest amount of discovered resources (get the number after user is finished with this step). type UIDiscoverAutoDiscoveredResourcesEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` @@ -1264,8 +1260,7 @@ func (m *UIDiscoverAutoDiscoveredResourcesEvent) GetResourcesCount() int64 { return 0 } -// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user configured IAM for RDS database -// and proceeded to the next step. +// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user is finished with the step that configures IAM policy for an RDS database. type UIDiscoverDatabaseConfigureIAMPolicyEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` @@ -1333,8 +1328,7 @@ func (m *UIDiscoverDatabaseConfigureIAMPolicyEvent) GetStatus() *DiscoverStepSta return nil } -// UIDiscoverPrincipalsConfigureEvent emitted on "Setup Access" screen when user has updated their principals -// and proceeded to the next step. +// UIDiscoverPrincipalsConfigureEvent is emitted when a user is finished with the step that allows user to update their principals (setting up access). type UIDiscoverPrincipalsConfigureEvent struct { Metadata *DiscoverMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Resource *DiscoverResourceMetadata `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` diff --git a/api/proto/teleport/usageevents/v1/usageevents.proto b/api/proto/teleport/usageevents/v1/usageevents.proto index aab7e0cd30622..c4e46d913b7a8 100644 --- a/api/proto/teleport/usageevents/v1/usageevents.proto +++ b/api/proto/teleport/usageevents/v1/usageevents.proto @@ -160,40 +160,36 @@ message UIDiscoverDeployServiceEvent { DiscoverStepStatus status = 3; } -// UIDiscoverDatabaseRegisterEvent is emitted when a user registers a database resource -// and goes to the next step. +// UIDiscoverDatabaseRegisterEvent is emitted when a user is finished with the step that registers a database resource. message UIDiscoverDatabaseRegisterEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user configures mutual TLS for self-hosted database -// and goes to the next step. +// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user is finished with the step that configures mutual TLS for a self-hosted database. message UIDiscoverDatabaseConfigureMTLSEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is asked to run the install Active Directory tools script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is finished with the step that asks user to run the install Active Directory tools script for the Desktop flow. message UIDiscoverDesktopActiveDirectoryToolsInstallEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is asked to run the Configure Active Directory script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is finished with the step that asks user to run the Configure Active Directory script for the Desktop flow. message UIDiscoverDesktopActiveDirectoryConfigureEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is presented with the list of auto discovered resources. -// resources_count field must contain the number of discovered resources when the user leaves the screen. +// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is finished with the step that auto discovers resources (waiting until resources show up). +// resources_count field must reflect the latest amount of discovered resources (get the number after user is finished with this step). message UIDiscoverAutoDiscoveredResourcesEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; @@ -201,16 +197,14 @@ message UIDiscoverAutoDiscoveredResourcesEvent { int64 resources_count = 4; } -// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user configured IAM for RDS database -// and proceeded to the next step. +// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user is finished with the step that configures IAM policy for an RDS database. message UIDiscoverDatabaseConfigureIAMPolicyEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverPrincipalsConfigureEvent emitted on "Setup Access" screen when user has updated their principals -// and proceeded to the next step. +// UIDiscoverPrincipalsConfigureEvent is emitted when a user is finished with the step that allows user to update their principals (setting up access). message UIDiscoverPrincipalsConfigureEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; diff --git a/lib/prehog/gen/prehog/v1alpha/teleport.pb.go b/lib/prehog/gen/prehog/v1alpha/teleport.pb.go index fed0b0fe0c943..b6e11d701ea80 100644 --- a/lib/prehog/gen/prehog/v1alpha/teleport.pb.go +++ b/lib/prehog/gen/prehog/v1alpha/teleport.pb.go @@ -1303,8 +1303,7 @@ func (x *UIDiscoverDeployServiceEvent) GetStatus() *DiscoverStepStatus { return nil } -// UIDiscoverDatabaseRegisterEvent is emitted when a user registers a database resource -// and goes to the next step. +// UIDiscoverDatabaseRegisterEvent is emitted when a user is finished with the step that registers a database resource. type UIDiscoverDatabaseRegisterEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1368,8 +1367,7 @@ func (x *UIDiscoverDatabaseRegisterEvent) GetStatus() *DiscoverStepStatus { return nil } -// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user configures mutual TLS for self-hosted database -// and goes to the next step. +// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user is finished with the step that configures mutual TLS for a self-hosted database. type UIDiscoverDatabaseConfigureMTLSEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1433,8 +1431,7 @@ func (x *UIDiscoverDatabaseConfigureMTLSEvent) GetStatus() *DiscoverStepStatus { return nil } -// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is asked to run the install Active Directory tools script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is finished with the step that asks user to run the install Active Directory tools script for the Desktop flow. type UIDiscoverDesktopActiveDirectoryToolsInstallEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1498,8 +1495,7 @@ func (x *UIDiscoverDesktopActiveDirectoryToolsInstallEvent) GetStatus() *Discove return nil } -// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is asked to run the Configure Active Directory script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is finished with the step that asks user to run the Configure Active Directory script for the Desktop flow. type UIDiscoverDesktopActiveDirectoryConfigureEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1563,8 +1559,8 @@ func (x *UIDiscoverDesktopActiveDirectoryConfigureEvent) GetStatus() *DiscoverSt return nil } -// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is presented with the list of auto discovered resources. -// resources_count field must contain the number of discovered resources when the user leaves the screen. +// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is finished with the step that auto discovers resources (waiting until resources show up). +// resources_count field must reflect the latest amount of discovered resources (get the number after user is finished with this step). type UIDiscoverAutoDiscoveredResourcesEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1636,8 +1632,7 @@ func (x *UIDiscoverAutoDiscoveredResourcesEvent) GetResourcesCount() int64 { return 0 } -// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user configured IAM for RDS database -// and proceeded to the next step. +// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user is finished with the step that configures IAM policy for an RDS database. type UIDiscoverDatabaseConfigureIAMPolicyEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1701,8 +1696,7 @@ func (x *UIDiscoverDatabaseConfigureIAMPolicyEvent) GetStatus() *DiscoverStepSta return nil } -// UIDiscoverPrincipalsConfigureEvent emitted on "Setup Access" screen when user has updated their principals -// and proceeded to the next step. +// UIDiscoverPrincipalsConfigureEvent is emitted when a user is finished with the step that allows user to update their principals (setting up access). type UIDiscoverPrincipalsConfigureEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/lib/prehog/proto/prehog/v1alpha/teleport.proto b/lib/prehog/proto/prehog/v1alpha/teleport.proto index 5dd2626800122..0d658b0da1892 100644 --- a/lib/prehog/proto/prehog/v1alpha/teleport.proto +++ b/lib/prehog/proto/prehog/v1alpha/teleport.proto @@ -199,40 +199,36 @@ message UIDiscoverDeployServiceEvent { DiscoverStepStatus status = 3; } -// UIDiscoverDatabaseRegisterEvent is emitted when a user registers a database resource -// and goes to the next step. +// UIDiscoverDatabaseRegisterEvent is emitted when a user is finished with the step that registers a database resource. message UIDiscoverDatabaseRegisterEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user configures mutual TLS for self-hosted database -// and goes to the next step. +// UIDiscoverDatabaseConfigureMTLSEvent is emitted when a user is finished with the step that configures mutual TLS for a self-hosted database. message UIDiscoverDatabaseConfigureMTLSEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is asked to run the install Active Directory tools script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryToolsInstallEvent is emitted when the user is finished with the step that asks user to run the install Active Directory tools script for the Desktop flow. message UIDiscoverDesktopActiveDirectoryToolsInstallEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is asked to run the Configure Active Directory script. -// This happens on the Desktop flow. +// UIDiscoverDesktopActiveDirectoryConfigureEvent is emitted when the user is finished with the step that asks user to run the Configure Active Directory script for the Desktop flow. message UIDiscoverDesktopActiveDirectoryConfigureEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is presented with the list of auto discovered resources. -// resources_count field must contain the number of discovered resources when the user leaves the screen. +// UIDiscoverAutoDiscoveredResourcesEvent is emitted when the user is finished with the step that auto discovers resources (waiting until resources show up). +// resources_count field must reflect the latest amount of discovered resources (get the number after user is finished with this step). message UIDiscoverAutoDiscoveredResourcesEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; @@ -240,16 +236,14 @@ message UIDiscoverAutoDiscoveredResourcesEvent { int64 resources_count = 4; } -// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user configured IAM for RDS database -// and proceeded to the next step. +// UIDiscoverDatabaseConfigureIAMPolicyEvent is emitted when a user is finished with the step that configures IAM policy for an RDS database. message UIDiscoverDatabaseConfigureIAMPolicyEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; DiscoverStepStatus status = 3; } -// UIDiscoverPrincipalsConfigureEvent emitted on "Setup Access" screen when user has updated their principals -// and proceeded to the next step. +// UIDiscoverPrincipalsConfigureEvent is emitted when a user is finished with the step that allows user to update their principals (setting up access). message UIDiscoverPrincipalsConfigureEvent { DiscoverMetadata metadata = 1; DiscoverResourceMetadata resource = 2; diff --git a/lib/services/usagereporter.go b/lib/services/usagereporter.go index 2f58ec1e6c60c..dfd577129bc9a 100644 --- a/lib/services/usagereporter.go +++ b/lib/services/usagereporter.go @@ -262,125 +262,6 @@ func (u *UsageUIRecoveryCodesPrintClick) Anonymize(a utils.Anonymizer) prehogv1. } } -func discoverMetadataToPrehog(u *usageevents.DiscoverMetadata, identityUsername string) *prehogv1.DiscoverMetadata { - return &prehogv1.DiscoverMetadata{ - Id: u.Id, - UserName: identityUsername, - } -} - -func validateDiscoverMetadata(u *prehogv1.DiscoverMetadata) error { - if u == nil { - return trace.BadParameter("metadata is required") - } - - if len(u.Id) == 0 { - return trace.BadParameter("metadata.id is required") - } - - return nil -} - -func discoverResourceToPrehog(u *usageevents.DiscoverResourceMetadata) *prehogv1.DiscoverResourceMetadata { - return &prehogv1.DiscoverResourceMetadata{ - Resource: prehogv1.DiscoverResource(u.Resource), - } -} - -func validateDiscoverResourceMetadata(u *prehogv1.DiscoverResourceMetadata) error { - if u == nil { - return trace.BadParameter("resource is required") - } - - if u.Resource == prehogapi.DiscoverResource_DISCOVER_RESOURCE_UNSPECIFIED { - return trace.BadParameter("invalid resource") - } - - return nil -} - -func discoverStatusToPrehog(u *usageevents.DiscoverStepStatus) *prehogv1.DiscoverStepStatus { - return &prehogv1.DiscoverStepStatus{ - Status: prehogv1.DiscoverStatus(u.Status), - Error: u.Error, - } -} - -func validateDiscoverStatus(u *prehogv1.DiscoverStepStatus) error { - if u == nil { - return trace.BadParameter("status is required") - } - - if u.Status == prehogapi.DiscoverStatus_DISCOVER_STATUS_UNSPECIFIED { - return trace.BadParameter("invalid status.status") - } - - if u.Status == prehogv1.DiscoverStatus_DISCOVER_STATUS_ERROR && len(u.Error) == 0 { - return trace.BadParameter("status.error is required when status.status is ERROR") - } - - return nil -} - -// UsageUIDiscoverStartedEvent is a UI event sent when a user starts the Discover Wizard. -type UsageUIDiscoverStartedEvent prehogv1.UIDiscoverStartedEvent - -func (u *UsageUIDiscoverStartedEvent) CheckAndSetDefaults() error { - if err := validateDiscoverMetadata(u.Metadata); err != nil { - return trace.Wrap(err) - } - if err := validateDiscoverStatus(u.Status); err != nil { - return trace.Wrap(err) - } - - return nil -} - -func (u *UsageUIDiscoverStartedEvent) Anonymize(a utils.Anonymizer) prehogv1.SubmitEventRequest { - return prehogv1.SubmitEventRequest{ - Event: &prehogv1.SubmitEventRequest_UiDiscoverStartedEvent{ - UiDiscoverStartedEvent: &prehogv1.UIDiscoverStartedEvent{ - Metadata: &prehogv1.DiscoverMetadata{ - Id: u.Metadata.Id, - UserName: a.AnonymizeString(u.Metadata.UserName), - }, - Status: u.Status, - }, - }, - } -} - -// UsageUIDiscoverResourceSelectionEvent is a UI event sent when a user starts the Discover Wizard. -type UsageUIDiscoverResourceSelectionEvent prehogv1.UIDiscoverResourceSelectionEvent - -func (u *UsageUIDiscoverResourceSelectionEvent) CheckAndSetDefaults() error { - if err := validateDiscoverMetadata(u.Metadata); err != nil { - return trace.Wrap(err) - } - if err := validateDiscoverResourceMetadata(u.Resource); err != nil { - return trace.Wrap(err) - } - if err := validateDiscoverStatus(u.Status); err != nil { - return trace.Wrap(err) - } - - return nil -} -func (u *UsageUIDiscoverResourceSelectionEvent) Anonymize(a utils.Anonymizer) prehogv1.SubmitEventRequest { - return prehogv1.SubmitEventRequest{ - Event: &prehogv1.SubmitEventRequest_UiDiscoverResourceSelectionEvent{ - UiDiscoverResourceSelectionEvent: &prehogv1.UIDiscoverResourceSelectionEvent{ - Metadata: &prehogv1.DiscoverMetadata{ - Id: u.Metadata.Id, - UserName: a.AnonymizeString(u.Metadata.UserName), - }, - Resource: u.Resource, - Status: u.Status, - }, - }, - } -} - // UsageCertificateIssued is an event emitted when a certificate has been // issued, used to track the duration and restriction. type UsageCertificateIssued prehogv1.UserCertificateIssuedEvent diff --git a/lib/services/usagereporter_test.go b/lib/services/usagereporter_test.go index 63cd4beb0b2ee..226faa489fa74 100644 --- a/lib/services/usagereporter_test.go +++ b/lib/services/usagereporter_test.go @@ -123,7 +123,7 @@ func TestConvertUsageEvent(t *testing.T) { }, }, { - name: "error when discover has resources count and its values is zero: no error", + name: "when discover has resources count and its values is zero: no error", event: &usageevents.UsageEventOneOf{Event: &usageevents.UsageEventOneOf_UiDiscoverAutoDiscoveredResourcesEvent{ UiDiscoverAutoDiscoveredResourcesEvent: &usageevents.UIDiscoverAutoDiscoveredResourcesEvent{ Metadata: &usageevents.DiscoverMetadata{Id: "someid"}, @@ -147,7 +147,7 @@ func TestConvertUsageEvent(t *testing.T) { }}, }, { - name: "error when discover has resources count and its values is positive: no error", + name: "when discover has resources count and its values is positive: no error", event: &usageevents.UsageEventOneOf{Event: &usageevents.UsageEventOneOf_UiDiscoverAutoDiscoveredResourcesEvent{ UiDiscoverAutoDiscoveredResourcesEvent: &usageevents.UIDiscoverAutoDiscoveredResourcesEvent{ Metadata: &usageevents.DiscoverMetadata{Id: "someid"}, @@ -171,7 +171,7 @@ func TestConvertUsageEvent(t *testing.T) { }}, }, { - name: "error when discover has resources count and its values is negative: bad parameter error", + name: "when discover has resources count and its values is negative: bad parameter error", event: &usageevents.UsageEventOneOf{Event: &usageevents.UsageEventOneOf_UiDiscoverAutoDiscoveredResourcesEvent{ UiDiscoverAutoDiscoveredResourcesEvent: &usageevents.UIDiscoverAutoDiscoveredResourcesEvent{ Metadata: &usageevents.DiscoverMetadata{Id: "someid"},