-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
type ActionFinishedEventHandler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type ActionFinishedEventHandler should have comment or be unexported
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
type ActionFinishedEventHandler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
type name will be used as action.ActionFinishedEventHandler by other packages, and that stutters; consider calling this FinishedEventHandler
"github.com/keptn-contrib/dynatrace-service/internal/keptn" | ||
) | ||
|
||
type TestFinishedEventHandler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported type TestFinishedEventHandler should have comment or be unexported
internal/health/health_endpoint.go
Outdated
} | ||
|
||
// HealthEndpoint is a HTTP server that offers a health endpoint. | ||
type HealthEndpoint struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
type name will be used as health.HealthEndpoint by other packages, and that stutters; consider calling this Endpoint
internal/keptn/keptn_client.go
Outdated
@@ -96,35 +97,35 @@ func NewDefaultClient(event event.Event) (*Client, error) { | |||
return NewClient(kClient), nil | |||
} | |||
|
|||
func (c *Client) GetCustomQueries(project string, stage string, service string) (*CustomQueries, error) { | |||
func (c *Client) GetCustomQueries(ctx context.Context, project string, stage string, service string) (*CustomQueries, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method Client.GetCustomQueries should have comment or be unexported
internal/keptn/keptn_client.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &CustomQueries{values: customQueries}, nil | ||
} | ||
|
||
func (c *Client) GetShipyard() (*keptnv2.Shipyard, error) { | ||
shipyard, err := c.client.GetShipyard() | ||
func (c *Client) GetShipyard(ctx context.Context) (*keptnv2.Shipyard, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method Client.GetShipyard should have comment or be unexported
internal/keptn/keptn_client.go
Outdated
if err != nil { | ||
return nil, fmt.Errorf("failed to retrieve shipyard for project %s: %v", c.client.Event.GetProject(), err) | ||
} | ||
|
||
return shipyard, nil | ||
} | ||
|
||
func (c *Client) SendCloudEvent(factory adapter.CloudEventFactoryInterface) error { | ||
func (c *Client) SendCloudEvent(ctx context.Context, factory adapter.CloudEventFactoryInterface) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method Client.SendCloudEvent should have comment or be unexported
internal/onboard/service_sync.go
Outdated
func (s *ServiceSynchronizer) Run() { | ||
// Run runs the service synchronizer which does not return unless cancelled. | ||
// Cancelling runCtx will stop any new synchronization runs, cancelling synchronizationCtx will stop an in progress synchronization. | ||
func (s *ServiceSynchronizer) Run(runCtx context.Context, synchronizationCtx context.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
df8981b
to
5d067ac
Compare
cmd/main.go
Outdated
return 0 | ||
} | ||
|
||
func gotEvent(ctx context.Context, event cloudevents.Event) error { | ||
err := event_handler.NewEventHandler(event).HandleEvent() | ||
func gotEvent(workCtx context.Context, replyCtx context.Context, event cloudevents.Event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
} | ||
|
||
// HandleEvent handles an action finished event. | ||
func (eh *ActionFinishedEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
func (eh *ActionStartedEventHandler) HandleEvent() error { | ||
pid, err := eh.eClient.FindProblemID(eh.event) | ||
// HandleEvent handles an action started event. | ||
func (eh *ActionStartedEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
func (eh *ActionTriggeredEventHandler) HandleEvent() error { | ||
pid, err := eh.eClient.FindProblemID(eh.event) | ||
// HandleEvent handles an action triggered event. | ||
func (eh *ActionTriggeredEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
} | ||
|
||
// HandleEvent handles a deployment finished event. | ||
func (eh *DeploymentFinishedEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
@@ -28,7 +30,8 @@ func NewErrorHandler(err error, event cloudevents.Event, uniformClient keptn.Uni | |||
} | |||
} | |||
|
|||
func (eh ErrorHandler) HandleEvent() error { | |||
// HandleEvent handles errors by sending an error event. | |||
func (eh ErrorHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
type NoOpHandler struct { | ||
} | ||
|
||
func (eh NoOpHandler) HandleEvent() error { | ||
// HandleEvent handles an event by doing nothing. | ||
func (eh NoOpHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
func (eh ConfigureMonitoringEventHandler) HandleEvent() error { | ||
err := eh.configureMonitoring() | ||
// HandleEvent handles a configure monitoring event. | ||
func (eh ConfigureMonitoringEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
@@ -37,24 +39,25 @@ type RemediationTriggeredEventData struct { | |||
Problem RawProblem `json:"problem"` | |||
} | |||
|
|||
func (eh ProblemEventHandler) HandleEvent() error { | |||
// HandleEvent handles a problem event. | |||
func (eh ProblemEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
@@ -42,13 +43,14 @@ func NewGetSLITriggeredHandler(event GetSLITriggeredAdapterInterface, dtClient d | |||
} | |||
} | |||
|
|||
func (eh GetSLIEventHandler) HandleEvent() error { | |||
// HandleEvent handles a get-SLI triggered event. | |||
func (eh GetSLIEventHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
cmd/then_context.go
Outdated
"time" | ||
) | ||
|
||
func ThenWithTimeout(parent context.Context, waitCtx context.Context, timeout time.Duration) (context.Context, func()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
cmd/then_context.go
Outdated
"time" | ||
) | ||
|
||
func ThenWithTimeout(parent context.Context, waitCtx context.Context, timeout time.Duration) (context.Context, func()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported function ThenWithTimeout should have comment or be unexported
cmd/then_context.go
Outdated
) | ||
|
||
// newThenWithTimeoutContext creates a new Context that is done after timeout after waitCtx is done or if parentCtx is done. It returns the new context and a function that cancels the context. | ||
func newThenWithTimeoutContext(parentCtx context.Context, waitCtx context.Context, timeout time.Duration, name string) (context.Context, func()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
cbcd8c7
to
714440d
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
714440d
to
ce669df
Compare
cmd/main.go
Outdated
} | ||
} | ||
|
||
func gotEvent(workCtx context.Context, replyCtx context.Context, keptnClient *keptn.Client, event cloudevents.Event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
context.Context should be the first parameter of a function
ce669df
to
ca2517d
Compare
eae87fa
to
241ec09
Compare
@@ -59,7 +59,7 @@ func (eh *ConfigureMonitoringEventHandler) configureMonitoring(ctx context.Conte | |||
keptnCredentialsCheckResult := eh.checkKeptnCredentials(ctx) | |||
log.WithField("result", keptnCredentialsCheckResult).Info("Checked Keptn credentials") | |||
|
|||
shipyard, err := eh.shipyardReader.GetShipyard(eh.event.GetProject()) | |||
shipyard, err := eh.shipyardReader.GetShipyard(ctx, eh.event.GetProject()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci-lint] reported by reviewdog 🐶
eh.event.GetProject undefined (type ConfigureMonitoringAdapterInterface has no field or method GetProject) (typecheck)
281e2f3
to
07d3499
Compare
Signed-off-by: Arthur Pitman <[email protected]>
07d3499
to
a2c8600
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
The following Docker Images have been built: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Addresses #729