Skip to content

CMR-11421: Pass the Cmr-Send-Kms-Metadata-Fixer to CMR during writeback - #132

Merged
eudoroolivares2016 merged 1 commit into
mainfrom
CMR-11421
Aug 14, 2026
Merged

CMR-11421: Pass the Cmr-Send-Kms-Metadata-Fixer to CMR during writeback#132
eudoroolivares2016 merged 1 commit into
mainfrom
CMR-11421

Conversation

@eudoroolivares2016

@eudoroolivares2016 eudoroolivares2016 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

npm audit fixing

Overview

What is the feature?

We noticed in some SIT testing that we could occassionaly get into a loop condition where CMR sends a collection to KMS to fix keyword issues KMS will fix those and then ingest to CMR. This is usually fine if all fixes work but, if the service is only able to fix part of the metadata e.g. if some of the keywords can be fixed because they were old keywords that have been moved/renamed, but, some are "garbage" values meaning they have never existed in KMS we cannot resolve those directly but, we will ingest the revision on KMS to fix the ones we can fix. That results in a subsequent call to KMS. There are several things on the KMS side that make this not an infinite loop but, we still want to be able to just stop this cycle from the KMS call.

What is the Solution?

Pass the header in nasa/Common-Metadata-Repository#2484 in the writeback call

What areas of the application does this impact?

CMR writeback for the KMS metadata fixer service

Testing

Reproduction steps

  • **Environment for testing:SIT
  • **Collection to test with:any
  1. Test e2e that when we have a collection that has partial fixes we can have those work but, we don't get a subsequent request back to KMS
  2. Use cloudwatch or splunk to see when we ingest a collection into CMR that has keyword errors using the cmr-validate-keywords false flag that a metadata correction event works to fix some of the issues there but, if there are some it cannot resolve e.g. a keyword which has never existed then we don't get a subsequent request back from CMR back into KMS

Attachments

NA

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Summary by CodeRabbit

  • Bug Fixes
    • Corrected metadata writeback requests now explicitly disable the CMR metadata fixer.
    • Updated validation behavior to consistently send the appropriate request header for DIF10 and UMM metadata.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 455b9792-a852-41fb-82b4-a6bd8ada2577

📥 Commits

Reviewing files that changed from the base of the PR and between 091f010 and 0d29451.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • serverless/src/shared/__tests__/writeCorrectedMetadataToCmr.test.js
  • serverless/src/shared/writeCorrectedMetadataToCmr.js

📝 Walkthrough

Walkthrough

CMR writeback requests now send Cmr-Send-Kms-Metadata-Fixer: false. Tests verify this header for DIF10 and UMM requests with default and enabled validation settings.

Changes

CMR writeback header

Layer / File(s) Summary
Writeback header and request expectations
serverless/src/shared/writeCorrectedMetadataToCmr.js, serverless/src/shared/__tests__/writeCorrectedMetadataToCmr.test.js
The writeback request disables the CMR metadata fixer. Tests verify the header for DIF10 and UMM requests under both validation configurations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to 0d294

This PR adds the metadata-fixer header to the CMR writeback path and updates its test and lockfile; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

  • nasa/kms#120: Modifies CMR writeback request options and headers with related test updates.
  • nasa/kms#125: Updates writeCorrectedMetadataToCmr and its tests for CMR writeback behavior.

Suggested reviewers: cgokey, htranho

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding the Cmr-Send-Kms-Metadata-Fixer header during CMR writeback.
Description check ✅ Passed The description includes the required overview, solution, impact, testing, attachments, and checklist sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CMR-11421

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.73%. Comparing base (091f010) to head (0d29451).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #132   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files         234      234           
  Lines        6391     6391           
  Branches     1900     1900           
=======================================
  Hits         6374     6374           
  Misses         16       16           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eudoroolivares2016
eudoroolivares2016 merged commit 28d0069 into main Aug 14, 2026
7 checks passed
@eudoroolivares2016
eudoroolivares2016 deleted the CMR-11421 branch August 14, 2026 18:58
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.

4 participants