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 support for multiple CouchDB databases, multiple namespaces, and readOnly configurations #7413

Conversation

scottbell
Copy link
Contributor

@scottbell scottbell commented Jan 25, 2024

Closes #7359 #7360

Describe your changes:

Add support for multiple CouchDB databases, namespaces, and readOnly configurations.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Is this a breaking change to be called out in the release notes?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

@scottbell scottbell linked an issue Jan 25, 2024 that may be closed by this pull request
@scottbell scottbell added the type:feature Feature. Required intentional design label Jan 25, 2024
@scottbell scottbell added this to the Target:4.0.0 milestone Jan 25, 2024
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (69b81c0) 55.53% compared to head (c79d50a) 55.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7413      +/-   ##
==========================================
+ Coverage   55.53%   55.55%   +0.02%     
==========================================
  Files         668      668              
  Lines       26704    26723      +19     
  Branches     2585     2585              
==========================================
+ Hits        14829    14845      +16     
- Misses      11164    11165       +1     
- Partials      711      713       +2     
Flag Coverage Δ
e2e-full 41.27% <ø> (-0.10%) ⬇️
e2e-stable 59.05% <17.77%> (-0.06%) ⬇️
unit 48.67% <91.11%> (+0.04%) ⬆️
Files Coverage Δ
src/api/objects/ObjectAPI.js 92.03% <100.00%> (+0.07%) ⬆️
...plugins/localStorage/LocalStorageObjectProvider.js 100.00% <100.00%> (ø)
src/plugins/myItems/myItemsInterceptor.js 100.00% <100.00%> (ø)
src/plugins/myItems/plugin.js 100.00% <100.00%> (ø)
...c/plugins/persistence/couch/CouchObjectProvider.js 87.86% <100.00%> (-0.04%) ⬇️
...c/plugins/persistence/couch/CouchSearchProvider.js 86.27% <0.00%> (-1.73%) ⬇️
src/plugins/persistence/couch/plugin.js 88.88% <88.00%> (-11.12%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69b81c0...c79d50a. Read the comment docs.

@scottbell scottbell requested review from akhenry and ozyx January 25, 2024 09:35
@scottbell scottbell changed the title Support more than one couch database for a single couch server Add support for multiple CouchDB databases, multiple namespaces, and readOnly configurations Jan 25, 2024
@scottbell scottbell changed the title Add support for multiple CouchDB databases, multiple namespaces, and readOnly configurations Add support for multiple CouchDB databases, multiple namespaces, and readOnly configurations Jan 25, 2024
@scottbell scottbell marked this pull request as ready for review January 25, 2024 09:57
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 25, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 25, 2024
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 25, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 25, 2024
@scottbell scottbell linked an issue Jan 25, 2024 that may be closed by this pull request
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Wow, this is awesome. I haven't tried it, but I assume this works with multiple CouchDB databases as well?

I did find one issue with search, where after the search has completed, the "loading" progress bar is still spinning permanently:

Screen.Recording.2024-01-26.at.1.35.19.PM.mov

I think we can spin that off into its own issue, though. I don't have any PR-blocking comments at this time! I tested locally and everything seems to work well.

src/plugins/persistence/couch/README.md Outdated Show resolved Hide resolved
@unlikelyzero
Copy link
Collaborator

@scottbell while you're waiting for additional review from Andrew, can you make sure our backup and restore scripts are up to date with this pattern?

@scottbell
Copy link
Contributor Author

@scottbell while you're waiting for additional review from Andrew, can you make sure our backup and restore scripts are up to date with this pattern?

@unlikelyzero good idea! I’ll take a look

@scottbell
Copy link
Contributor Author

@scottbell while you're waiting for additional review from Andrew, can you make sure our backup and restore scripts are up to date with this pattern?

@unlikelyzero good idea! I’ll take a look

@unlikelyzero they seem like they still work, provided you're using the default db name of openmct, but that's always been the case.

@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

This looks great, thank you. My only request is that for consistency with the default namespace we remove the logic to create the root if it doesn't exist. Users can install My Items for additional namespaces if they desire, and the omitRoot logic might be confusing. For the intended use-case the second read-only namespace will be created by an external script.

src/plugins/persistence/couch/CouchObjectProvider.js Outdated Show resolved Hide resolved
src/plugins/persistence/couch/CouchObjectProvider.js Outdated Show resolved Hide resolved
{
url: unnnormalizedOptions.url,
namespace: DEFAULT_NAMESPACE,
additionalNamespaces: [LEGACY_SPACE],
Copy link
Contributor

Choose a reason for hiding this comment

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

chef's kiss 🤌

}

// final sanity check, ensure we have all options
normalizedOptions.databases.forEach((databaseConfiguration) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Love it

@scottbell scottbell requested a review from akhenry January 30, 2024 18:27
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@@ -493,6 +493,7 @@
"WCAG",
"stackedplot",
"Andale",
"unnnormalized",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm prepared to accept unnormalized at a stretch. But unnnormalized? With three n's?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️

@unlikelyzero unlikelyzero added pr:e2e:couchdb npm run test:e2e:couchdb pr:e2e:perf Trigger perf tests labels Jan 30, 2024
@akhenry akhenry enabled auto-merge (squash) January 30, 2024 22:53
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@akhenry akhenry added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 30, 2024
@unlikelyzero unlikelyzero disabled auto-merge January 30, 2024 23:01
@github-actions github-actions bot removed pr:e2e:couchdb npm run test:e2e:couchdb pr:e2e:perf Trigger perf tests labels Jan 30, 2024
@unlikelyzero unlikelyzero merged commit d42aa54 into master Jan 30, 2024
37 checks passed
@unlikelyzero unlikelyzero deleted the 7359-support-more-than-one-couch-database-for-a-single-couch-server branch January 30, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Feature. Required intentional design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "read-only" Couch databases Support more than one Couch database for a single Couch Server
4 participants