-
Notifications
You must be signed in to change notification settings - Fork 6
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
Orca 845 #89
Orca 845 #89
Conversation
wsChans map[string]map[chan string]bool | ||
chanLock sync.RWMutex | ||
WebsocketHandler WebsocketHandler | ||
WebsocketResponseWriter WebsocketResponseWriter |
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.
You don't need this.
server/server.go
Outdated
@@ -616,6 +624,18 @@ func NewServer(userConfig UserConfig, config Config) (*Server, error) { | |||
DB: boltdb, | |||
DeleteLockCommand: deleteLockCommand, | |||
} | |||
var websocketHandler controllers.WebsocketHandler |
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.
You're declaring a variable that is interface of type controllers.WebsocketHandler
, but there is no assignment that implements this interface. Otherwise you're just passing nil
pointers around.
You need to declare create a struct that implements controllers.WebsocketHandler
interface. The struct itself is just a delegate Upgrade
method to instance of websocket.Upgrader{}
. Something like this:
type DefaultWebsocketHandler struct {
handler websocket.Upgrader
}
func NewWebsocketHandler() WebsocketHandler {
return &DefaultWebsocketHandler{
handler: websocket.Upgrader{},
}
}
func (wh *DefaultWebsocketHandler) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (WebsocketResponseWriter, error) {
return wh.handler.Upgrade(w, r, responseHeader)
}
ctx := models.ProjectCommandContext{ | ||
Log: logging.NewNoopLogger(t), |
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.
you don't need to change these
As we discussed we should refactor our logic around how we are sending log streaming to the controller. Right now we are passing in the Let's create an interface called
To implement the interface let's create a struct
|
"project": "test-project", | ||
} | ||
ctx := context.Background() | ||
ctx = context.WithValue(ctx, int(0), params) |
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.
True removing line 33 and 34. I don't think we need them anymore.
err = j.LogStreamErrorTemplate.Execute(w, err) | ||
if err != nil { |
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.
err = j.LogStreamErrorTemplate.Execute(w, err) | |
if err != nil { | |
if err := j.LogStreamErrorTemplate.Execute(w, err); err != nil { |
* Current progress * Websocket implementation * Fixing routes * Adding url * Fixed websocket connection * Progress 7/9 * Added some channel logic * Changes to models.go * Working on log streaming for plan * Beginning tests/Having errors * Log Streaming Logic * fixed test * Added Testing * Fixed websocket connection * Async implementation and test error fixes * Changes to variables in tests * Debugging * Fixed UI in webpage terminal * Fixing Run make-test coverage * Fixing tests * Testing * Deleted txt.act files * Fixing broken tests * Changes to terraform_client testing * Fixed tests in terraform_client_internal_test.go * Fixed failing test * Deleted lines causing test to fail * Reformating * More Reformatting * Run make check-lint corrections * Added error check * Fixing check-lint test * Suggested changes prior to merge Co-authored-by: Isata Sankoh <[email protected]>
* Current progress * Websocket implementation * Fixing routes * Adding url * Fixed websocket connection * Progress 7/9 * Added some channel logic * Changes to models.go * Working on log streaming for plan * Beginning tests/Having errors * Log Streaming Logic * fixed test * Added Testing * Fixed websocket connection * Async implementation and test error fixes * Changes to variables in tests * Debugging * Fixed UI in webpage terminal * Fixing Run make-test coverage * Fixing tests * Testing * Deleted txt.act files * Fixing broken tests * Changes to terraform_client testing * Fixed tests in terraform_client_internal_test.go * Fixed failing test * Deleted lines causing test to fail * Reformating * More Reformatting * Run make check-lint corrections * Added error check * Fixing check-lint test * Suggested changes prior to merge Co-authored-by: Isata Sankoh <[email protected]>
No description provided.