Conversation
added 2 commits
August 19, 2026 12:35
…ft keyword CSVs produce complete, CSV-shaped correction objects for every supported scheme.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
==========================================
- Coverage 99.73% 99.63% -0.10%
==========================================
Files 234 232 -2
Lines 6391 6341 -50
Branches 1907 1864 -43
==========================================
- Hits 6374 6318 -56
- Misses 16 21 +5
- Partials 1 2 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
What is the feature?
Correct publisher keyword-event mapping so published and draft keyword CSVs produce complete, CSV-shaped correction objects for every supported scheme.
This work began with the short-name scheme defect described in KMS-705. The shared CSV comparison treated every column before
UUIDas a hierarchy position. For schemes with auxiliary columns such asLong_NameorData_Center_URL, the last auxiliary value could be emitted asShortNamewhile the actualShort_Namewas discarded. This potentially affected platforms, instruments, projects, providers, IDN nodes, data formats, and granule data formats.Since this was IP sprint, my goal was to test the complete workflow from published CSVs through generated native metadata rather than limiting validation to the initial publisher fix. This uncovered a broader contract issue: correction objects sometimes relied on positional assumptions or native metadata field names instead of the actual production CSV columns. The scope therefore expanded to formalize that contract and protect the full workflow with end-to-end regression tests.
For example, a GOSAT short-name update previously produced an unchanged event because
Long_Namewas incorrectly treated asShortName:{ "Category": "Platforms", "Class": "Space-based Platforms", "Type": "Earth Observation Satellites", "ShortName": "Greenhouse Gases Observing Satellite" }The corrected event follows the platform CSV headers and preserves both values independently:
{ "Basis": "Space-based Platforms", "Category": "Earth Observation Satellites", "SubCategory": "", "ShortName": "GOSAT", "LongName": "Greenhouse Gases Observing Satellite" }The draft object is identical except that
ShortNameis correctly set toGOSAT - Test1.The same positional behavior could lose intermediate hierarchy values. An Amazonia platform update was recorded with a new path similar to
Space-based Platforms > > Amazonia-1-Chris-Test, droppingEarth Observation Satellites. Reading the namedCategorycolumn now preserves that value, while also retaining the intentionally blankSub_Categoryslot.What is the Solution?
UUIDcolumn as an indexed hierarchy value.Basis,Sub_Category,Short_Name,Long_Name, andData_Center_URL.LongNameandDataCenterURLin correction objects without treating them as hierarchy levels.published.csvanddraft.csvfixtures for every supported keyword scheme.The end-to-end tests now verify two independent boundaries:
afterrecord for both updates and deletions.The generated corrections are deliberately not passed directly into the native transformation assertion. Keeping the two stages independent prevents a broken publisher from defining its own expected native result. It also gives us a repeatable pattern for future mapping defects: add the production-shaped CSV case, the expected correction object, and the affected native metadata field, then the test locks the reported behavior from publication through transformation.
What areas of the application does this impact?
Testing
npm test -- --run serverless/src/shared/__tests__/applyNativeMetadataCorrectionMappings.test.js.npm test -- --runand confirm the full suite passes. The current result is 226 test files and 2,296 tests passing.npm run lintand confirm ESLint passes.beforenative metadata fixture for comparison, then compare it with the correspondingafterfixture underserverless/src/shared/__mocks__/native_metadata_correction_mappings/end_to_end._CHANGEDvalues appear only in intended mapped fields,_SHOULD_DELETEvalues are absent from deletion results, and unrelated metadata is unchanged.generated/short-name-events.jsonand confirm short-name schemes preserve the true short name plus auxiliary long-name or provider URL values.Attachments
The production-shaped CSV inputs, expected publisher events, correction objects, and complete before/after native records are included under
serverless/src/shared/__mocks__/native_metadata_correction_mappings/end_to_end.Checklist