Skip to content

CMR-11421: Prevent multiple calls to KMS fixer service on CMR - #2484

Merged
eudoroolivares2016 merged 2 commits into
masterfrom
CMR-11421
Aug 14, 2026
Merged

CMR-11421: Prevent multiple calls to KMS fixer service on CMR#2484
eudoroolivares2016 merged 2 commits into
masterfrom
CMR-11421

Conversation

@eudoroolivares2016

@eudoroolivares2016 eudoroolivares2016 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Overview

What is the objective?

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.

Thus this ticket will include a KMS PR to just use the header in the ingest call

What are the changes?

Create new header for collections pull it out in the validation-options and use that in the conditional for whether or not we send a request to the KMS fixer service

What areas of the application does this impact?

Collection ingest

Testing

image I added a tap to image the kms transmit. Ran it three times. On the final time I used `cmr-send-kms-metadata-fixer` which is the flag that KMS will callout

I don't think this is a flag we want to show on the docs. Its not sensitive but, its really only applicable to the KMS-CMR exchange

Required Checklist

  • New and existing unit and int tests pass locally and remotely
  • clj-kondo has been run locally and all errors in changed files are corrected
  • I have commented my code, particularly in hard-to-understand areas
  • [NA] I have made changes to the documentation (if necessary)
  • My changes generate no new warnings

Additional Checklist

  • [] I have removed unnecessary/dead code and imports in files I have changed
  • I have cleaned up integration tests by doing one or more of the following:
    • migrated any are2 tests to are3 in files I have changed
    • de-duped, consolidated, removed dead int tests
    • transformed applicable int tests into unit tests
    • reduced number of system state resets by updating fixtures. Ex) (use-fixtures :each (ingest/reset-fixture {})) to be :once instead of :each

@eudoroolivares2016 eudoroolivares2016 changed the title Cmr 11421 CMR-11421: Prevent multiple calls to KMS fixer service on CMR Aug 13, 2026
@eudoroolivares2016
eudoroolivares2016 marked this pull request as ready for review August 13, 2026 19:14
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.20%. Comparing base (78d766b) to head (cc52178).

Files with missing lines Patch % Lines
ingest-app/src/cmr/ingest/api/collections.clj 33.33% 2 Missing ⚠️
.../cmr/ingest/services/ingest_service/collection.clj 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (78d766b) and HEAD (cc52178). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (78d766b) HEAD (cc52178)
6 4
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2484       +/-   ##
===========================================
- Coverage   57.95%   29.20%   -28.76%     
===========================================
  Files        1074     1014       -60     
  Lines       74715    71268     -3447     
  Branches     2192     1266      -926     
===========================================
- Hits        43303    20811    -22492     
- Misses      29361    49254    +19893     
+ Partials     2051     1203      -848     

☔ 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 29da8cc into master Aug 14, 2026
6 checks passed
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