-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CHE-4097: Refactor go agents package structure #4344
Conversation
Also add comments and cleanup code. Signed-off-by: Alexander Garagatyi <[email protected]>
@@ -0,0 +1,2 @@ | |||
src/main/go/exec-agent/exec-agent |
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.
Are you sure that you should add this to gitignore?
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.
This is executable of go program. It may be created in development if user manually builds go sources.
Is something wrong with this exclusion?
Build finished. Please check console output at $BUILD_URL to view the results. |
Build # 2128 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2128/ to view the results. |
// Checks on workspace master if provided by request token is valid and calls ServerHTTP on delegate. | ||
// Otherwise if UnauthorizedHandler is configured calls ServerHTTP on it. | ||
// If it is not configured returns 401 with appropriate error message. | ||
type Handler struct { |
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.
What if we change it to an internal implementation of http.Handler
which can be created by constructing functions like
func NewHandler(endpont, delegate, unauthorizedHandler) http.Handler { ... };
func NewCachingHandler(endpont, delegate, unauthorizedHandler, cache) http.Handler { ... }
or event handler builder.
So you can be sure that all the data required for handler is provided + you're be able to pick one of caching or non-caching handler and avoid checks like handler.Cache != nil
in runtime.
Signed-off-by: Alexander Garagatyi <[email protected]>
@evoevodin I added improvements you've asked |
Thx, it looks good to me! |
could we ensure golint is not reporting any errors on go source code ? |
|
This PR was merged before you commented. So now I can't add fixes until next PR in this area. |
Build finished. |
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/2144/ |
Also add comments and cleanup code. Signed-off-by: Alexander Garagatyi <[email protected]>
What does this PR do?
Refactor terminal+exec agent to separate common components. This allows to reuse them for creation of install agent and separation of terminal and exec agents.
What issues does this PR fix or reference?
Fixes #4097
Changelog
Refactor golang agents for re-usage of components for creation of other agents.
Release Notes
Not needed, this PR is technical debt and doesn't change anything from user POV.
Docs PR