Skip to content
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

fix: default alert rule not being read #151

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

joaomper-TE
Copy link
Contributor

@joaomper-TE joaomper-TE commented Dec 6, 2023

This fixes #111 .

It seems to conflict with the fix that was done here for #73. However, was trying out the scenarios from #73 locally:

  • Create test with alerts_enabled set to true and without specifying any alert rule
  • Create test with alerts_enabled set to false and with 2 alert rules, one of them being a default alert rule
  • Remove one of the alert rules from a test which had 2 alert rules

and both Terraform plan/apply, as well as subsequent terraform plans, ran ok (and the subsequent terraform plans showed no changes).

@raul-te not sure if you have any objection or know anything else that I should further test before merging this. Because it does seems that filtering out the Default Alert Rules is no longer needed...

NOTE: We do need some tests for this repo though, as we should have more visibility when fixing something do make sure that we don't introduce any regression.

@joaomper-TE joaomper-TE requested a review from a team December 6, 2023 12:58
@joaomper-TE joaomper-TE marked this pull request as ready for review December 6, 2023 12:59
shahid-te
shahid-te previously approved these changes Dec 6, 2023
phpinhei-te
phpinhei-te previously approved these changes Dec 7, 2023
thousandeyes/util.go Outdated Show resolved Hide resolved
brumarqu-te
brumarqu-te previously approved these changes Dec 7, 2023
@@ -25,3 +25,13 @@ jobs:
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate' command and commit."; exit 1)

unit:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we had some UTs but we were not running them 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed now:
image

@@ -53,68 +53,6 @@ func expandAlertRules(alertRules *[]thousandeyes.AlertRule) *[]thousandeyes.Aler
return ret
}

func expandBGPMonitors(v interface{}) thousandeyes.BGPMonitors {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ununsed methods

output, err = FixReadValues(testsInput, "tests")
if err != nil {
t.Errorf("tests input returned error: %s", err.Error())
}
if output != nil {
if reflect.DeepEqual(output, testsTarget) != true {
Copy link
Contributor Author

@joaomper-TE joaomper-TE Dec 7, 2023

Choose a reason for hiding this comment

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

Just fixing this, nothing changed as part of this PR. This was breaking for a long time already. For the tests we do nothing, so the output should be the same as the input

@joaomper-TE joaomper-TE merged commit cc4cb04 into thousandeyes:main Dec 12, 2023
2 checks passed
@joaomper-TE joaomper-TE deleted the bug-default-alert-rule branch December 12, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

two alerts for one tests state is not persisting
5 participants