-
Notifications
You must be signed in to change notification settings - Fork 21
feat: refactor to use bluemix object to specify services #372
Conversation
app/index.js
Outdated
@@ -61,11 +61,42 @@ module.exports = Generator.extend({ | |||
}) | |||
}, | |||
|
|||
_isTrue: function (value) { | |||
return (value === true || value === 'true') | |||
}, |
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.
make this a local function, we only use it in initSpec
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.
done
app/index.js
Outdated
@@ -490,7 +532,7 @@ module.exports = Generator.extend({ | |||
// NOTE(tunniclm): no need to do anything for memory it is the default | |||
// if no crudservice is passed to the refresh generator | |||
if (answer.store === 'Cloudant') { | |||
this._addService('cloudant', { name: 'crudDataStore' }) | |||
this._addService('cloudant', 'crudDataStore', true) |
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.
remove , true
it is ignored
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.
done
app/index.js
Outdated
}) | ||
}, | ||
|
||
promptConfigureWatsonConversation: function () { | ||
if (this.skipPrompting) return | ||
if (!this.servicesToConfigure) return | ||
if (!this.servicesToConfigure.watsonconversation) return | ||
|
||
this.log() |
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.
please add this log back for consistency of presentation
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.
done
test/unit/app.js
Outdated
@@ -1277,7 +1270,7 @@ describe('Unit tests for swiftserver:app', function () { | |||
appType: 'scaffold', | |||
appName: applicationName, | |||
capabilities: [], | |||
services: { objectstorage: {} } | |||
services: { objectStorage: {} } |
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.
doesn't actually test the key objectStorage
exists unless we put something real in the value (not the empty object)
Boilerplate code for creating a client object for the Kitura-redis API is included inside `Sources/Application/Application.swift` as an `internal` variable available for use anywhere in the `Application` module. | ||
|
||
The connection details for this client are loaded by the [configuration](#configuration) code and stored in a `struct` for easy access when creating connections to Redis. | ||
<% } -%> | ||
<% } -%> | ||
|
||
### Configuration | ||
Your application configuration information is stored in the `config.json` in the project root directory. This file is in the `.gitignore` to prevent sensitive information from being stored in git. |
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 whole section is out of date and we should remember to create an issue to fix it.
test/unit/app.js
Outdated
@@ -1427,7 +1420,7 @@ describe('Unit tests for swiftserver:app', function () { | |||
appType: 'scaffold', | |||
appName: applicationName, | |||
capabilities: [], | |||
services: { watsonconversation: {} } | |||
services: { conversation: {} } |
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.
doesn't actually test the key conversation
exists unless we put something real in the value (not the empty object)
test/unit/app.js
Outdated
@@ -1501,7 +1494,7 @@ describe('Unit tests for swiftserver:app', function () { | |||
appType: 'scaffold', | |||
appName: applicationName, | |||
capabilities: [], | |||
services: { alertnotification: {} } | |||
services: { alertNotification: {} } |
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.
doesn't actually test the key alertNotification
exists unless we put something real in the value (not the empty object)
test/unit/refresh.js
Outdated
objectstorage: [{}] | ||
bluemix: { | ||
backendPlatform: 'SWIFT', | ||
objectStorage: [{ serviceInfo: {} }] |
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.
doesn't actually test the key serviceInfo
exists unless we put something real in the value (not the empty object)
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.
not sure if this checks whether objectStorage
exists or not...
Codecov Report
@@ Coverage Diff @@
## develop #372 +/- ##
===========================================
- Coverage 89.66% 89.26% -0.41%
===========================================
Files 9 9
Lines 1268 1276 +8
===========================================
+ Hits 1137 1139 +2
- Misses 131 137 +6
Continue to review full report at Codecov.
|
8d02a09
to
134ebd1
Compare
Release 4.2.0 ### Bug Fixes * **package:** update generator-ibm-service-enablement to version 0.1.0 ([2948e7d](2948e7d)), closes [#371](#371) * add url to Push Notifications service ([#379](#379)) ([9660ec7](9660ec7)) * PR title and message are properly generated ([#382](#382)) ([f2ba505](f2ba505)) * **package:** update generator-ibm-service-enablement to version 0.6.1 ([#391](#391)) ([a0bd2e5](a0bd2e5)) ### Features * refactor to use bluemix object to specify services ([#372](#372)) ([ebe6149](ebe6149))
Two dependencies of the project (generator-ibm-service-enablement and generator-ibm-cloud-enablement) use a different "bluemix" object to specify the cloud properties than we were using previously in this generator.
When we shifted to using these dependencies for generating cloud related content we kept our original format for specifying services intact to reduce the churn and risk associated with the refactor.
The time has come to address that technical debt and update the generators to use the bluemix object everywhere and remove the legacy format and associated conversion code.