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

Fixmie should not fail on temporary 5xx errors returned by the Github API #11

Open
gbbr opened this issue May 16, 2019 · 15 comments
Open
Labels
bug Something isn't working

Comments

@gbbr
Copy link

gbbr commented May 16, 2019

Please check out DataDog/dd-trace-go#438

@welcome
Copy link

welcome bot commented May 16, 2019

Thank you for creating the issue! We'll get back to you shortly with additional information.

@fatih
Copy link
Member

fatih commented May 16, 2019

I just checked the logs on my end and saw this:

couldn't process event [error=couldn't apply comments: failed removing old suggestions: 1 error occurred: * DELETE https://api.github.com/repos/DataDog/dd-trace-go/pulls/comments/284269129: 404 Not Found [] ]

Did you applied the suggestion directly? Was there anything else you did differently? Seems like there is a race condition. I fetched the existing comments, Fixmie saw that one of the comments is invalidated, hence it tried to delete them, but then it tried to delete the PR comment it was gone at that point. Not sure why that was caused.

@gbbr
Copy link
Author

gbbr commented May 17, 2019

Thanks for looking into this @fatih, I asked the contributor to try and answer your question.

FWIW it happened again today, here: DataDog/dd-trace-go#440. This was one of my own PRs and I haven't had any suggestions from the bot, it simply showed failure.

@fatih
Copy link
Member

fatih commented May 17, 2019

The latest issue is because of this:

"[ERRO] couldn't process event  [error=couldn't download pull request files: 1 error occurred:
	* couldn't download pull request file: GET https://api.github.com/repos/DataDog/dd-trace-go/contents/ddtrace/tracer?ref=02fae9631226d22cbddc68a99f6a0892bf729d13: 401 Bad credentials []

This is the first time I see this though. Fixmie is a GH application, hence it doesn't store any credentials. It creates a client based on the incoming installation and app id, which is verified and signed by GitHub.

@CAFxX
Copy link

CAFxX commented May 17, 2019

I just checked the logs on my end and saw this:

couldn't process event [error=couldn't apply comments: failed removing old suggestions: 1 error occurred: * DELETE https://api.github.com/repos/DataDog/dd-trace-go/pulls/comments/284269129: 404 Not Found [] ]

Did you applied the suggestion directly? Was there anything else you did differently? Seems like there is a race condition. I fetched the existing comments, Fixmie saw that one of the comments is invalidated, hence it tried to delete them, but then it tried to delete the PR comment it was gone at that point. Not sure why that was caused.

This was my first PR in this repo, and the first time I heard about fixmie. A few moments after opening the PR the comment from fixmie appeared, including a code suggestion. As the suggestion was trivial (whitespace change) I almost immediately clicked on apply suggestion. I did not do anything else.

@fatih
Copy link
Member

fatih commented May 17, 2019

I see, thanks @CAFxX for the feedback. I think immediately is the key here. There is a possible race condition on my side where things can happen between fetching comments and applying them. I'm going to look into it, let's keep this up meanwhile.

@fatih fatih added the bug Something isn't working label May 17, 2019
@gbbr
Copy link
Author

gbbr commented May 21, 2019

Another one happened here: DataDog/dd-trace-go#442

Screen Shot 2019-05-21 at 1 51 01 PM

It might go away by the time you check though, as I'm actively committing to this PR.

Hope this helps in some way :-/ Maybe these are cases that are worthy of a retry before erroring out?

@fatih
Copy link
Member

fatih commented Jun 20, 2019

I've added couple of improvements and when this happens again, I'm going to have more insight on what's wrong. I know this happened but I don't have any logs unfortunately for these events. Please just let me know if this happens again. Next time, you'll also going to see a code next to the email address, which will help me to see what went wrong.

@gbbr
Copy link
Author

gbbr commented Jun 21, 2019

Sure. Thanks! I can update this issue if it happens again.

@gbbr
Copy link
Author

gbbr commented Jun 25, 2019

Here's one more in DataDog/dd-trace-go#462

Screen Shot 2019-06-25 at 10 42 00 AM

@fatih
Copy link
Member

fatih commented Jun 25, 2019

Thanks Gabriel. Just checked the logs and all I see is this:

POST https://api.github.com/repos/DataDog/dd-trace-go/statuses/024cbbfc5c9e5c89bfa06e72fdb4086d04a9d055: 500

I think there was a hiccup in the GitHub API. In overall most of these failures are due GitHub API timeouts or failures. I'll make sure to handle all these in a better way and only return a failure if it makes sense. I think showing "Failure" as a status is not much useful for the end user.

@gbbr
Copy link
Author

gbbr commented Jun 25, 2019

Thanks Faith! One suggestion would be to retry 5xx errors up to a specific timeout. I will stop reporting these until I hear updates on the issue. Happy to help test further :) I think Fixmie does saves some review time which is great, so we'll continue using it on this repo. I'll update the issue title too to be more specific, but feel free to edit it to whatever makes more sense to you.

@gbbr gbbr changed the title Fixmie flake? Fixmie should not fail on temporary 5xx errors returned by the Github API Jun 25, 2019
@gbbr
Copy link
Author

gbbr commented Jul 17, 2019

Got another one here: DataDog/dd-trace-go#472. Would be interesting to add a link to a retry button.

I'm uninstalling it for now, it fails too often, but happy to add it back once this issue is fixed, or at least a "retry" button is added.

@fatih
Copy link
Member

fatih commented Jul 17, 2019

@gbbr thanks! Seems like this is a go list issue :/

go [list -e -json -compiled=true -test=true -export=false -deps=true -find=false -- github.com/DataDog/dd-trace-go/ddtrace/tracer]: exit status 1: go tool cgo: exit status 2  fatal error: runtime: out of memory  

I'm trying to reduce the memory footprint, but it's still not at a place where I like it. go/packages is still a new package with needs some love and performance improvements. Thanks again for reporting.

@fatih
Copy link
Member

fatih commented Jul 17, 2019

at least a "retry" button is added.

If you force push or add any new comment, fixmie will check the pull request again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants