Skip to content

Move Validation DAO to Mongoose - #82

Merged
n2iw merged 5 commits into
prisma-to-mongoose-migrationfrom
mongoose-migration-validation
Jul 28, 2026
Merged

Move Validation DAO to Mongoose#82
n2iw merged 5 commits into
prisma-to-mongoose-migrationfrom
mongoose-migration-validation

Conversation

@AustinSMueller

@AustinSMueller AustinSMueller commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
  • Migrated "Validation" DAO code from Prisma to Mongoose
  • Replaced the "facet" operation in listPrograms and release service queries. This is incompatible with DocumentDB. The replacement splits the results count and paginated results into separate queries then assembles them into a single response

- remove the $facet keyword from listPrograms and split count and paginated results into separate queries then assemble the response
@relativeci

relativeci Bot commented Jul 23, 2026

Copy link
Copy Markdown

#271 Bundle Size — 12.87MiB (+100%).

⚠️ Baseline job is missing

Warning

Bundle contains 54 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#271
     Baseline
No change  Initial JS 877.16KiB -
No change  Initial CSS 0B -
No change  Cache Invalidation 0% -
No change  Chunks 74 -
No change  Assets 117 -
No change  Modules 9159 -
No change  Duplicate Modules 0 -
No change  Duplicate Code 0% -
No change  Packages 320 -
No change  Duplicate Packages 53 -
Bundle size by type  no changes
                 Current
#271
     Baseline
No change  JS 10.35MiB (+100%) -
No change  IMG 1.72MiB (+100%) -
No change  Fonts 805.07KiB (+100%) -
No change  CSS 18KiB (+100%) -

Bundle analysis reportBranch mongoose-migration-validationProject dashboard


Generated by RelativeCIDocumentationReport issue

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ValidationDAO to a Mongoose-backed DAO and add a corresponding Validation Mongoose model.
  • Remove $facet usage in ReleaseService and ProgramDAO by splitting “results” and “count” into separate queries (DocumentDB compatibility).
  • Update GraphQL/router wiring and tests to reflect the Submission constructor parameter removal and the $facet removals.

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.

Comment thread apps/backend/services/release-service.js
Comment thread apps/backend/test/services/submission.createBatch.test.js Outdated
Comment thread apps/backend/services/release-service.js
- 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
AustinSMueller marked this pull request as ready for review July 23, 2026 18:53
@AustinSMueller
AustinSMueller requested a review from n2iw July 23, 2026 19:04
@AustinSMueller AustinSMueller changed the title Mongoose migration validation Move Validation DAO to Mongoose Jul 23, 2026
@n2iw
n2iw merged commit ed38310 into prisma-to-mongoose-migration Jul 28, 2026
15 checks passed
@n2iw
n2iw deleted the mongoose-migration-validation branch July 28, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants