-
Notifications
You must be signed in to change notification settings - Fork 41
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
POC: Auto generation of troubleshooting guide #1223
base: main
Are you sure you want to change the base?
Conversation
ef7fa7a
to
35afd41
Compare
} | ||
|
||
// proxyGet is a convenience method that makes an HTTP GET request using a proxy | ||
func proxyGet(endpoint, proxy string) (*http.Response, error) { |
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.
Identical blocks of code found in 2 locations. Consider refactoring.
@@ -0,0 +1,228 @@ | |||
package troubleshooting |
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.
Your code does not pass gofmt in 6 places. Go fmt your code!
@@ -0,0 +1,128 @@ | |||
package troubleshooting |
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.
Your code does not pass gofmt in 2 places. Go fmt your code!
* TCP_NODELAY set | ||
* Connected to 127.0.0.1 (127.0.0.1) port 62160 (#0) | ||
* Establish HTTP proxy tunnel to httpbin.org:443 | ||
> CONNECT httpbin.org:443 HTTP/1.1 |
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.
Trailing spaces
* Connected to 127.0.0.1 (127.0.0.1) port 62160 (#0) | ||
* Establish HTTP proxy tunnel to httpbin.org:443 | ||
> CONNECT httpbin.org:443 HTTP/1.1 | ||
> Host: httpbin.org:443 |
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.
Trailing spaces
Code Climate has analyzed commit 35afd41 and detected 63 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 48.4% (0.0% change). View more on Code Climate. |
Creating the proxy service in memory makes it very easy to have a troubleshooting generation as code approach. This commit provides an example using the HTTP connector. A similar approac h would work for other connectors. It manages to capture client output and relevant Secretless logs all in one fell swoop.
35afd41
to
8cbd67e
Compare
Creating the proxy service in memory makes it very easy to have a troubleshooting generation as code approach. This commit provides an example using the HTTP connector. A similar approach would work for other connectors. It manages to capture client output and relevant Secretless logs all in one fell swoop.
You'll note that
http_proxy_service.go
in the files changes is almost identical to a file you'll find in the MSSQL integration tests PR. This is because the logic to start proxy services is more or less the same and really should exist within some module in Secretless to make doing this easier. Especially if we have any intention of using this approach as a test harness.