-
Notifications
You must be signed in to change notification settings - Fork 63
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
GPII-2630: Implement the new GPII data model #591
Conversation
… fixing db data store tests.
…ests. In progress of fixing node tests.
…nd prefsSafes.json in the new data structure.
…abase port will be shared by not only the auth server, but also the preferences server.
…ce http endpoints with internal invokers for getting, creating and updating preferences.
…ferences set (POST to /preferences) with an invoker createPrefsSet().
…in progress of adding updatePreferences().
…of fixing node tests that use the prefs server.
…sted development environment locally.
… to include generated gpiiKeys.json and prefsSafes.json.
@cindyli - Further renaming point through from Gregg - throughout the code, "preferences set" should be globally replaced by "preference set" |
…d "preferences set" to "preference set".
… npm postinstall script as well as adding code comments as per code review suggestions.
…he cloud URL to untrusted local flow managers.
… in with vladimir on windows VM.
CI job passed: https://ci.gpii.net/job/universal-tests/846/ |
@amb26, @simonbates, all review comments have been addressed. Also tested this branch with gpii/windows repo using its windows VM in these aspects:
All above works well. Let me know if I missed anything. This pull request is ready for more reviews. |
CI job failed: https://ci.gpii.net/job/universal-tests/847/ |
ok to test |
CI job passed: https://ci.gpii.net/job/universal-tests/848/ |
|
||
var fluid = require("infusion"); | ||
|
||
fluid.module.register("gpii-db-operation", __dirname, require); |
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.
I meant by the rename for the entire module to be renamed - the main purpose of the rename is for its name in package.json to be a valid npm module name. This directory, and the name in package.json should be renamed as well. We can retain the camel-casing in the individual file names.
isError: true | ||
}, | ||
missingDoc: { | ||
message: "The record of %docName is not found", |
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.
Why is this named "docName" when at all call sites it is actually sourced from a "docType"?
Also, the wording of the error is not terribly clear. Perhaps it should be something like "A record of type %docType was not found"?
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.
Bump this comment
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 has been addressed: https://github.com/cindyli/universal/blob/GPII-2630/gpii/node_modules/gpii-db-operation/src/DbConst.js#L39
Refresh browser?
isError: true | ||
}, | ||
mismatchedDocType: { | ||
message: "The document type must be \"%docType\"", |
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.
It would probably be helpful to specify what type was actually chosen by the user
* @param {Component} ontologyHandler - An instance of gpii.ontologyHandler component. | ||
* @param {Object} preferences - A preferences object. | ||
* @param {String} view - An view that the provided preferences is based upon. | ||
* @param {String} gpiiKey - (Optional) The GPII key to be created. |
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.
Optional params are signalled in JSDocs by putting the parameter name in square brackets - http://usejsdoc.org/tags-param.html#optional-parameters-and-default-values - although we tend to also retain the text [optional] for clarity in the description
|
||
if (data && data.doc && data.value) { | ||
result = {}; | ||
fluid.set(result, "oauth2ClientId", data.key); |
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.
Another clutch of unnecessary fluid.sets
|
||
if (data && data.doc && data.value) { | ||
result = {}; | ||
fluid.set(result, "accessToken", data.key); |
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.
Some more
CI job passed: https://ci.gpii.net/job/universal-tests/849/ |
@amb26, all comments have been addressed. Ready for more reviews. Thanks. |
@@ -84,7 +84,7 @@ var gpii = fluid.registerNamespace("gpii"); | |||
|
|||
/** | |||
* Decode the URL to find out the view/map function name and parameters for this function. | |||
* @param url {String} The URL to be decoded | |||
* @param {String} url - The URL to be decoded | |||
* @return {Object} The returned object is in the structure of: | |||
* { | |||
* viewName: {String}, |
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.
Note that the "else" branch in this function is untested - is it necessary?
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.
I added a test to cover the "else" block.
CI job passed: https://ci.gpii.net/job/universal-tests/850/ |
@amb26, comments so far have been addressed again. |
The new GPII data model can be found here.
This pull request includes:
These ops repository pull requests need to be merged once this pull request gets in the master:
These ops repos for setting up the preferences server are no longer needed:
The repo
docker-preferences-dataloader
should be renamed togpii-dataloader
.Note:
cindyqili/gpii-dataloader
used at vagrantCloudBasedContainers.sh should point togpii/gpii-dataloader
when the latter is ready.