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

Script to Update/Insert from CouchDB Backup #7501

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

scottbell
Copy link
Contributor

@scottbell scottbell commented Feb 13, 2024

Closes #7475

Describe your changes:

A script that given a CouchDB backup JSON file, will update/insert into an existing CouchDB installation.

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 Feb 13, 2024 that may be closed by this pull request
@scottbell scottbell added this to the Target:4.0.0 milestone Feb 13, 2024
@scottbell scottbell added the type:maintenance tests, chores, or project maintenance label Feb 13, 2024
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.01%. Comparing base (6486263) to head (b3209b1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7501      +/-   ##
==========================================
- Coverage   59.75%   56.01%   -3.75%     
==========================================
  Files         430      672     +242     
  Lines       13454    27108   +13654     
  Branches        0     2629    +2629     
==========================================
+ Hits         8040    15185    +7145     
- Misses       5414    11601    +6187     
- Partials        0      322     +322     
Flag Coverage Δ
e2e-full 23.60% <ø> (ø)
e2e-stable 59.65% <ø> (-0.02%) ⬇️
unit 49.10% <ø> (?)

see 377 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 6486263...b3209b1. Read the comment docs.

@scottbell scottbell marked this pull request as ready for review February 13, 2024 11:51
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Feb 13, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Feb 13, 2024
@unlikelyzero unlikelyzero added the type:feature Feature. Required intentional design label Feb 13, 2024
@scottbell
Copy link
Contributor Author

scottbell commented Feb 14, 2024

@unlikelyzero there is a branch in the openmct-quickstart repo that defines two couch servers, one write only to an admin user. The two new users are described in the README.md. OpenMCT is configured to use both.

@@ -37,15 +37,20 @@ async function main() {
username,
password
});
if (!docsToDelete.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

That reminds me, we should test upserting with both scenarios: with and without annotations being saved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both worked locally for me.

_id: { $gt: null }
},
fields: ['_id', '_rev'],
limit: 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

What's significance of this limit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prevents couch trying to dump its entire db in one POST.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.98%. Comparing base (f98eb31) to head (b258365).
Report is 69 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7501      +/-   ##
==========================================
+ Coverage   49.13%   49.98%   +0.84%     
==========================================
  Files         671      672       +1     
  Lines       27116    27122       +6     
  Branches     2632     2632              
==========================================
+ Hits        13324    13556     +232     
+ Misses      13464    13238     -226     
  Partials      328      328              
Flag Coverage Δ *Carryforward flag
e2e-full 23.49% <ø> (∅) Carriedforward from b3209b1
unit 49.07% <ø> (-0.07%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

see 54 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 f98eb31...b258365. Read the comment docs.

@unlikelyzero unlikelyzero modified the milestones: Target:4.0.1, Target:4.1.0 Aug 6, 2024
@akhenry akhenry removed this from the Target:4.1.0 milestone Jan 29, 2025
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 type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate Couch Version Management Scripts
5 participants