-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hearbeat reporting #1469
Merged
madebyrogal
merged 5 commits into
kubeshop:main
from
madebyrogal:implement-heartbeat-reporting
Jul 9, 2024
Merged
Hearbeat reporting #1469
madebyrogal
merged 5 commits into
kubeshop:main
from
madebyrogal:implement-heartbeat-reporting
Jul 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mszostok
approved these changes
Jul 8, 2024
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.
Tested e2e, works as expected 👌
But let's agree on code changes before merging 🙂
cmd/botkube-agent/main.go
Outdated
@@ -61,6 +61,8 @@ const ( | |||
reportHeartbeatMaxRetries = 30 | |||
) | |||
|
|||
var healthNotifiers = make(map[string]health.Notifier) |
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.
- it doesn't make sens to have a global var here. Let's move it to the healtChecker that is responsible for it
- no need to repeat the interfaces (
HealthNotifierSink
/HealthNotifierBot
). You should have a single interface in place which expect it (healthChecker) - if / else statement is repeated, while it's common for all integrations, please see linked code changes to see how it can be changed.
- FailedSink and FailedBot, referring to the same. The healthChecker - it doesn't care, just have single one.
- You don't need to be worried about integration name, you can use it on 'nil'
func Test(t *testing.T) { app, err := NewSocketSlackDemo() assert.Error(t, err) fmt.Println(app.IntegrationName()) } func NewSocketSlackDemo() (*SocketSlack, error) { return nil, errors.New("fake") }
Changes in code based on feedback above: c472d4d
MOD extend bots and sinks with errorMsg
madebyrogal
force-pushed
the
implement-heartbeat-reporting
branch
from
July 9, 2024 08:26
dea8ebe
to
8466704
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MOD extend bots and sinks with errorMsg
Description
Changes proposed in this pull request:
Testing
Related issue(s)
https://github.com/kubeshop/botkube-cloud/issues/142
https://github.com/kubeshop/botkube-cloud/pull/1189