Move Validation DAO to Mongoose - #82
Merged
n2iw merged 5 commits intoJul 28, 2026
Merged
Conversation
- remove the $facet keyword from listPrograms and split count and paginated results into separate queries then assemble the response
#271 Bundle Size — 12.87MiB (+100%).Warning Bundle contains 54 duplicate packages – View duplicate packages Bundle metrics
|
| Current #271 |
Baseline | |
|---|---|---|
877.16KiB |
- |
|
0B |
- |
|
0% |
- |
|
74 |
- |
|
117 |
- |
|
9159 |
- |
|
0 |
- |
|
0% |
- |
|
320 |
- |
|
53 |
- |
Bundle size by type no changes
| Current #271 |
Baseline | |
|---|---|---|
10.35MiB (+100%) |
- | |
1.72MiB (+100%) |
- | |
805.07KiB (+100%) |
- | |
18KiB (+100%) |
- |
Bundle analysis report Branch mongoose-migration-validation Project dashboard
Generated by RelativeCI Documentation Report issue
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the backend to support ongoing Mongoose migration work (specifically for Validation) and to improve DocumentDB compatibility by removing $facet usage in aggregation-heavy endpoints/DAOs.
Changes:
- Migrate
ValidationDAOto a Mongoose-backed DAO and add a correspondingValidationMongoose model. - Remove
$facetusage inReleaseServiceandProgramDAOby splitting “results” and “count” into separate queries (DocumentDB compatibility). - Update GraphQL/router wiring and tests to reflect the
Submissionconstructor parameter removal and the$facetremovals.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/backend/services/submission.js | Removes validationCollection from constructor wiring; continues using ValidationDAO. |
| apps/backend/routers/graphql-router.js | Stops creating/passing validationCollection into Submission. |
| apps/backend/app.js | Removes VALIDATION_COLLECTION usage and stops creating/passing validationCollection into Submission. |
| apps/backend/services/release-service.js | Replaces $facet pipelines with separate “page” and “count” aggregations; adds clarifying JSDoc. |
| apps/backend/dao/program.js | Replaces $facet with separate countDoc + aggregate queries; adds JSDoc. |
| apps/backend/dao/validation.js | Switches ValidationDAO to extend MongooseGenericDAO with the new model. |
| apps/backend/mongoose/models/validation.js | Adds the Mongoose Validation schema/model aligned to the expected record shape. |
| apps/backend/test/services/submission.updateBatch-qc.test.js | Updates Submission instantiation to remove the dropped ctor argument. |
| apps/backend/test/services/submission.service.test.js | Updates Submission instantiation sites to remove the dropped ctor argument. |
| apps/backend/test/services/submission.processSubmissionNodes.data-view.test.js | Updates Submission instantiation to remove the dropped ctor argument. |
| apps/backend/test/services/submission.listPotentialCollaborators.test.js | Updates Submission instantiation and removes now-unused validation mock. |
| apps/backend/test/services/submission.getUploaderCLIConfig.test.js | Updates Submission instantiation to remove the dropped ctor argument. |
| apps/backend/test/services/submission.getSubmissionSummary.test.js | Updates Submission instantiation to remove the dropped ctor argument. |
| apps/backend/test/services/submission.getDataFileConfigs.test.js | Updates Submission instantiation to remove the dropped ctor argument. |
| apps/backend/test/services/submission.editSubmissionCollaborators.test.js | Updates Submission instantiation and removes now-unused validation mock. |
| apps/backend/test/services/submission.createBatch.test.js | Removes one ctor arg; comments around ctor args need alignment to the new signature. |
| apps/backend/test/services/submission._notifyConfigurationChange.test.js | Updates Submission instantiation to remove the dropped ctor argument. |
| apps/backend/test/services/release-service.nofacet.test.js | Adds coverage ensuring ReleaseService runs non-$facet page/count aggregates. |
| apps/backend/test/services/data-submission.test.js | Updates Submission instantiation sites to remove the dropped ctor argument. |
| apps/backend/test/dao/dao.validation.test.js | Adds unit tests for the new Mongoose-backed ValidationDAO. |
| apps/backend/test/dao/dao.program.test.js | Updates/extends tests for listPrograms non-$facet behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- standardize none-scope responses - add explicit comment that listPrograms cannot filter by study fields. This filtering is currently being handled by the frontend - updated unit tests
AustinSMueller
marked this pull request as ready for review
July 23, 2026 18:53
n2iw
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.