Merge lp:~gary/juju-gui/fixSandboxDeployRace into lp:juju-gui/experimental
Proposed by
Gary Poster
Status: | Merged |
---|---|
Merged at revision: | 1191 |
Proposed branch: | lp:~gary/juju-gui/fixSandboxDeployRace |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
118 lines (+38/-29) 2 files modified
app/store/env/fakebackend.js (+21/-29) test/test_fakebackend.js (+17/-0) |
To merge this branch: | bzr merge lp:~gary/juju-gui/fixSandboxDeployRace |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+194581@code.launchpad.net |
Description of the change
Remove a race condition from sandbox deployment
Deploying to the sandbox will sometimes mis-position services, especially when you have a large bundle. I believe the cause is the race condition that this branch fixes.
I also simplified some code that I thought was confusing.
To QA, try deploying some big bundles. At the very least, it shouldn't be worse than it was before. If we're lucky, you'll see that the position is always right for the deployed bundles in the sandbox.
To post a comment you must log in.
Reviewers: mp+194581_ code.launchpad. net,
Message:
Please take a look.
Description:
Remove a race condition from sandbox deployment
Deploying to the sandbox will sometimes mis-position services,
especially when you have a large bundle. I believe the cause is the race
condition that this branch fixes.
I also simplified some code that I thought was confusing.
To QA, try deploying some big bundles. At the very least, it shouldn't
be worse than it was before. If we're lucky, you'll see that the
position is always right for the deployed bundles in the sandbox.
Contact me if you'd like some big bundles.
https:/ /code.launchpad .net/~gary/ juju-gui/ fixSandboxDeplo yRace/+ merge/194581
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/23800044/
Affected files (+40, -29 lines): store/env/ fakebackend. js test_fakebacken d.js
[revision details]
app/
test/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: test/test_ fakebackend. js fakebackend. js' fakebackend. js 2013-11-01 23:04:50 +0000 fakebackend. js 2013-11-08 18:57:35 +0000 deploy( 'cs:precise/ wordpress- 15', callback, options); db.services. getById( 'wordpress' ); annotations, get('annotation s') nextAnnotations (); deepEqual( changes. services, {wordpress: service});
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -337,6 +337,23 @@
' auto_id: %n\n' +
' ^');
});
+
+ it('honors annotations', function() {
+ var options = {
+ annotations: {
+ 'gui-x': '-3',
+ 'gui-y': '5'
+ }
+ };
+ fakebackend.
+ var service = fakebackend.
+ assert.deepEqual(
+ options.
+ service.
+ );
+ var changes = fakebackend.
+ assert.
+ });
});
describe( 'FakeBackend. setCharm' , function() {
Index: app/store/ env/fakebackend .js env/fakebackend .js' env/fakebackend .js 2013-11-01 23:04:50 +0000 env/fakebackend .js 2013-11-08 18:57:35 +0000
constraints = options. constraints;
=== modified file 'app/store/
--- app/store/
+++ app/store/
@@ -409,6 +409,8 @@
}
+ var annotations = options.annotations || {};
constraintsM ap = constraints;
+
// In order for the constraints to support the python back end this
// needs to be an array, so we are converting it back to an object
// here so that the GUI displays it properly.
@@ -425,6 +427,17 @@
}
+ // We need to set charm default values for the options that have not 'options' ) || {}; keys(charmOptio ns).forEach( function( key) {
+ // been explicitly provided.
+ var charmOptions = charm.get(
+ // "config" will hold the service's config values--it will be the
+ // result of this processing.
+ var config = {};
+ var explicitConfig = options.config || {};
+ Object.
+ config[key] = explicitConfig[key] || charmOptions[k...