Merge lp://staging/~gary/juju-gui/socket_url_revisited into lp://staging/juju-gui/experimental

Proposed by Gary Poster
Status: Merged
Merged at revision: 431
Proposed branch: lp://staging/~gary/juju-gui/socket_url_revisited
Merge into: lp://staging/juju-gui/experimental
Diff against target: 215 lines (+124/-19)
5 files modified
app/app.js (+17/-1)
app/config-debug.js (+6/-0)
app/config-prod.js (+6/-0)
app/index.html (+0/-12)
test/test_app.js (+95/-6)
To merge this branch: bzr merge lp://staging/~gary/juju-gui/socket_url_revisited
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+153202@code.staging.launchpad.net

Description of the change

Prefer socket_port and socket_protocol

In order to allow the charm to be backwards compatible, change the websocket url code to prefer socket_port and/or socket_protocol if they are also provided with socket_url in the configuration. Added tests. Moved pertinent code from index.html to app because it was easier to test there.

https://codereview.appspot.com/7703047/

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Reviewers: mp+153202_code.launchpad.net,

Message:
Please take a look.

Description:
Prefer socket_port and socket_protocol

In order to allow the charm to be backwards compatible, change the
websocket url code to prefer socket_port and/or socket_protocol if they
are also provided with socket_url in the configuration. Added tests.
Moved pertinent code from index.html to app because it was easier to
test there.

https://code.launchpad.net/~gary/juju-gui/socket_url_revisited/+merge/153202

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/7703047/

Affected files:
   A [revision details]
   M app/app.js
   M app/config-debug.js
   M app/config-prod.js
   M app/index.html
   M test/test_app.js

Revision history for this message
Benjamin Saller (bcsaller) wrote :
Revision history for this message
Brad Crittenden (bac) wrote :

LGTM -- one tiny change.

https://codereview.appspot.com/7703047/diff/1/app/app.js
File app/app.js (right):

https://codereview.appspot.com/7703047/diff/1/app/app.js#newcode276
app/app.js:276: socket_protocol = this.get('socket_protocol');
Don't we prefer 'one var per declaration'?

https://codereview.appspot.com/7703047/diff/1/test/test_app.js
File test/test_app.js (right):

https://codereview.appspot.com/7703047/diff/1/test/test_app.js#newcode472
test/test_app.js:472: });
These tests are clean and thorough. Thanks.

https://codereview.appspot.com/7703047/

Revision history for this message
Jeff Pihach (hatch) wrote :

LGTM Thanks for doing this :-) one trivial and one question.

https://codereview.appspot.com/7703047/diff/1/app/app.js
File app/app.js (right):

https://codereview.appspot.com/7703047/diff/1/app/app.js#newcode276
app/app.js:276: socket_protocol = this.get('socket_protocol');
Should these not be camelCased?

https://codereview.appspot.com/7703047/diff/1/app/app.js#newcode281
app/app.js:281: socket_protocol = socket_protocol || 'ws';
I wonder if we shouldn't default this to 'wss' instead of 'ws' thoughts?

https://codereview.appspot.com/7703047/

Revision history for this message
Gary Poster (gary) wrote :

*** Submitted:

Prefer socket_port and socket_protocol

In order to allow the charm to be backwards compatible, change the
websocket url code to prefer socket_port and/or socket_protocol if they
are also provided with socket_url in the configuration. Added tests.
Moved pertinent code from index.html to app because it was easier to
test there.

R=bcsaller, bac, jeff.pihach
CC=
https://codereview.appspot.com/7703047

https://codereview.appspot.com/7703047/diff/1/app/app.js
File app/app.js (right):

https://codereview.appspot.com/7703047/diff/1/app/app.js#newcode276
app/app.js:276: socket_protocol = this.get('socket_protocol');
On 2013/03/13 17:41:15, bac wrote:
> Don't we prefer 'one var per declaration'?

Done.

https://codereview.appspot.com/7703047/diff/1/app/app.js#newcode276
app/app.js:276: socket_protocol = this.get('socket_protocol');
On 2013/03/13 17:47:43, jeff.pihach wrote:
> Should these not be camelCased?

Done.

https://codereview.appspot.com/7703047/diff/1/app/app.js#newcode281
app/app.js:281: socket_protocol = socket_protocol || 'ws';
On 2013/03/13 17:47:43, jeff.pihach wrote:
> I wonder if we shouldn't default this to 'wss' instead of 'ws'
thoughts?

I thought and then agreed. :-) Done.

https://codereview.appspot.com/7703047/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches