From 776c6b103e38039124a28538115a576a28fe5788 Mon Sep 17 00:00:00 2001 From: Taylor Sutton Date: Fri, 30 Jul 2021 13:53:20 -0700 Subject: [PATCH 1/3] Testing wag v8. --- executor/workflow_manager.go | 12 +- gen-go/models/bad_request.go | 10 +- gen-go/models/cancel_reason.go | 10 +- gen-go/models/conflict.go | 10 +- gen-go/models/internal_error.go | 10 +- gen-go/models/job.go | 65 +++++++++-- gen-go/models/job_attempt.go | 59 +++++++++- gen-go/models/job_status.go | 12 +- gen-go/models/manager.go | 5 +- gen-go/models/new_state_resource.go | 10 +- .../models/new_workflow_definition_request.go | 7 +- gen-go/models/not_found.go | 10 +- gen-go/models/resolved_by_user_wrapper.go | 10 +- gen-go/models/s_l_catcher.go | 5 +- gen-go/models/s_l_choice.go | 103 ++++++++++++++++-- gen-go/models/s_l_error_equals.go | 3 +- gen-go/models/s_l_retrier.go | 6 +- gen-go/models/s_l_state.go | 19 +--- gen-go/models/s_l_state_machine.go | 21 +++- gen-go/models/s_l_state_type.go | 12 +- gen-go/models/start_workflow_request.go | 6 +- gen-go/models/state_resource.go | 24 +++- gen-go/models/state_resource_type.go | 8 +- gen-go/models/workflow.go | 44 ++++---- gen-go/models/workflow_definition.go | 26 ++++- .../models/workflow_definition_overrides.go | 10 +- gen-go/models/workflow_definition_ref.go | 10 +- gen-go/models/workflow_query.go | 9 +- gen-go/models/workflow_status.go | 9 +- gen-go/models/workflow_summary.go | 58 ++++++++-- gen-go/server/db/dynamodb/dynamodb_test.go | 6 +- gen-go/tracing/tracing.go | 44 ++++---- gen-js/README.md | 7 ++ gen-js/index.d.ts | 7 +- gen-js/index.js | 9 +- go.mod | 12 +- go.sum | 88 ++++++++++----- main.go | 4 +- 38 files changed, 521 insertions(+), 259 deletions(-) diff --git a/executor/workflow_manager.go b/executor/workflow_manager.go index d33ed22a..f47c3197 100644 --- a/executor/workflow_manager.go +++ b/executor/workflow_manager.go @@ -9,8 +9,8 @@ import ( "github.com/Clever/workflow-manager/resources" "github.com/Clever/workflow-manager/store" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/label" "gopkg.in/Clever/kayvee-go.v6/logger" "github.com/aws/aws-sdk-go/aws" @@ -117,7 +117,7 @@ func updatePendingWorkflow(ctx context.Context, m *sqs.Message, wm WorkflowManag } wfID := *m.Body - span.SetAttributes(label.String("workflow-id", wfID)) + span.SetAttributes(attribute.String("workflow-id", wfID)) wf, err := thestore.GetWorkflowByID(ctx, wfID) if err != nil { if _, ok := err.(models.NotFound); ok { @@ -127,13 +127,13 @@ func updatePendingWorkflow(ctx context.Context, m *sqs.Message, wm WorkflowManag // this could indicate an error in starting the workflow. // if that happened, it is logged separately. deleteMsg() - span.SetAttributes(label.String("result", "workflow-not-found")) + span.SetAttributes(attribute.String("result", "workflow-not-found")) return "", fmt.Errorf("workflow id not found: %s", wfID) } // other error, e.g. throttling. Try again later requeueMsg() deleteMsg() - span.SetAttributes(label.String("result", "database-error")) + span.SetAttributes(attribute.String("result", "database-error")) return "", err } @@ -145,10 +145,10 @@ func updatePendingWorkflow(ctx context.Context, m *sqs.Message, wm WorkflowManag // and re-queue a new message if the workflow remains pending. defer func() { if storeSaveFailed { - span.SetAttributes(label.String("result", "requeue-store-save-failed")) + span.SetAttributes(attribute.String("result", "requeue-store-save-failed")) requeueMsg() } else if !resources.WorkflowStatusIsDone(&wf) { - span.SetAttributes(label.String("result", "requeue-workflow-not-done")) + span.SetAttributes(attribute.String("result", "requeue-workflow-not-done")) requeueMsg() } deleteMsg() diff --git a/gen-go/models/bad_request.go b/gen-go/models/bad_request.go index 3142f408..c993acc0 100644 --- a/gen-go/models/bad_request.go +++ b/gen-go/models/bad_request.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // BadRequest bad request +// // swagger:model BadRequest type BadRequest struct { @@ -22,11 +21,6 @@ type BadRequest struct { // Validate validates this bad request func (m *BadRequest) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/cancel_reason.go b/gen-go/models/cancel_reason.go index 9c561e81..a84e39af 100644 --- a/gen-go/models/cancel_reason.go +++ b/gen-go/models/cancel_reason.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // CancelReason cancel reason +// // swagger:model CancelReason type CancelReason struct { @@ -22,11 +21,6 @@ type CancelReason struct { // Validate validates this cancel reason func (m *CancelReason) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/conflict.go b/gen-go/models/conflict.go index f531132b..314c6e66 100644 --- a/gen-go/models/conflict.go +++ b/gen-go/models/conflict.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Conflict conflict +// // swagger:model Conflict type Conflict struct { @@ -22,11 +21,6 @@ type Conflict struct { // Validate validates this conflict func (m *Conflict) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/internal_error.go b/gen-go/models/internal_error.go index b73fe59e..738a8d8d 100644 --- a/gen-go/models/internal_error.go +++ b/gen-go/models/internal_error.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // InternalError internal error +// // swagger:model InternalError type InternalError struct { @@ -22,11 +21,6 @@ type InternalError struct { // Validate validates this internal error func (m *InternalError) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/job.go b/gen-go/models/job.go index b365c827..fc9cba30 100644 --- a/gen-go/models/job.go +++ b/gen-go/models/job.go @@ -8,13 +8,14 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // Job job +// // swagger:model Job type Job struct { @@ -25,6 +26,7 @@ type Job struct { Container string `json:"container,omitempty"` // created at + // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` // id @@ -43,6 +45,7 @@ type Job struct { Queue string `json:"queue,omitempty"` // started at + // Format: date-time StartedAt strfmt.DateTime `json:"startedAt,omitempty"` // state @@ -58,6 +61,7 @@ type Job struct { StatusReason string `json:"statusReason,omitempty"` // stopped at + // Format: date-time StoppedAt strfmt.DateTime `json:"stoppedAt,omitempty"` } @@ -66,17 +70,26 @@ func (m *Job) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAttempts(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { res = append(res, err) } if err := m.validateStateResource(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateStoppedAt(formats); err != nil { res = append(res, err) } @@ -93,13 +106,11 @@ func (m *Job) validateAttempts(formats strfmt.Registry) error { } for i := 0; i < len(m.Attempts); i++ { - if swag.IsZero(m.Attempts[i]) { // not required continue } if m.Attempts[i] != nil { - if err := m.Attempts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("attempts" + "." + strconv.Itoa(i)) @@ -113,6 +124,32 @@ func (m *Job) validateAttempts(formats strfmt.Registry) error { return nil } +func (m *Job) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Job) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("startedAt", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Job) validateStateResource(formats strfmt.Registry) error { if swag.IsZero(m.StateResource) { // not required @@ -120,7 +157,6 @@ func (m *Job) validateStateResource(formats strfmt.Registry) error { } if m.StateResource != nil { - if err := m.StateResource.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("stateResource") @@ -148,6 +184,19 @@ func (m *Job) validateStatus(formats strfmt.Registry) error { return nil } +func (m *Job) validateStoppedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StoppedAt) { // not required + return nil + } + + if err := validate.FormatOf("stoppedAt", "body", "date-time", m.StoppedAt.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *Job) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/gen-go/models/job_attempt.go b/gen-go/models/job_attempt.go index 1434febd..4cce83cf 100644 --- a/gen-go/models/job_attempt.go +++ b/gen-go/models/job_attempt.go @@ -6,13 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // JobAttempt job attempt +// // swagger:model JobAttempt type JobAttempt struct { @@ -20,6 +21,7 @@ type JobAttempt struct { ContainerInstanceARN string `json:"containerInstanceARN,omitempty"` // created at + // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` // exit code @@ -29,9 +31,11 @@ type JobAttempt struct { Reason string `json:"reason,omitempty"` // started at + // Format: date-time StartedAt strfmt.DateTime `json:"startedAt,omitempty"` // stopped at + // Format: date-time StoppedAt strfmt.DateTime `json:"stoppedAt,omitempty"` // task a r n @@ -42,12 +46,63 @@ type JobAttempt struct { func (m *JobAttempt) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStartedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStoppedAt(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *JobAttempt) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *JobAttempt) validateStartedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StartedAt) { // not required + return nil + } + + if err := validate.FormatOf("startedAt", "body", "date-time", m.StartedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *JobAttempt) validateStoppedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StoppedAt) { // not required + return nil + } + + if err := validate.FormatOf("stoppedAt", "body", "date-time", m.StoppedAt.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *JobAttempt) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/gen-go/models/job_status.go b/gen-go/models/job_status.go index 75732f24..94c53b66 100644 --- a/gen-go/models/job_status.go +++ b/gen-go/models/job_status.go @@ -8,31 +8,39 @@ package models import ( "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // JobStatus job status +// // swagger:model JobStatus type JobStatus string const ( + // JobStatusCreated captures enum value "created" JobStatusCreated JobStatus = "created" + // JobStatusQueued captures enum value "queued" JobStatusQueued JobStatus = "queued" + // JobStatusWaitingForDeps captures enum value "waiting_for_deps" JobStatusWaitingForDeps JobStatus = "waiting_for_deps" + // JobStatusRunning captures enum value "running" JobStatusRunning JobStatus = "running" + // JobStatusSucceeded captures enum value "succeeded" JobStatusSucceeded JobStatus = "succeeded" + // JobStatusFailed captures enum value "failed" JobStatusFailed JobStatus = "failed" + // JobStatusAbortedDepsFailed captures enum value "aborted_deps_failed" JobStatusAbortedDepsFailed JobStatus = "aborted_deps_failed" + // JobStatusAbortedByUser captures enum value "aborted_by_user" JobStatusAbortedByUser JobStatus = "aborted_by_user" ) diff --git a/gen-go/models/manager.go b/gen-go/models/manager.go index faa76ff2..4c00565d 100644 --- a/gen-go/models/manager.go +++ b/gen-go/models/manager.go @@ -8,17 +8,18 @@ package models import ( "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // Manager manager +// // swagger:model Manager type Manager string const ( + // ManagerStepFunctions captures enum value "step-functions" ManagerStepFunctions Manager = "step-functions" ) diff --git a/gen-go/models/new_state_resource.go b/gen-go/models/new_state_resource.go index ebd04e08..e6388bf5 100644 --- a/gen-go/models/new_state_resource.go +++ b/gen-go/models/new_state_resource.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NewStateResource new state resource +// // swagger:model NewStateResource type NewStateResource struct { @@ -28,11 +27,6 @@ type NewStateResource struct { // Validate validates this new state resource func (m *NewStateResource) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/new_workflow_definition_request.go b/gen-go/models/new_workflow_definition_request.go index 573407c0..2173d1e9 100644 --- a/gen-go/models/new_workflow_definition_request.go +++ b/gen-go/models/new_workflow_definition_request.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NewWorkflowDefinitionRequest new workflow definition request +// // swagger:model NewWorkflowDefinitionRequest type NewWorkflowDefinitionRequest struct { @@ -37,12 +37,10 @@ func (m *NewWorkflowDefinitionRequest) Validate(formats strfmt.Registry) error { var res []error if err := m.validateManager(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStateMachine(formats); err != nil { - // prop res = append(res, err) } @@ -75,7 +73,6 @@ func (m *NewWorkflowDefinitionRequest) validateStateMachine(formats strfmt.Regis } if m.StateMachine != nil { - if err := m.StateMachine.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("stateMachine") diff --git a/gen-go/models/not_found.go b/gen-go/models/not_found.go index 5aeb25d5..eb646cd1 100644 --- a/gen-go/models/not_found.go +++ b/gen-go/models/not_found.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // NotFound not found +// // swagger:model NotFound type NotFound struct { @@ -22,11 +21,6 @@ type NotFound struct { // Validate validates this not found func (m *NotFound) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/resolved_by_user_wrapper.go b/gen-go/models/resolved_by_user_wrapper.go index 1c64190b..eb349c19 100644 --- a/gen-go/models/resolved_by_user_wrapper.go +++ b/gen-go/models/resolved_by_user_wrapper.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ResolvedByUserWrapper resolved by user wrapper +// // swagger:model ResolvedByUserWrapper type ResolvedByUserWrapper struct { @@ -25,11 +24,6 @@ type ResolvedByUserWrapper struct { // Validate validates this resolved by user wrapper func (m *ResolvedByUserWrapper) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/s_l_catcher.go b/gen-go/models/s_l_catcher.go index c808bbf3..c21616ec 100644 --- a/gen-go/models/s_l_catcher.go +++ b/gen-go/models/s_l_catcher.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SLCatcher s l catcher +// // swagger:model SLCatcher type SLCatcher struct { @@ -33,7 +33,6 @@ func (m *SLCatcher) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrorEquals(formats); err != nil { - // prop res = append(res, err) } diff --git a/gen-go/models/s_l_choice.go b/gen-go/models/s_l_choice.go index c51ea3db..26af0b9f 100644 --- a/gen-go/models/s_l_choice.go +++ b/gen-go/models/s_l_choice.go @@ -8,13 +8,14 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // SLChoice s l choice +// // swagger:model SLChoice type SLChoice struct { @@ -64,18 +65,23 @@ type SLChoice struct { StringLessThanEquals *string `json:"StringLessThanEquals,omitempty"` // timestamp equals + // Format: date-time TimestampEquals *strfmt.DateTime `json:"TimestampEquals,omitempty"` // timestamp greater than + // Format: date-time TimestampGreaterThan *strfmt.DateTime `json:"TimestampGreaterThan,omitempty"` // timestamp greater than equals + // Format: date-time TimestampGreaterThanEquals *strfmt.DateTime `json:"TimestampGreaterThanEquals,omitempty"` // timestamp less than + // Format: date-time TimestampLessThan *strfmt.DateTime `json:"TimestampLessThan,omitempty"` // timestamp less than equals + // Format: date-time TimestampLessThanEquals *strfmt.DateTime `json:"TimestampLessThanEquals,omitempty"` // variable @@ -87,17 +93,34 @@ func (m *SLChoice) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAnd(formats); err != nil { - // prop res = append(res, err) } if err := m.validateNot(formats); err != nil { - // prop res = append(res, err) } if err := m.validateOr(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTimestampEquals(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestampGreaterThan(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestampGreaterThanEquals(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestampLessThan(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestampLessThanEquals(formats); err != nil { res = append(res, err) } @@ -114,13 +137,11 @@ func (m *SLChoice) validateAnd(formats strfmt.Registry) error { } for i := 0; i < len(m.And); i++ { - if swag.IsZero(m.And[i]) { // not required continue } if m.And[i] != nil { - if err := m.And[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("And" + "." + strconv.Itoa(i)) @@ -141,7 +162,6 @@ func (m *SLChoice) validateNot(formats strfmt.Registry) error { } if m.Not != nil { - if err := m.Not.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Not") @@ -160,13 +180,11 @@ func (m *SLChoice) validateOr(formats strfmt.Registry) error { } for i := 0; i < len(m.Or); i++ { - if swag.IsZero(m.Or[i]) { // not required continue } if m.Or[i] != nil { - if err := m.Or[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Or" + "." + strconv.Itoa(i)) @@ -180,6 +198,71 @@ func (m *SLChoice) validateOr(formats strfmt.Registry) error { return nil } +func (m *SLChoice) validateTimestampEquals(formats strfmt.Registry) error { + + if swag.IsZero(m.TimestampEquals) { // not required + return nil + } + + if err := validate.FormatOf("TimestampEquals", "body", "date-time", m.TimestampEquals.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SLChoice) validateTimestampGreaterThan(formats strfmt.Registry) error { + + if swag.IsZero(m.TimestampGreaterThan) { // not required + return nil + } + + if err := validate.FormatOf("TimestampGreaterThan", "body", "date-time", m.TimestampGreaterThan.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SLChoice) validateTimestampGreaterThanEquals(formats strfmt.Registry) error { + + if swag.IsZero(m.TimestampGreaterThanEquals) { // not required + return nil + } + + if err := validate.FormatOf("TimestampGreaterThanEquals", "body", "date-time", m.TimestampGreaterThanEquals.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SLChoice) validateTimestampLessThan(formats strfmt.Registry) error { + + if swag.IsZero(m.TimestampLessThan) { // not required + return nil + } + + if err := validate.FormatOf("TimestampLessThan", "body", "date-time", m.TimestampLessThan.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SLChoice) validateTimestampLessThanEquals(formats strfmt.Registry) error { + + if swag.IsZero(m.TimestampLessThanEquals) { // not required + return nil + } + + if err := validate.FormatOf("TimestampLessThanEquals", "body", "date-time", m.TimestampLessThanEquals.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *SLChoice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/gen-go/models/s_l_error_equals.go b/gen-go/models/s_l_error_equals.go index 2d38673b..d21a5385 100644 --- a/gen-go/models/s_l_error_equals.go +++ b/gen-go/models/s_l_error_equals.go @@ -6,10 +6,11 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" + "github.com/go-openapi/strfmt" ) // SLErrorEquals s l error equals +// // swagger:model SLErrorEquals type SLErrorEquals string diff --git a/gen-go/models/s_l_retrier.go b/gen-go/models/s_l_retrier.go index ee1b9fd1..f6d22e48 100644 --- a/gen-go/models/s_l_retrier.go +++ b/gen-go/models/s_l_retrier.go @@ -8,14 +8,14 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SLRetrier s l retrier +// // swagger:model SLRetrier type SLRetrier struct { @@ -39,12 +39,10 @@ func (m *SLRetrier) Validate(formats strfmt.Registry) error { var res []error if err := m.validateErrorEquals(formats); err != nil { - // prop res = append(res, err) } if err := m.validateMaxAttempts(formats); err != nil { - // prop res = append(res, err) } diff --git a/gen-go/models/s_l_state.go b/gen-go/models/s_l_state.go index 52e8f608..2b2be830 100644 --- a/gen-go/models/s_l_state.go +++ b/gen-go/models/s_l_state.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // SLState s l state +// // swagger:model SLState type SLState struct { @@ -105,32 +105,26 @@ func (m *SLState) Validate(formats strfmt.Registry) error { var res []error if err := m.validateBranches(formats); err != nil { - // prop res = append(res, err) } if err := m.validateCatch(formats); err != nil { - // prop res = append(res, err) } if err := m.validateChoices(formats); err != nil { - // prop res = append(res, err) } if err := m.validateIterator(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRetry(formats); err != nil { - // prop res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } @@ -147,13 +141,11 @@ func (m *SLState) validateBranches(formats strfmt.Registry) error { } for i := 0; i < len(m.Branches); i++ { - if swag.IsZero(m.Branches[i]) { // not required continue } if m.Branches[i] != nil { - if err := m.Branches[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Branches" + "." + strconv.Itoa(i)) @@ -174,13 +166,11 @@ func (m *SLState) validateCatch(formats strfmt.Registry) error { } for i := 0; i < len(m.Catch); i++ { - if swag.IsZero(m.Catch[i]) { // not required continue } if m.Catch[i] != nil { - if err := m.Catch[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Catch" + "." + strconv.Itoa(i)) @@ -201,13 +191,11 @@ func (m *SLState) validateChoices(formats strfmt.Registry) error { } for i := 0; i < len(m.Choices); i++ { - if swag.IsZero(m.Choices[i]) { // not required continue } if m.Choices[i] != nil { - if err := m.Choices[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Choices" + "." + strconv.Itoa(i)) @@ -228,7 +216,6 @@ func (m *SLState) validateIterator(formats strfmt.Registry) error { } if m.Iterator != nil { - if err := m.Iterator.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Iterator") @@ -247,13 +234,11 @@ func (m *SLState) validateRetry(formats strfmt.Registry) error { } for i := 0; i < len(m.Retry); i++ { - if swag.IsZero(m.Retry[i]) { // not required continue } if m.Retry[i] != nil { - if err := m.Retry[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Retry" + "." + strconv.Itoa(i)) diff --git a/gen-go/models/s_l_state_machine.go b/gen-go/models/s_l_state_machine.go index 26477f60..c429ee05 100644 --- a/gen-go/models/s_l_state_machine.go +++ b/gen-go/models/s_l_state_machine.go @@ -8,14 +8,14 @@ package models import ( "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // SLStateMachine s l state machine +// // swagger:model SLStateMachine type SLStateMachine struct { @@ -32,6 +32,7 @@ type SLStateMachine struct { TimeoutSeconds int64 `json:"TimeoutSeconds,omitempty"` // version + // Enum: [1.0] Version string `json:"Version,omitempty"` } @@ -40,12 +41,10 @@ func (m *SLStateMachine) Validate(formats strfmt.Registry) error { var res []error if err := m.validateStates(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVersion(formats); err != nil { - // prop res = append(res, err) } @@ -61,8 +60,17 @@ func (m *SLStateMachine) validateStates(formats strfmt.Registry) error { return nil } - if err := validate.Required("States", "body", m.States); err != nil { - return err + for k := range m.States { + + if err := validate.Required("States"+"."+k, "body", m.States[k]); err != nil { + return err + } + if val, ok := m.States[k]; ok { + if err := val.Validate(formats); err != nil { + return err + } + } + } return nil @@ -81,6 +89,7 @@ func init() { } const ( + // SLStateMachineVersionNr10 captures enum value "1.0" SLStateMachineVersionNr10 string = "1.0" ) diff --git a/gen-go/models/s_l_state_type.go b/gen-go/models/s_l_state_type.go index 853a772d..ff82c412 100644 --- a/gen-go/models/s_l_state_type.go +++ b/gen-go/models/s_l_state_type.go @@ -8,31 +8,39 @@ package models import ( "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // SLStateType s l state type +// // swagger:model SLStateType type SLStateType string const ( + // SLStateTypePass captures enum value "Pass" SLStateTypePass SLStateType = "Pass" + // SLStateTypeTask captures enum value "Task" SLStateTypeTask SLStateType = "Task" + // SLStateTypeChoice captures enum value "Choice" SLStateTypeChoice SLStateType = "Choice" + // SLStateTypeWait captures enum value "Wait" SLStateTypeWait SLStateType = "Wait" + // SLStateTypeSucceed captures enum value "Succeed" SLStateTypeSucceed SLStateType = "Succeed" + // SLStateTypeFail captures enum value "Fail" SLStateTypeFail SLStateType = "Fail" + // SLStateTypeParallel captures enum value "Parallel" SLStateTypeParallel SLStateType = "Parallel" + // SLStateTypeMap captures enum value "Map" SLStateTypeMap SLStateType = "Map" ) diff --git a/gen-go/models/start_workflow_request.go b/gen-go/models/start_workflow_request.go index 106574f9..56a9c705 100644 --- a/gen-go/models/start_workflow_request.go +++ b/gen-go/models/start_workflow_request.go @@ -6,13 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // StartWorkflowRequest start workflow request +// // swagger:model StartWorkflowRequest type StartWorkflowRequest struct { @@ -40,7 +40,6 @@ func (m *StartWorkflowRequest) Validate(formats strfmt.Registry) error { var res []error if err := m.validateWorkflowDefinition(formats); err != nil { - // prop res = append(res, err) } @@ -57,7 +56,6 @@ func (m *StartWorkflowRequest) validateWorkflowDefinition(formats strfmt.Registr } if m.WorkflowDefinition != nil { - if err := m.WorkflowDefinition.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("workflowDefinition") diff --git a/gen-go/models/state_resource.go b/gen-go/models/state_resource.go index 21839393..75a68e9a 100644 --- a/gen-go/models/state_resource.go +++ b/gen-go/models/state_resource.go @@ -6,17 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // StateResource state resource +// // swagger:model StateResource type StateResource struct { // last updated + // Format: date-time LastUpdated strfmt.DateTime `json:"lastUpdated,omitempty"` // name @@ -36,8 +38,11 @@ type StateResource struct { func (m *StateResource) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } @@ -47,6 +52,19 @@ func (m *StateResource) Validate(formats strfmt.Registry) error { return nil } +func (m *StateResource) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("lastUpdated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *StateResource) validateType(formats strfmt.Registry) error { if swag.IsZero(m.Type) { // not required diff --git a/gen-go/models/state_resource_type.go b/gen-go/models/state_resource_type.go index 5d06f4e4..77c1fde8 100644 --- a/gen-go/models/state_resource_type.go +++ b/gen-go/models/state_resource_type.go @@ -8,23 +8,27 @@ package models import ( "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // StateResourceType state resource type +// // swagger:model StateResourceType type StateResourceType string const ( + // StateResourceTypeJobDefinitionARN captures enum value "JobDefinitionARN" StateResourceTypeJobDefinitionARN StateResourceType = "JobDefinitionARN" + // StateResourceTypeActivityARN captures enum value "ActivityARN" StateResourceTypeActivityARN StateResourceType = "ActivityARN" + // StateResourceTypeLambdaFunctionARN captures enum value "LambdaFunctionARN" StateResourceTypeLambdaFunctionARN StateResourceType = "LambdaFunctionARN" + // StateResourceTypeTaskARN captures enum value "TaskARN" StateResourceTypeTaskARN StateResourceType = "TaskARN" ) diff --git a/gen-go/models/workflow.go b/gen-go/models/workflow.go index bd74c375..a4e5297d 100644 --- a/gen-go/models/workflow.go +++ b/gen-go/models/workflow.go @@ -8,13 +8,13 @@ package models import ( "strconv" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // Workflow workflow +// // swagger:model Workflow type Workflow struct { WorkflowSummary @@ -31,63 +31,62 @@ type Workflow struct { // UnmarshalJSON unmarshals this object from a JSON structure func (m *Workflow) UnmarshalJSON(raw []byte) error { - + // AO0 var aO0 WorkflowSummary if err := swag.ReadJSON(raw, &aO0); err != nil { return err } m.WorkflowSummary = aO0 - var data struct { - Jobs []*Job `json:"jobs,omitempty"` + // AO1 + var dataAO1 struct { + Jobs []*Job `json:"jobs"` Output string `json:"output,omitempty"` StatusReason string `json:"statusReason,omitempty"` } - if err := swag.ReadJSON(raw, &data); err != nil { + if err := swag.ReadJSON(raw, &dataAO1); err != nil { return err } - m.Jobs = data.Jobs + m.Jobs = dataAO1.Jobs - m.Output = data.Output + m.Output = dataAO1.Output - m.StatusReason = data.StatusReason + m.StatusReason = dataAO1.StatusReason return nil } // MarshalJSON marshals this object to a JSON structure func (m Workflow) MarshalJSON() ([]byte, error) { - var _parts [][]byte + _parts := make([][]byte, 0, 2) aO0, err := swag.WriteJSON(m.WorkflowSummary) if err != nil { return nil, err } _parts = append(_parts, aO0) - - var data struct { - Jobs []*Job `json:"jobs,omitempty"` + var dataAO1 struct { + Jobs []*Job `json:"jobs"` Output string `json:"output,omitempty"` StatusReason string `json:"statusReason,omitempty"` } - data.Jobs = m.Jobs + dataAO1.Jobs = m.Jobs - data.Output = m.Output + dataAO1.Output = m.Output - data.StatusReason = m.StatusReason + dataAO1.StatusReason = m.StatusReason - jsonData, err := swag.WriteJSON(data) - if err != nil { - return nil, err + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 } - _parts = append(_parts, jsonData) - + _parts = append(_parts, jsonDataAO1) return swag.ConcatJSON(_parts...), nil } @@ -95,6 +94,7 @@ func (m Workflow) MarshalJSON() ([]byte, error) { func (m *Workflow) Validate(formats strfmt.Registry) error { var res []error + // validation for a type composition with WorkflowSummary if err := m.WorkflowSummary.Validate(formats); err != nil { res = append(res, err) } @@ -116,13 +116,11 @@ func (m *Workflow) validateJobs(formats strfmt.Registry) error { } for i := 0; i < len(m.Jobs); i++ { - if swag.IsZero(m.Jobs[i]) { // not required continue } if m.Jobs[i] != nil { - if err := m.Jobs[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) diff --git a/gen-go/models/workflow_definition.go b/gen-go/models/workflow_definition.go index b7199ba2..cae895ea 100644 --- a/gen-go/models/workflow_definition.go +++ b/gen-go/models/workflow_definition.go @@ -6,17 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // WorkflowDefinition workflow definition +// // swagger:model WorkflowDefinition type WorkflowDefinition struct { // created at + // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` // defaultTags: object with key-value pairs; keys and values should be strings @@ -42,13 +44,15 @@ type WorkflowDefinition struct { func (m *WorkflowDefinition) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + if err := m.validateManager(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStateMachine(formats); err != nil { - // prop res = append(res, err) } @@ -58,6 +62,19 @@ func (m *WorkflowDefinition) Validate(formats strfmt.Registry) error { return nil } +func (m *WorkflowDefinition) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WorkflowDefinition) validateManager(formats strfmt.Registry) error { if swag.IsZero(m.Manager) { // not required @@ -81,7 +98,6 @@ func (m *WorkflowDefinition) validateStateMachine(formats strfmt.Registry) error } if m.StateMachine != nil { - if err := m.StateMachine.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("stateMachine") diff --git a/gen-go/models/workflow_definition_overrides.go b/gen-go/models/workflow_definition_overrides.go index 133bf84c..a40c1a1d 100644 --- a/gen-go/models/workflow_definition_overrides.go +++ b/gen-go/models/workflow_definition_overrides.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // WorkflowDefinitionOverrides workflow definition overrides +// // swagger:model WorkflowDefinitionOverrides type WorkflowDefinitionOverrides struct { @@ -22,11 +21,6 @@ type WorkflowDefinitionOverrides struct { // Validate validates this workflow definition overrides func (m *WorkflowDefinitionOverrides) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/workflow_definition_ref.go b/gen-go/models/workflow_definition_ref.go index 8222c671..126fcac7 100644 --- a/gen-go/models/workflow_definition_ref.go +++ b/gen-go/models/workflow_definition_ref.go @@ -6,13 +6,12 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // WorkflowDefinitionRef workflow definition ref +// // swagger:model WorkflowDefinitionRef type WorkflowDefinitionRef struct { @@ -25,11 +24,6 @@ type WorkflowDefinitionRef struct { // Validate validates this workflow definition ref func (m *WorkflowDefinitionRef) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } return nil } diff --git a/gen-go/models/workflow_query.go b/gen-go/models/workflow_query.go index c9af2bde..51f6263d 100644 --- a/gen-go/models/workflow_query.go +++ b/gen-go/models/workflow_query.go @@ -6,14 +6,14 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) // WorkflowQuery workflow query +// // swagger:model WorkflowQuery type WorkflowQuery struct { @@ -46,22 +46,18 @@ func (m *WorkflowQuery) Validate(formats strfmt.Registry) error { var res []error if err := m.validateLimit(formats); err != nil { - // prop res = append(res, err) } if err := m.validateResolvedByUserWrapper(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop res = append(res, err) } if err := m.validateWorkflowDefinitionName(formats); err != nil { - // prop res = append(res, err) } @@ -91,7 +87,6 @@ func (m *WorkflowQuery) validateResolvedByUserWrapper(formats strfmt.Registry) e } if m.ResolvedByUserWrapper != nil { - if err := m.ResolvedByUserWrapper.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("resolvedByUserWrapper") diff --git a/gen-go/models/workflow_status.go b/gen-go/models/workflow_status.go index 9814c88d..d427dbfc 100644 --- a/gen-go/models/workflow_status.go +++ b/gen-go/models/workflow_status.go @@ -8,25 +8,30 @@ package models import ( "encoding/json" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" ) // WorkflowStatus workflow status +// // swagger:model WorkflowStatus type WorkflowStatus string const ( + // WorkflowStatusQueued captures enum value "queued" WorkflowStatusQueued WorkflowStatus = "queued" + // WorkflowStatusRunning captures enum value "running" WorkflowStatusRunning WorkflowStatus = "running" + // WorkflowStatusFailed captures enum value "failed" WorkflowStatusFailed WorkflowStatus = "failed" + // WorkflowStatusSucceeded captures enum value "succeeded" WorkflowStatusSucceeded WorkflowStatus = "succeeded" + // WorkflowStatusCancelled captures enum value "cancelled" WorkflowStatusCancelled WorkflowStatus = "cancelled" ) diff --git a/gen-go/models/workflow_summary.go b/gen-go/models/workflow_summary.go index 0a36648e..f04c8674 100644 --- a/gen-go/models/workflow_summary.go +++ b/gen-go/models/workflow_summary.go @@ -6,17 +6,19 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // WorkflowSummary workflow summary +// // swagger:model WorkflowSummary type WorkflowSummary struct { // created at + // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` // id @@ -29,6 +31,7 @@ type WorkflowSummary struct { LastJob *Job `json:"lastJob,omitempty"` // last updated + // Format: date-time LastUpdated strfmt.DateTime `json:"lastUpdated,omitempty"` // namespace @@ -50,6 +53,7 @@ type WorkflowSummary struct { Status WorkflowStatus `json:"status,omitempty"` // stopped at + // Format: date-time StoppedAt strfmt.DateTime `json:"stoppedAt,omitempty"` // tags: object with key-value pairs; keys and values should be strings @@ -63,23 +67,27 @@ type WorkflowSummary struct { func (m *WorkflowSummary) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + if err := m.validateLastJob(formats); err != nil { - // prop res = append(res, err) } - if err := m.validateRetries(formats); err != nil { - // prop + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateStoppedAt(formats); err != nil { res = append(res, err) } if err := m.validateWorkflowDefinition(formats); err != nil { - // prop res = append(res, err) } @@ -89,6 +97,19 @@ func (m *WorkflowSummary) Validate(formats strfmt.Registry) error { return nil } +func (m *WorkflowSummary) validateCreatedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WorkflowSummary) validateLastJob(formats strfmt.Registry) error { if swag.IsZero(m.LastJob) { // not required @@ -96,7 +117,6 @@ func (m *WorkflowSummary) validateLastJob(formats strfmt.Registry) error { } if m.LastJob != nil { - if err := m.LastJob.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("lastJob") @@ -108,12 +128,16 @@ func (m *WorkflowSummary) validateLastJob(formats strfmt.Registry) error { return nil } -func (m *WorkflowSummary) validateRetries(formats strfmt.Registry) error { +func (m *WorkflowSummary) validateLastUpdated(formats strfmt.Registry) error { - if swag.IsZero(m.Retries) { // not required + if swag.IsZero(m.LastUpdated) { // not required return nil } + if err := validate.FormatOf("lastUpdated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + return nil } @@ -133,6 +157,19 @@ func (m *WorkflowSummary) validateStatus(formats strfmt.Registry) error { return nil } +func (m *WorkflowSummary) validateStoppedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.StoppedAt) { // not required + return nil + } + + if err := validate.FormatOf("stoppedAt", "body", "date-time", m.StoppedAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WorkflowSummary) validateWorkflowDefinition(formats strfmt.Registry) error { if swag.IsZero(m.WorkflowDefinition) { // not required @@ -140,7 +177,6 @@ func (m *WorkflowSummary) validateWorkflowDefinition(formats strfmt.Registry) er } if m.WorkflowDefinition != nil { - if err := m.WorkflowDefinition.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("workflowDefinition") diff --git a/gen-go/server/db/dynamodb/dynamodb_test.go b/gen-go/server/db/dynamodb/dynamodb_test.go index 1c82c736..b83ef361 100644 --- a/gen-go/server/db/dynamodb/dynamodb_test.go +++ b/gen-go/server/db/dynamodb/dynamodb_test.go @@ -60,7 +60,8 @@ func TestDynamoDBStore(t *testing.T) { txt := errLines.Text() t.Logf("ddblocal stderr: %s", txt) if txt == "java.net.BindException: Address already in use" { - t.Fatal(`zombie ddb local process running. Kill it and try again: pgrep -f "java -jar /tmp/DynamoDBLocal.jar" | xargs kill`) + t.Errorf(`zombie ddb local process running. Kill it and try again: pgrep -f "java -jar /tmp/DynamoDBLocal.jar" | xargs kill`) + return } } }() @@ -68,7 +69,8 @@ func TestDynamoDBStore(t *testing.T) { // the ddblocal command should not exit with an error before the test is finished go func() { if err := cmd.Wait(); err != nil && testCtx.Err() == nil { - t.Fatalf("cmd.Wait: %s", err) + t.Errorf("cmd.Wait: %s", err) + return } }() diff --git a/gen-go/tracing/tracing.go b/gen-go/tracing/tracing.go index f1381613..f1d6bfce 100644 --- a/gen-go/tracing/tracing.go +++ b/gen-go/tracing/tracing.go @@ -14,10 +14,10 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/otlpgrpc" "go.opentelemetry.io/otel/propagation" - sdkexporttrace "go.opentelemetry.io/otel/sdk/export/trace" - "go.opentelemetry.io/otel/sdk/export/trace/tracetest" sdktrace "go.opentelemetry.io/otel/sdk/trace" + "go.opentelemetry.io/otel/sdk/trace/tracetest" "go.opentelemetry.io/otel/trace" "gopkg.in/Clever/kayvee-go.v6/logger" ) @@ -32,7 +32,7 @@ var defaultCollectorPort uint16 = 4317 // SetupGlobalTraceProviderAndExporter sets up an exporter to export, // as well as the opentelemetry global trace provider for trace generators to use. // The exporter and provider are returned in order for the caller to defer shutdown. -func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdkexporttrace.SpanExporter, *sdktrace.TracerProvider, error) { +func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdktrace.SpanExporter, *sdktrace.TracerProvider, error) { // 1. set up exporter // 2. set up tracer provider // 3. assign global tracer provider @@ -57,11 +57,14 @@ func SetupGlobalTraceProviderAndExporter(ctx context.Context) (sdkexporttrace.Sp // the default location of localhost:4317 // When running in production this is a sidecar, and when running // locally this is a locally running opetelemetry-collector. + driver := otlpgrpc.NewDriver( + otlpgrpc.WithReconnectionPeriod(15*time.Second), + otlpgrpc.WithEndpoint(addr), + otlpgrpc.WithInsecure(), + ) exporter, err := otlp.NewExporter( ctx, - otlp.WithAddress(addr), - otlp.WithReconnectionPeriod(15*time.Second), - otlp.WithInsecure(), + driver, ) if err != nil { return nil, nil, fmt.Errorf("error creating exporter: %v", err) @@ -86,18 +89,17 @@ func SetupGlobalTraceProviderAndExporterForTest() (*tracetest.InMemoryExporter, return exporter, tp, nil } -func newTracerProvider(exporter sdkexporttrace.SpanExporter, samplingProbability float64) *sdktrace.TracerProvider { +func newTracerProvider(exporter sdktrace.SpanExporter, samplingProbability float64) *sdktrace.TracerProvider { return sdktrace.NewTracerProvider( - sdktrace.WithConfig(sdktrace.Config{ - // We use the default ID generator. In order for sampling to work (at least with this sampler) - // the ID generator must generate trace IDs uniformly at random from the entire space of uint64. - // For example, the default x-ray ID generator does not do this. - DefaultSampler: sdktrace.ParentBased(sdktrace.TraceIDRatioBased(samplingProbability)), - // These maximums are to guard against something going wrong and sending a ton of data unexpectedly - // They could be tweaked in the future if needed. - MaxEventsPerSpan: 100, - MaxAttributesPerSpan: 100, - MaxLinksPerSpan: 100, + // We use the default ID generator. In order for sampling to work (at least with this sampler) + // the ID generator must generate trace IDs uniformly at random from the entire space of uint64. + // For example, the default x-ray ID generator does not do this. + sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(samplingProbability))), + // These maximums are to guard against something going wrong and sending a ton of data unexpectedly + sdktrace.WithSpanLimits(sdktrace.SpanLimits{ + AttributeCountLimit: 100, + EventCountLimit: 100, + LinkCountLimit: 100, }), sdktrace.WithSyncer(exporter), ) @@ -113,7 +115,7 @@ func MuxServerMiddleware(serviceName string) func(http.Handler) http.Handler { // otelmux has extracted the span. now put it into the ctx-specific logger s := trace.SpanFromContext(r.Context()) if sc := s.SpanContext(); sc.HasTraceID() { - spanID, traceID := sc.SpanID.String(), sc.TraceID.String() + spanID, traceID := sc.SpanID().String(), sc.TraceID().String() // datadog converts hex strings to uint64 IDs, so log those so that correlating logs and traces works if len(traceID) == 32 && len(spanID) == 16 { // opentelemetry format: 16 byte (32-char hex), 8 byte (16-char hex) trace and span ids traceIDBs, _ := hex.DecodeString(traceID) @@ -162,8 +164,8 @@ func (rt roundTripper) RoundTrip(r *http.Request) (*http.Response, error) { func ExtractSpanAndTraceID(r *http.Request) (traceID, spanID string) { s := trace.SpanFromContext(r.Context()) if s.SpanContext().HasTraceID() { - return s.SpanContext().TraceID.String(), s.SpanContext().SpanID.String() + return s.SpanContext().TraceID().String(), s.SpanContext().SpanID().String() } - sc := trace.RemoteSpanContextFromContext(propagator.Extract(r.Context(), r.Header)) - return sc.SpanID.String(), sc.TraceID.String() + sc := trace.SpanContextFromContext(propagator.Extract(r.Context(), propagation.HeaderCarrier(r.Header))) + return sc.SpanID().String(), sc.TraceID().String() } diff --git a/gen-js/README.md b/gen-js/README.md index dd6c9e4a..78efea72 100644 --- a/gen-js/README.md +++ b/gen-js/README.md @@ -8,6 +8,7 @@ workflow-manager client library. * [WorkflowManager](#exp_module_workflow-manager--WorkflowManager) ⏏ * [new WorkflowManager(options)](#new_module_workflow-manager--WorkflowManager_new) * _instance_ + * [.close()](#module_workflow-manager--WorkflowManager+close) * [.healthCheck([options], [cb])](#module_workflow-manager--WorkflowManager+healthCheck) ⇒ Promise * [.postStateResource(NewStateResource, [options], [cb])](#module_workflow-manager--WorkflowManager+postStateResource) ⇒ Promise * [.deleteStateResource(params, [options], [cb])](#module_workflow-manager--WorkflowManager+deleteStateResource) ⇒ Promise @@ -65,6 +66,12 @@ Create a new client object. | [options.circuit.sleepWindow] | number | | how long, in milliseconds, to wait after a circuit opens before testing for recovery. Default: 5000. | | [options.circuit.errorPercentThreshold] | number | | the threshold to place on the rolling error rate. Once the error rate exceeds this percentage, the circuit opens. Default: 90. | + + +#### workflowManager.close() +Releases handles used in client + +**Kind**: instance method of [WorkflowManager](#exp_module_workflow-manager--WorkflowManager) #### workflowManager.healthCheck([options], [cb]) ⇒ Promise diff --git a/gen-js/index.d.ts b/gen-js/index.d.ts index 378f8418..11faf720 100644 --- a/gen-js/index.d.ts +++ b/gen-js/index.d.ts @@ -54,6 +54,7 @@ import models = WorkflowManager.Models declare class WorkflowManager { constructor(options: WorkflowManagerOptions); + close(); healthCheck(options?: RequestOptions, cb?: Callback): Promise @@ -347,7 +348,11 @@ declare namespace WorkflowManager { name: string; }; - type Workflow = any; + type Workflow = WorkflowSummary & { + jobs?: Job[]; + output?: string; + statusReason?: string; +}; type WorkflowDefinition = { createdAt?: string; diff --git a/gen-js/index.js b/gen-js/index.js index b86c6118..ee653db1 100644 --- a/gen-js/index.js +++ b/gen-js/index.js @@ -205,7 +205,14 @@ class WorkflowManager { context(this). build(); - setInterval(() => this._logCircuitState(), circuitOptions.logIntervalMs); + this._logCircuitStateInterval = setInterval(() => this._logCircuitState(), circuitOptions.logIntervalMs); + } + + /** + * Releases handles used in client + */ + close() { + clearInterval(this._logCircuitStateInterval); } _hystrixCommandErrorHandler(err) { diff --git a/go.mod b/go.mod index ea22470d..f5ec9af7 100644 --- a/go.mod +++ b/go.mod @@ -32,12 +32,12 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v0.0.0-20181016150526-f3a9dae5b194 // indirect - go.opentelemetry.io/contrib v0.20.0 // indirect - go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.15.1 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.15.1 - go.opentelemetry.io/otel v0.15.0 - go.opentelemetry.io/otel/exporters/otlp v0.15.0 - go.opentelemetry.io/otel/sdk v0.15.0 + go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.20.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 + go.opentelemetry.io/otel v0.20.0 + go.opentelemetry.io/otel/exporters/otlp v0.20.0 + go.opentelemetry.io/otel/sdk v0.20.0 + go.opentelemetry.io/otel/trace v0.20.0 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba diff --git a/go.sum b/go.sum index 9d9f7f22..234387f2 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Clever/aws-sdk-go-counter v1.10.39-0.20190610193009-b603aedc6d67 h1:8Bzz+tjpnTX0uBwsm9yt2OeBjRTeV0olTfAZ7yHUNKE= github.com/Clever/aws-sdk-go-counter v1.10.39-0.20190610193009-b603aedc6d67/go.mod h1:nLHwBoaxM28ZibccJTfALxzF5EwxdPtjwUHx86LqGVM= @@ -6,8 +7,6 @@ github.com/Clever/discovery-go v1.7.2 h1:sK3PJCz7Q94fDUAncTi4FDUHqMHrAYefPe0x8ZN github.com/Clever/discovery-go v1.7.2/go.mod h1:WC3d6zZHgBarTh3TCktYLy5Bj1Auj5fH86TkP+La71o= github.com/Clever/go-process-metrics v0.0.0-20181203221932-ca5b011e155b h1:2TwlwsQb23rIyB6kNt7ZHulE8268jYK64y+SVhUpR7Y= github.com/Clever/go-process-metrics v0.0.0-20181203221932-ca5b011e155b/go.mod h1:Aemel1It05GRZlIfbxbTLl0TwgFaaAALkqfyzuTDk7s= -github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= -github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -15,6 +14,7 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= @@ -29,6 +29,7 @@ github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiU github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -42,6 +43,8 @@ github.com/elastic/go-elasticsearch/v6 v6.8.10/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgo github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -149,8 +152,6 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.1-0.20190311190120-bfa1e97ed7a1 h1:S2kR68h6LdRzHgVxoK0kqm9VGASjDAXIhMHOEBkXnuQ= @@ -163,27 +164,32 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -203,7 +209,6 @@ github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALr github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -241,6 +246,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -261,6 +267,7 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -284,21 +291,32 @@ go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= -go.opentelemetry.io/contrib v0.15.1/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.15.1 h1:Kk5bCxwhp2S2g7J+/ZdSMwersFwUgFo54w6vfQFxoco= -go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.15.1/go.mod h1:jpRoS4C9Qpr48FKj9VR8aTn59GdNTN6PlTf9ox68+zI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.15.1 h1:RzdmttkXB1XOFugrp54/LnD05F0ILGpLabVzeLNbDlM= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.15.1/go.mod h1:qp45QbZrUeh/heRagKIyaKPHOfU1kINwWYa6CR66LF0= -go.opentelemetry.io/contrib/propagators v0.15.1 h1:+TqZCAEBcLaCnmr39jfwum4CA6vPMjP+4xV+6HNgRMA= -go.opentelemetry.io/contrib/propagators v0.15.1/go.mod h1:wMkctQR8GsUG9JaEhf9p6K1rz9Pet7ySMQmYI0729iM= -go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw= -go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA= -go.opentelemetry.io/otel/exporters/otlp v0.15.0 h1:nZcr3JMl+ai/S3KbWash8g2SM3hW8CmntDjOeQS3cDs= -go.opentelemetry.io/otel/exporters/otlp v0.15.0/go.mod h1:g51QPk9HYnS7LHT3ugk54ZCYH9EgZ8PutmpRPV9DOc4= -go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8= -go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc= +go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.20.0 h1:9Dd3wngO66ccAbfZtp+1f7Y/j4X16BP5PDQu99Cd8fE= +go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.20.0/go.mod h1:pYsip5LJxr3Ty4I4i0gOXtiO3cxemma9EnvK6GqwQnw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 h1:Q3C9yzW6I9jqEc8sawxzxZmY48fs9u220KXq6d5s3XU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= +go.opentelemetry.io/contrib/propagators v0.20.0 h1:IrLQng5Z7AfzkS4sEsYaj2ejkO4FCkgKdAr1aYKOfNc= +go.opentelemetry.io/contrib/propagators v0.20.0/go.mod h1:yLmt93MeSiARUwrK57bOZ4FBruRN4taLiW1lcGfnOes= +go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0 h1:JsxtGXd06J8jrnya7fdI/U/MR6yXA5DtbZy+qoHQlr8= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0 h1:c5VRjxCXdQlx1HjzwGdQHzZaVI82b5EbBgOu2ljD92g= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0 h1:7ao1wpzHRVKf0OQ7GIxiQJA6X7DLX9o14gmVon7mMK8= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -315,21 +333,24 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -376,21 +397,29 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 h1:fiNLklpBwWK1mth30Hlwk+fcdBmIALlgF5iy77O37Ig= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0 h1:uSZWeQJX5j11bIQ4AJoj+McDBo29cY1MCoC1wO3ts+c= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/Clever/kayvee-go.v6 v6.24.1 h1:lHxjlTFj57mfrq06PiCKIAJ0QuHHEqsyvSYvzb+gSFg= gopkg.in/Clever/kayvee-go.v6 v6.24.1/go.mod h1:G0m6nBZj7Kdz+w2hiIaawmhXl5zp7E/K0ashol3Kb2A= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -400,6 +429,7 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= diff --git a/main.go b/main.go index 8972e656..0dbbac3a 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ import ( "github.com/elastic/go-elasticsearch/v6" "github.com/kardianos/osext" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" counter "github.com/Clever/aws-sdk-go-counter" @@ -218,7 +218,7 @@ func tracedTransport(component string, peerService string, spanNamer func(operat otelhttp.WithSpanNameFormatter(spanNamer), otelhttp.WithSpanOptions( trace.WithSpanKind(trace.SpanKindClient), - trace.WithAttributes(label.String("peer.service", peerService), label.String("component", component)), + trace.WithAttributes(attribute.String("peer.service", peerService), attribute.String("component", component)), ), ) } From 202bd5c832ae470c79ec675a9a74cfa5ac339133 Mon Sep 17 00:00:00 2001 From: Taylor Sutton Date: Fri, 30 Jul 2021 14:06:15 -0700 Subject: [PATCH 2/3] Use Go 1.16. --- .circleci/config.yml | 2 +- Makefile | 2 +- golang.mk | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21227174..f2c8c69d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: /go/src/github.com/Clever/workflow-manager docker: - - image: circleci/golang:1.13-stretch-node + - image: circleci/golang:1.16-stretch-node steps: - checkout - setup_remote_docker diff --git a/Makefile b/Makefile index bedd55c8..fc4d2d3f 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ PKGS := $(PKGS) $(PKG)/gen-go/server/db/dynamodb WAG_VERSION := latest -$(eval $(call golang-version-check,1.13)) +$(eval $(call golang-version-check,1.16)) all: test build diff --git a/golang.mk b/golang.mk index 18e211c4..c4b6a4aa 100644 --- a/golang.mk +++ b/golang.mk @@ -1,7 +1,7 @@ # This is the default Clever Golang Makefile. # It is stored in the dev-handbook repo, github.com/Clever/dev-handbook # Please do not alter this file directly. -GOLANG_MK_VERSION := 1.0.0 +GOLANG_MK_VERSION := 1.0.1 SHELL := /bin/bash SYSTEM := $(shell uname -a | cut -d" " -f1 | tr '[:upper:]' '[:lower:]') @@ -11,7 +11,7 @@ SYSTEM := $(shell uname -a | cut -d" " -f1 | tr '[:upper:]' '[:lower:]') export TZ=UTC # go build flags for use across all commands which accept them -GO_BUILD_FLAGS := "-mod=vendor" +export GOFLAGS := -mod=vendor $(GOFLAGS) # if the gopath includes several directories, use only the first GOPATH=$(shell echo $$GOPATH | cut -d: -f1) @@ -39,7 +39,7 @@ endef # so we're defended against it breaking or changing in the future. FGT := $(GOPATH)/bin/fgt $(FGT): - go get github.com/GeertJohan/fgt@262f7b11eec07dc7b147c44641236f3212fee89d + go install -mod=readonly github.com/GeertJohan/fgt@262f7b11eec07dc7b147c44641236f3212fee89d golang-ensure-curl-installed: @command -v curl >/dev/null 2>&1 || { echo >&2 "curl not installed. Please install curl."; exit 1; } @@ -49,7 +49,7 @@ golang-ensure-curl-installed: # previously passing tests start failing without changing our code. GOLINT := $(GOPATH)/bin/golint $(GOLINT): - go get golang.org/x/lint/golint@738671d3881b9731cc63024d5d88cf28db875626 + go install -mod=readonly golang.org/x/lint/golint@738671d3881b9731cc63024d5d88cf28db875626 # golang-fmt-deps requires the FGT tool for checking output golang-fmt-deps: $(FGT) @@ -89,7 +89,7 @@ golang-test-deps: # arg1: pkg path define golang-test @echo "TESTING $(1)..." -@go test $(GO_BUILD_FLAGS) -v $(1) +@go test -v $(1) endef # golang-test-strict-deps is here for consistency @@ -99,7 +99,7 @@ golang-test-strict-deps: # arg1: pkg path define golang-test-strict @echo "TESTING $(1)..." -@go test -v $(GO_BUILD_FLAGS) -race $(1) +@go test -v -race $(1) endef # golang-vet-deps is here for consistency @@ -109,7 +109,7 @@ golang-vet-deps: # arg1: pkg path define golang-vet @echo "VETTING $(1)..." -@go vet $(GO_BUILD_FLAGS) $(1) +@go vet $(1) endef # golang-test-all-deps installs all dependencies needed for different test cases. @@ -143,10 +143,10 @@ endef define golang-build @echo "BUILDING..." @if [ -z "$$CI" ]; then \ - go build $(GO_BUILD_FLAGS) -o bin/$(2) $(1); \ + go build -o bin/$(2) $(1); \ else \ echo "-> Building CGO binary"; \ - CGO_ENABLED=0 go build $(GO_BUILD_FLAGS) -installsuffix cgo -o bin/$(2) $(1); \ + CGO_ENABLED=0 go build -installsuffix cgo -o bin/$(2) $(1); \ fi; endef From beb09feed82aa5795187ce62c488628afc9dee60 Mon Sep 17 00:00:00 2001 From: Taylor Sutton Date: Mon, 2 Aug 2021 10:24:07 -0700 Subject: [PATCH 3/3] Enable tracing. --- launch/workflow-manager.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/launch/workflow-manager.yml b/launch/workflow-manager.yml index e7932f16..ecf324e1 100644 --- a/launch/workflow-manager.yml +++ b/launch/workflow-manager.yml @@ -54,3 +54,8 @@ alarms: source: ELB pod_config: group: us-west-1 +telemetry: + enabled: true + tracing: + exporters: + - datadog