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

Feature/advanced error handling #294

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

artemlive
Copy link
Contributor

@artemlive artemlive commented Nov 2, 2020

Here is the issue with the detailed description of this improvement: #293

…stem and pingdom monitor with method that prevents duplicated check creation
@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 1 has Failed!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 2 has Failed!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 3 has Failed!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 4 has Failed!

@artemlive artemlive marked this pull request as draft November 3, 2020 07:54
@artemlive artemlive marked this pull request as ready for review November 3, 2020 16:28
@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 5 has Failed!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 6 has Failed!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 7 has Failed!

@artemlive
Copy link
Contributor Author

artemlive commented Nov 3, 2020

Strange thing, because all tests have been passed locally.

time make test &> /dev/null; echo $?

real 0m42.501s
user 0m35.419s
sys 0m8.937s
0

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 8 has Failed!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 9 has Failed!

@artemlive
Copy link
Contributor Author

Linter, tests, and builds are fine
I see the mistake in Makefile in the verify section. At least in my local env, it doesn't work because the project doesn't have "test" directory. All other stuff is the same and it works locally. Could someone tell me what exact problem with the last build and why Jenkins build has been failed. Thank you!

@stakater-user
Copy link
Contributor

@artemlive Yikes! You better fix it before anyone else finds out! Build 10 has Failed!

@ahmedwaleedmalik
Copy link
Contributor

Hi @artemlive, everything was fine but the test cases were failing against a different provider. I am looking into it and hopefully will resolve that today.
In future, we will move to github actions so that anyone can view the pipeline and there is no inconvenience of such sorts. I'll try to get this prioritized !

Copy link
Contributor

@ahmedwaleedmalik ahmedwaleedmalik left a comment

Choose a reason for hiding this comment

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

Hi, please merge the latest master in your branch. Also, there are a fw issues with the PR:

  • You have replaced errors with logs at a lot of places which i don't get it that why is it required
  • For test cases, remove the provider == nil check since that is something i have already handled and we don't want an error in there.

Comment on lines +120 to +124
monitor, err := findMonitorByName(r.monitorServices[index], monitorName)
// if there was some error while getting a monitor, re-queue it to try on the next reconcile iteration
if err != nil {
return reconcile.Result{RequeueAfter: RequeueTime}, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's unable to create a monitor this will be an endless re-conciliation loop !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if it was only the API call error? E.g. API has returned 500 code, and we would be able to add this monitor on the next iteration?

Comment on lines 128 to 131
if err != nil {
log.Errorf("Error while handling update: %s", err)
return reconcile.Result{RequeueAfter: RequeueTime}, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines 140 to 143
if err != nil {
log.Errorf("Error while handling create: %s", err)
return reconcile.Result{RequeueAfter: RequeueTime}, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I'll fix that.

Comment on lines +194 to +195
log.Printf("Application Insights WebTest %s was not found in Resource Group %s", monitorName, aiService.resourceGroup)
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this error from here ?

Comment on lines +64 to +65
log.Printf("There is no gcloud MonitorService with name %s found.", name)
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this error from here ?

Comment on lines +63 to +64
log.Printf("There is no PingdomMonitorService with name %s found.", name)
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this error from here ?

Comment on lines +204 to +205
log.Printf("There is no StatusCakeMonitorService with name %s found.", name)
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this error from here ?

@stakater-user
Copy link
Contributor

@artemlive Image is available for testing. docker pull stakater/ingressmonitorcontroller:SNAPSHOT-PR-294-12

@rasheedamir
Copy link
Member

@artemlive can you plz resolve the conflicts and lets get this merged?

@rasheedamir
Copy link
Member

@artemlive any plans to update this PR?

@tomjohnburton
Copy link

Any update on this?? Would be great to have

@@ -82,6 +84,26 @@ func (service *PingdomMonitorService) GetAll() []models.Monitor {
return monitors
}

// Function that gets all monitors with an error handling to avoid duplicate checks creation
func (service *PingdomMonitorService) GetAllWithAPIErrorHandler() ([]models.Monitor, error) {
Copy link

@namm2 namm2 Aug 24, 2021

Choose a reason for hiding this comment

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

I don't know how this function can avoid duplication compared with the existing GetAll() one?

@mmiller1
Copy link

I'm glad I found this PR, I was about to start working on something similar. Any chance this will make progress soon?

@bilby91
Copy link

bilby91 commented Mar 25, 2022

Is there any ETA for merging this PR and releasing a new version?

Thanks!

@julien-michaud
Copy link

Hello, we also would like this PR to be merged, thanks for your help !

@artemlive
Copy link
Contributor Author

Hello, folks! I'm sorry for being gone so long. I'll review all the code and fix the conflicts as soon as possible.

@karl-johan-grahn
Copy link
Contributor

@artemlive have you had time to look at this again?

@davidgibbons
Copy link

@artemlive Any chance you'll get time to actually look at this soon?

@andreas-mueller-bb
Copy link

@artemlive I would also be very curious if there is any update to this matter? :)

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.