Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add apiv4 bundle id support to deploy-target #695
Conversation
hatched
added some commits
Feb 17, 2015
To QA
|
|
Test FAILed. |
|
Spurious failure, running manually. |
|
|
|
Passed when ran manually http://ci.jujugui.org:8080/job/juju-gui/2373/ |
jaycee
reviewed
Feb 17, 2015
| + deploying a bundle via the deployer. | ||
| + | ||
| + @method getBundleYAML | ||
| + @param {String} id Bundle id in apiv4 format. |
jaycee
Feb 17, 2015
Member
I might make it clear we're talking charmstore here, e.g. ... id in v4 charmstore api format.
jaycee
reviewed
Feb 17, 2015
| + @param {Function} failureCallback The failure callback. | ||
| + @param {Array} bundle An array containing the requested bundle model. | ||
| + */ | ||
| + _getBundleYAMLResponse: function(successCallback, failureCallback, bundle) { |
jaycee
Feb 17, 2015
Member
Aren't callbacks usually the last arguments, except maybe context/scope? This reads weirdly to me. I feel like it should be _getBundleYAMLResponse: function(bundle, success, failure).
hatched
Feb 17, 2015
Owner
The arguments which are passed to a bound function are passed first to the function, the function is essentially being curried. This is why when getEntity calls the _getBundleYAMLResponse method the arguments it passes to it get appended after the two callbacks.
jaycee
reviewed
Feb 17, 2015
| + getBundleYAML: function(id, successCallback, failureCallback) { | ||
| + this.getEntity( | ||
| + id, this._getBundleYAMLResponse.bind( | ||
| + this, successCallback, failureCallback), failureCallback); |
jaycee
Feb 17, 2015
Member
I'm not sure this call is right, based on the def below. It looks like your passing in context first, the callbacks, and no bundle at all to the .bind call on _getBundleYAMLResponse. Am I misreading this?
hatched
Feb 17, 2015
Owner
bind returns a function which executes in the context of the object passed as the first argument. The call signature is bind(context, [arg [, arg[, ...])
|
|
|
Thanks for the reviews! |
|
Status: merge request accepted. Url: http://ci.jujugui.org:8080/job/juju-gui-merge |
hatched commentedFeb 17, 2015
The jujucharms.com website allows users to "add to demo" bundles to play around with. It has had to guess at the apiv3 bundle id for some time now which has caused a number of bugs. This adds apiv4 bundle support to the GUI's deploy-target handler so that jujucharms.com can now use the apiv4 bundle id's.