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

Handle empty namespaces in import #7619

Conversation

scottbell
Copy link
Contributor

@scottbell scottbell commented Mar 19, 2024

Closes #7617

Describe your changes:

When importing a JSON dump that came from a setup without a namespace set, the regex we use in the ImportJsonAction was setting the key to namespace:key, instead of properly separating the two. Now we detect corrupted keys, and repair them during the import.

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 a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

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.
  • 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 added this to the Target:4.0.0 milestone Mar 19, 2024
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 56.14%. Comparing base (e305b46) to head (f172401).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7619      +/-   ##
==========================================
- Coverage   56.15%   56.14%   -0.01%     
==========================================
  Files         672      672              
  Lines       27122    27128       +6     
  Branches     2635     2635              
==========================================
+ Hits        15230    15231       +1     
- Misses      11565    11570       +5     
  Partials      327      327              
Flag Coverage Δ
e2e-full 23.57% <0.00%> (-0.02%) ⬇️
e2e-stable 59.90% <0.00%> (-0.08%) ⬇️
unit 49.11% <90.90%> (+0.01%) ⬆️
Files Coverage Δ
...ugins/importFromJSONAction/ImportFromJSONAction.js 68.31% <90.90%> (+3.05%) ⬆️

... and 4 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 e305b46...f172401. Read the comment docs.

@scottbell
Copy link
Contributor Author

This is pretty tricky to write an e2e test because we need to test with a namespace'd couchdb server, which I don't think we have.

@scottbell scottbell marked this pull request as ready for review March 19, 2024 11:26
@scottbell scottbell requested a review from ozyx March 19, 2024 11:26
@scottbell scottbell changed the title Handle empty namespaces in import to databases that have namespaces Handle empty namespaces in import Mar 19, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
@scottbell scottbell requested a review from akhenry March 19, 2024 11:38
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.

Looks good! Just needs some kind of test

…-in-anything-other-than-the-default-namespace
@akhenry
Copy link
Contributor

akhenry commented Mar 19, 2024

Tested locally and it looks good. Filed a followup for the test - #7621

…other-than-the-default-namespace' of github.com:nasa/openmct into 7617-import-from-json-action-does-not-work-in-anything-other-than-the-default-namespace
@scottbell
Copy link
Contributor Author

scottbell commented Mar 19, 2024

Tested locally and it looks good. Filed a followup for the test - #7621

@akhenry Added a test to this PR FWIW

@akhenry akhenry added the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
@scottbell scottbell requested a review from ozyx March 19, 2024 19:58
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
@akhenry akhenry merged commit b2b0837 into master Mar 19, 2024
24 checks passed
@akhenry akhenry deleted the 7617-import-from-json-action-does-not-work-in-anything-other-than-the-default-namespace branch March 19, 2024 20:05
@akhenry
Copy link
Contributor

akhenry commented Mar 19, 2024

Tested locally and it looks good. Filed a followup for the test - #7621

@akhenry Added a test to this PR FWIW

Then I'll go ahead and close the followup :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import from JSON action does not work in anything other than the default namespace
3 participants