Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

[RAINCATCH-1151] Add hashed index to id field for generated collections #92

Merged
merged 5 commits into from
Aug 22, 2017

Conversation

paolobueno
Copy link
Contributor

@paolobueno paolobueno commented Aug 21, 2017

Motivation

Add indexing on custom id field when generating demo data.

Description

Add extra logging and hashed indexing on the id field.

Progress

  • Add index creation before seed data

Additional Notes

To verify:

  • Delete the raincatcher mongodb database
  • Start the demo-server to trigger the seeding of the demo data
  • Verify the new index by running db.collection('workflows').getIndexes() and db.collection('workorders').getIndexes() on a mongo console

@wtrocki
Copy link
Member

wtrocki commented Aug 21, 2017

I think that we may even have some separate raincatcher-demo/demo-data package.This will make demo app clean for people wanting framework and sales. leaving up to you if we should do it in this PR

@coveralls
Copy link

coveralls commented Aug 21, 2017

Coverage Status

Changes Unknown when pulling 2f0d58b on RAINCATCH-1151-mongo-indexing into ** on master**.

function updateWorkorderDates() {
const today = new Date();
const tomorrow = new Date();
tomorrow.setDate(today.getDate() + 4);
Copy link
Member

Choose a reason for hiding this comment

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

That is no longer needed as I have disabled this fields. They are provided by step when starting

@paolobueno paolobueno changed the title [RAINCATCH-1151Add hashed index to id field for generated collections [RAINCATCH-1151] Add hashed index to id field for generated collections Aug 21, 2017
@@ -0,0 +1,52 @@
{
"name": "@raincatcher/demo-data",
Copy link
Member

Choose a reason for hiding this comment

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

@raincatcher-demo/sample-data - to simplify productization we may need two teams.
That will help us to differenciate between supported modules and examples.
WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's totally okay if it helps in that front. For the local dev workflow and lerna nothing would change, only for npm. (and arguably the node_modules/@raincatcher + node_modules/@raincatcher-demo directory structure, which shouldn't matter)

wtrocki
wtrocki previously approved these changes Aug 22, 2017
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1c58cd8 on RAINCATCH-1151-mongo-indexing into ** on master**.

1 similar comment
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1c58cd8 on RAINCATCH-1151-mongo-indexing into ** on master**.

@coveralls
Copy link

coveralls commented Aug 22, 2017

Coverage Status

Changes Unknown when pulling fc4b312 on RAINCATCH-1151-mongo-indexing into ** on master**.

@coveralls
Copy link

coveralls commented Aug 22, 2017

Coverage Status

Changes Unknown when pulling e7d7777 on RAINCATCH-1151-mongo-indexing into ** on master**.

@@ -70,7 +71,8 @@ function wfmApiSetup(app: express.Express, connectionPromise: Promise<any>) {
// Mount api
const api = new WfmRestApi();
const role = config.security.adminRole;
app.use('/api', securityMiddleware.protect(role), api.createWFMRouter());
app.use('/api', securityMiddleware.protect(role));
Copy link
Member

@wtrocki wtrocki Aug 22, 2017

Choose a reason for hiding this comment

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

@JameelB - looks like bug in security middleware prevent from getting proper results.
This looks like workaround for the moment but we will need to get this tested.

@wtrocki wtrocki merged commit 5e32400 into master Aug 22, 2017
@wtrocki wtrocki deleted the RAINCATCH-1151-mongo-indexing branch August 22, 2017 18:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants