Skip to content

CMR-11155: Version Control Index Set - Part 1#2455

Open
jmaeng72 wants to merge 3 commits into
masterfrom
CMR-11155-Part-1
Open

CMR-11155: Version Control Index Set - Part 1#2455
jmaeng72 wants to merge 3 commits into
masterfrom
CMR-11155-Part-1

Conversation

@jmaeng72

@jmaeng72 jmaeng72 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Overview

What is the objective?

To allow for disaster recovery and keeping track of historical changes of index-set.

What are the changes?

This is PART 1 of 2 PRs to reduce PR size. This PR mainly introduces helper funcs that will be needed for the major changes in PART 2.

  • Added helper funcs for new index-set db table
  • Added helper funcs for index-set sys tests
  • Added funcs to allow for proper reset-fixture updates for sys tests

What areas of the application does this impact?

Indexer

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
  • 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

@jmaeng72 jmaeng72 self-assigned this Jun 24, 2026
(println "cmr.metadata-db.migrations.092-update-cmr-sub-notifications-table up...")
(h/sql "ALTER TABLE METADATA_DB.CMR_SUB_NOTIFICATIONS DROP COLUMN AWS_ARN")
(h/sql "ALTER TABLE METADATA_DB.CMR_SUBSCRIPTIONS ADD AWS_ARN VARCHAR(2048) NULL"))
(when (h/column-exists? "CMR_SUB_NOTIFICATIONS" "AWS_ARN")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

had to add this because my local had a wrong version of AWS_ARN and had to be replaced. This is helpful to any other dev with local db issues. This will not have adverse affects since the logic still remains the same

@eereiter eereiter Jun 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should be running migrate db when someone changes database structures, that way all of our databases will be up to date. I forget to do this sometimes. Or did you migrate and it didn't work?

@codecov-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.00885% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.13%. Comparing base (0bcadbd) to head (e108558).

Files with missing lines Patch % Lines
...app/src/cmr/indexer/services/index_set_service.clj 9.30% 39 Missing ⚠️
...-test/src/cmr/system_int_test/utils/index_util.clj 23.07% 10 Missing ⚠️
...-test/src/cmr/system_int_test/utils/url_helper.clj 35.71% 9 Missing ⚠️
.../migrations/092_update_cmr_subscriptions_table.clj 0.00% 8 Missing ⚠️
...cmr/metadata_db/data/oracle/concepts/index_set.clj 30.00% 7 Missing ⚠️
metadata-db-app/src/config/mdb_migrate_helper.clj 14.28% 6 Missing ⚠️
...src/cmr/system_int_test/utils/metadata_db_util.clj 16.66% 5 Missing ⚠️
...a-db-app/src/cmr/metadata_db/services/messages.clj 33.33% 2 Missing ⚠️
...c/cmr/metadata_db/services/concept_validations.clj 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2455      +/-   ##
==========================================
- Coverage   58.20%   58.13%   -0.07%     
==========================================
  Files        1069     1070       +1     
  Lines       74278    74385     +107     
  Branches     2166     2164       -2     
==========================================
+ Hits        43233    43247      +14     
- Misses      29028    29116      +88     
- Partials     2017     2022       +5     

☔ 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.

[taoensso.carmine :as carmine]))

(use-fixtures :once test-util/embedded-redis-server-fixture)
(use-fixtures :each test-util/reset-redis-fixture)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

to keep consistent test execution. One of the unit tests kept failing the first time and succeeding the second time, which made me realize the caches were not in clean states per test

@@ -4,6 +4,7 @@
[cheshire.core :as json]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

all the following changes are additions and should not affect CMR behavior at all when merged into master

@eereiter

eereiter commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I first glance I am wondering why you chose the path to "create" a new concept, instead of just creating a database table with get/set functions for it for the index set - which I thought we already had - maybe I am remembering the redis cache.

@jmaeng72

Copy link
Copy Markdown
Contributor Author

In the beginning, it was easier to treat index-set like a concept and borrow the metadata-db funcs to keep revisions, delete old revs, updates/deletes, etc. I wanted to keep all database interactions under the same pattern. Index-set table did not exist prior to this change.

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.

3 participants