Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

feat: Use keptn/go-utils to access Keptn APIs #767

Merged
merged 21 commits into from
Apr 12, 2022

Conversation

arthurpitman
Copy link
Collaborator

Closes #754

}

func NewErrorHandler(err error, event cloudevents.Event) *ErrorHandler {
func NewErrorHandler(err error, event cloudevents.Event, uniformClient keptn.UniformClientInterface) *ErrorHandler {
Copy link
Contributor

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 NewErrorHandler should have comment or be unexported

@@ -24,18 +26,23 @@ type DynatraceEventHandler interface {
HandleEvent() error
}

func NewEventHandler(event cloudevents.Event) DynatraceEventHandler {
eventHandler, err := getEventHandler(event)
func NewEventHandler(event cloudevents.Event) (DynatraceEventHandler, error) {
Copy link
Contributor

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 NewEventHandler should have comment or be unexported

}

func NewEventClientBase() *EventClientBase {
func NewEventClientBase(client keptnapi.EventsV1Interface) *EventClientBase {
Copy link
Contributor

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 NewEventClientBase should have comment or be unexported

}

func NewServiceClient(client *keptnapi.ServiceHandler, httpClient *http.Client) *ServiceClient {
func NewServiceClient(client keptnapi.ServicesV1Interface, apiClient keptnapi.APIV1Interface) *ServiceClient {
Copy link
Contributor

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 NewServiceClient should have comment or be unexported

@arthurpitman arthurpitman marked this pull request as draft April 7, 2022 14:15
Signed-off-by: Arthur Pitman <[email protected]>
@arthurpitman arthurpitman marked this pull request as ready for review April 8, 2022 11:42
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
}

func NewDynatraceConfigGetter(client keptn.DynatraceConfigResourceClientInterface) *DynatraceConfigGetter {
func NewDynatraceConfigGetter(client keptn.DynatraceConfigReaderInterface) *DynatraceConfigGetter {
Copy link
Contributor

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 NewDynatraceConfigGetter should have comment or be unexported

serviceClient keptn.ServiceClientInterface
}

func NewConfiguration(dynatraceClient dynatrace.ClientInterface, keptnClient keptn.ClientInterface, sloReader keptn.SLOResourceReaderInterface, serviceClient keptn.ServiceClientInterface) *Configuration {
func NewConfiguration(dynatraceClient dynatrace.ClientInterface, keptnClient keptn.ClientInterface, sloReader keptn.SLOReaderInterface, serviceClient keptn.ServiceClientInterface) *Configuration {
Copy link
Contributor

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 NewConfiguration should have comment or be unexported

}

func NewMetricEventCreation(dynatraceClient dynatrace.ClientInterface, keptnClient keptn.ClientInterface, sloReader keptn.SLOResourceReaderInterface) MetricEventCreation {
func NewMetricEventCreation(dynatraceClient dynatrace.ClientInterface, keptnClient keptn.ClientInterface, sloReader keptn.SLOReaderInterface) MetricEventCreation {
Copy link
Contributor

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 NewMetricEventCreation should have comment or be unexported


secretName string
dashboard string
}

func NewGetSLITriggeredHandler(event GetSLITriggeredAdapterInterface, dtClient dynatrace.ClientInterface, kClient keptn.ClientInterface, resourceClient keptn.ResourceClientInterface, secretName string, dashboard string) GetSLIEventHandler {
func NewGetSLITriggeredHandler(event GetSLITriggeredAdapterInterface, dtClient dynatrace.ClientInterface, kClient keptn.ClientInterface, resourceClient keptn.SLOAndSLIClientInterface, secretName string, dashboard string) GetSLIEventHandler {
Copy link
Contributor

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 NewGetSLITriggeredHandler should have comment or be unexported

Signed-off-by: Arthur Pitman <[email protected]>
@@ -16,7 +16,7 @@ import (
"github.com/keptn/go-utils/pkg/lib/keptn"
)

const KEPTNSBRIDGE_LABEL = "Keptns Bridge"
const BridgeLabel = "Keptns Bridge"
Copy link
Contributor

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 const BridgeLabel should have comment or be unexported

@@ -16,7 +16,8 @@ import (
"github.com/keptn/go-utils/pkg/lib/keptn"
)

const KEPTNSBRIDGE_LABEL = "Keptns Bridge"
const BridgeLabel = "Keptns Bridge"
const ProblemURLLabel = "Problem URL"
Copy link
Contributor

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 const ProblemURLLabel should have comment or be unexported

@sonarcloud
Copy link

sonarcloud bot commented Apr 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

The following Docker Images have been built:
keptncontrib/dynatrace-service:0.22.1-dev-pr-767,keptncontrib/dynatrace-service:0.22.1-dev-pr-767.202204111403

Copy link
Contributor

@j-poecher j-poecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@arthurpitman arthurpitman merged commit a2a798a into master Apr 12, 2022
@arthurpitman arthurpitman deleted the feature/754/use-go-utils-for-keptn-apis branch April 12, 2022 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use keptn/go-utils to access Keptn APIs
2 participants