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

POC: Auto generation of troubleshooting guide #1223

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

doodlesbykumbi
Copy link
Contributor

@doodlesbykumbi doodlesbykumbi commented May 6, 2020

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.

}

// proxyGet is a convenience method that makes an HTTP GET request using a proxy
func proxyGet(endpoint, proxy string) (*http.Response, error) {
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

Choose a reason for hiding this comment

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

Trailing spaces

@codeclimate
Copy link

codeclimate bot commented May 6, 2020

Code Climate has analyzed commit 35afd41 and detected 63 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2
Style 61

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant