Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

feat: Added option for configuring number of retries for http event sender, as well as additional logging #465

Merged
merged 6 commits into from
May 17, 2022

Conversation

bacherfl
Copy link
Member

This PR provides an option to configure the number of retries that are performed when trying to send a cloud event. Also, the error message has been adapted to give more insights on why an event could not be sent successfully

…ender, as well as additional logging

Signed-off-by: Florian Bacher <[email protected]>
@bacherfl bacherfl marked this pull request as draft May 12, 2022 08:50
@@ -41,16 +41,26 @@ const keptnSpecVersionCEExtension = "shkeptnspecversion"
const triggeredIDCEExtension = "triggeredid"
const keptnGitCommitIDCEExtension = "gitcommitid"

type HTTPSenderOption func(httpSender *HTTPEventSender)

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

@@ -41,16 +41,26 @@ const keptnSpecVersionCEExtension = "shkeptnspecversion"
const triggeredIDCEExtension = "triggeredid"
const keptnGitCommitIDCEExtension = "gitcommitid"

type HTTPSenderOption func(httpSender *HTTPEventSender)

func WithSendRetries(retries int) HTTPSenderOption {

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

}
}

func WithRetryCallback(cb func()) HTTPSenderOption {

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

@bacherfl bacherfl marked this pull request as ready for review May 12, 2022 13:51
Signed-off-by: Florian Bacher <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented May 12, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bacherfl bacherfl merged commit 2052e14 into master May 17, 2022
@bacherfl bacherfl deleted the feat/http-sender-retry branch May 17, 2022 08:28
bacherfl added a commit that referenced this pull request May 23, 2022
…ender, as well as additional logging (#465)

* feat: Added option for configuring number of retries for http event sender, as well as additional logging

Signed-off-by: Florian Bacher <[email protected]>

* added option for injecting retry callback

Signed-off-by: Florian Bacher <[email protected]>

* added option for injecting retry callback

Signed-off-by: Florian Bacher <[email protected]>

* remove retry callback option

Signed-off-by: Florian Bacher <[email protected]>

* remove retry callback option unit test

Signed-off-by: Florian Bacher <[email protected]>

* added comment

Signed-off-by: Florian Bacher <[email protected]>
(cherry picked from commit 2052e14)
bacherfl added a commit that referenced this pull request May 23, 2022
…ender, as well as additional logging (#465) (#467)

* feat: Added option for configuring number of retries for http event sender, as well as additional logging

Signed-off-by: Florian Bacher <[email protected]>

* added option for injecting retry callback

Signed-off-by: Florian Bacher <[email protected]>

* added option for injecting retry callback

Signed-off-by: Florian Bacher <[email protected]>

* remove retry callback option

Signed-off-by: Florian Bacher <[email protected]>

* remove retry callback option unit test

Signed-off-by: Florian Bacher <[email protected]>

* added comment

Signed-off-by: Florian Bacher <[email protected]>
(cherry picked from commit 2052e14)
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.

2 participants