Skip to content
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

add referential integrity checking to API operations #644

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dwinston
Copy link
Collaborator

Description

Fixes #318

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

TBD

Configuration Details: none

Definition of Done (DoD) Checklist:

  • My code follows the style guidelines of this project (have you run black nmdc_runtime/?)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (in docs/ and in https://github.com/microbiomedata/NMDC_documentation/?)
  • I have added tests that prove my fix is effective or that my feature works, incl. considering downstream usage (e.g. https://github.com/microbiomedata/notebook_hackathons) if applicable.
  • New and existing unit and functional tests pass locally with my changes (make up-test && make test-run)

@dwinston
Copy link
Collaborator Author

For now, simply ensures an alldocs collection on boot for eventual use in referential integrity checking logic across several API endpoints. We're going to want to make this more sophisticated with auto-reconciliation, i.e. ensure_alldocs_okay rather than just ensure_alldocs_exists (if zero documents, create it!) when there is obvious discrepancy between the schema collections and the alldocs collection (e.g. simple checksum on total # of documents where if fails, rebuild "alldocs").

@dwinston
Copy link
Collaborator Author

dwinston commented Sep 3, 2024

cc @shreddd

@eecavanna
Copy link
Collaborator

eecavanna commented Sep 3, 2024

As a reminder, the alldocs collection may be stale after a database migration.

@shreddd
Copy link
Collaborator

shreddd commented Sep 5, 2024

I think initially just checking for all_docs is ok. We can make it more sophisticated as we go

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.

referential integrity checks via runtime API is needed
3 participants