-
Notifications
You must be signed in to change notification settings - Fork 94
Update go-swagger libraries to the latest version and update to go modules #149
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
Conversation
Same error as #147, but with the new toolchain. |
This is the last working version of autorest with the new swagger client libs. See: - https://github.com/Azure/go-autorest/blob/1f7cd6cfe0adea687ad44a512dfe76140f804318/autorest/retriablerequest.go - https://github.com/Azure/go-autorest/blob/1f7cd6cfe0adea687ad44a512dfe76140f804318/autorest/retriablerequest_1.8.go - https://github.com/Azure/go-autorest/blob/master/CHANGELOG.md#v810 - https://godoc.org/github.com/Azure/go-autorest/autorest#RetriableRequest -
What's left now is to write some retriable tests with a body. |
Ok, end of the day here for me, for tomorrow, I think its the interaction between:
|
Adding a replay test with the pinned version of autorest seems to work, so thats promising. |
The docs changes here are still a wip. |
This reproduces the no-consumer error seen in failing buildbot errors. Since we updated the go-swagger libraries, this is no longer causes requests to fail. Closes #122 Closes https://github.com/netlify/buildbot/issues/362
Added a test to confirm we no longer will get the no-consumer error when we get an unexpected content type. |
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.
LGTM
This PR turned into a mess. It does a few things:
Fix the missing consumer errors
The go-swagger runtime crashed on plain/html content types. This was causing problems in the buildbot, so the first step to address that was to update the go-swagger runtime libs to get the following fix:
Update go-swagger to
v0.18.0
from94927f8c9742791a9aa46c6c3965f0a37025f41d
Fix the failing tests
After updating the go-swagger libraries, this test started failing:
open-api/go/porcelain/http/http_test.go
Lines 146 to 179 in 6aaaf6f
The error was the following:
This comes from deep within the http request client, and happens when the body exceeds the content length of the req.ContentLength property.
https://github.com/golang/go/blob/61170f85e62f1326d42c4dbd8aa17ab4a1305a87/src/net/http/transfer.go#L387-L389
Rolling back to
[email protected]
from[email protected]
makes the test pass again, but we should really confirm retry's with a body work.Whats happening is:
rr.req.GetBody()
https://github.com/Azure/go-autorest/blob/1f7cd6cfe0adea687ad44a512dfe76140f804318/autorest/retriablerequest_1.8.go#L47-L53
req
object for some reason. I haven't dug into why that is yet.https://github.com/go-openapi/runtime/blob/9c75b2b632f58f9cb20e0767a724d5ebc37c2047/client/request.go#L209-L220
https://github.com/go-openapi/runtime/blob/94927f8c9742791a9aa46c6c3965f0a37025f41d/client/request.go#L249-L254
https://github.com/Azure/go-autorest/blob/1f7cd6cfe0adea687ad44a512dfe76140f804318/autorest/retriablerequest_1.7.go
https://github.com/Azure/go-autorest/blob/1f7cd6cfe0adea687ad44a512dfe76140f804318/autorest/retriablerequest.go
Port over to go-modules
I simultaneously tried to move the go module over to its own repo https://github.com/netlify/go-client/tree/open-api but that is still being discussed: netlify/go-client#17
I wanted to get that work out asap since the buildbot is already on go-modules, so I ported that work into this PR.
Add test to cover
no consumer
errorsAdd a tests to verify the client doesn't error out when it receives an html or text response.
Closes #122
Closes netlify/buildbot#362