Skip to content
This repository was archived by the owner on Jan 15, 2020. It is now read-only.

Feature/initial #1

Merged
merged 16 commits into from
Mar 28, 2018
Merged

Feature/initial #1

merged 16 commits into from
Mar 28, 2018

Conversation

st3v3nhunt
Copy link
Contributor

No description provided.

@st3v3nhunt st3v3nhunt requested a review from markysoft March 26, 2018 15:36
Copy link
Contributor

@markysoft markysoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of comments, I'll continue looking tomorrow.

"nhsuk-bunyan-logger": "^1.4.0",
"node-schedule": "^1.2.4",
"pretty-hrtime": "^1.0.3",
"request-promise-native": "^1.0.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a warning on install of warning "[email protected]" has unmet peer dependency "request@^2.34". I think you also need to explicitly add request too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that is more a problem with the configuration of the package in question. https://github.com/request/request-promise-native/blob/master/package.json#L41 specifies [email protected] is required but I'd hazard a guess that it should be more lenient than that and probably be ^2.34.0 or something similar to signify any version 2.
More background on peer dependencies.
Given request is installed, the package works and there are plenty of issues about yarn not installing peer dependencies I'd be inclined to not do anything. Unless that isn't acceptable?

@@ -0,0 +1,29 @@
function getMergedDataFilename() {
const prefix = process.env.NODE_ENV === 'production' ? '' : 'dev-';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment check was removed in the sexual-health-information-etl by allowing the filename to be specified as an env var, and having it set with a dev- prefix in the local compose file. Might be worth doing the same here.

Copy link
Contributor

@markysoft markysoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more suggestions

README.md Outdated
## Running the application and scheduling

The application will run at startup and then on a daily basis, while the
container continues to run. . The time of day defaults to 7:15am, and can be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra full stop

app.js Outdated

log.info(`Scheduling sexual health service data merge with rule '${scheduleConfig.getSchedule()}'`);
schedule.scheduleJob(scheduleConfig.getSchedule(), async () => {
await mergeAndUpload();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exceptions thrown from the await are not handled and will result in an unhandled promise rejection, terminating the app.

data: {
dir: {
current: './data/current',
latest: './data/latest',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current and latest folders do not exist causing an exception to be thrown during download.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmh, I thought I'd tested that. I'll get it sorted.

@@ -0,0 +1,19 @@
const azureService = require('./azureService');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the azure-data-service package is available this and the the azureService could be replaced with the AzureDataService class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was thinking the same.

@markysoft markysoft merged commit 5185174 into master Mar 28, 2018
@markysoft markysoft deleted the feature/initial branch March 28, 2018 13:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants