Skip to content

MODEUS-244: Set the harvesting status of UDPs with service type cs41 to inactive on upgrade - #238

Merged
charismatic-claire merged 5 commits into
masterfrom
MODEUS-244-set-harvesting-status-to-inactive
Oct 13, 2026
Merged

charismatic-claire merged 5 commits into
masterfrom
MODEUS-244-set-harvesting-status-to-inactive

Conversation

@charismatic-claire

@charismatic-claire charismatic-claire commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

MODEUS-244](https://folio-org.atlassian.net/browse/MODEUS-244

Purpose

The harvester no longer supports COUNTER 4.1 SUSHI (service type cs41). Usage data providers
configured with cs41 and an active harvesting status would keep being picked up for harvesting,
and those runs can only fail. This PR sets their harvesting status to inactive when a tenant is
upgraded, so they are no longer harvested. Their configuration and existing reports are kept.

Approach

  • Data migration: Add migration/5.3.0/migrate_cs41_harvesting_status.sql and register it in
    schema.json (fromModuleVersion: mod-erm-usage-5.3.0, run: after). It sets
    harvestingConfig.harvestingStatus to inactive for all UDPs whose
    harvestingConfig.sushiConfig.serviceType is cs41. UDPs that are already inactive are skipped,
    and no other field changes.
  • Sample data: Set SAMPLE_R4.json (service type cs41) to harvestingStatus: inactive, so a
    fresh install with loadSample=true matches the state after an upgrade.
  • Tests:
    • Migrate MigrateRemoveAggregatorIT to JUnit5 and rename it to
      MigrateRemoveAggregatorAndCS41HarvestingStatusIT
    • Add test to assert that active CS41 UDPs get deactivated
    • Migrate UsageDataProvidersIT from JUnit 4 to JUnit 5 (impl2 → impl3) instead of adding a
      new test to the outdated framework, and register it in ITSuite. It now uses the shared
      Postgres container, verticle and @SetupTenant.
    • Document how to add tests to ITSuite.
  • NEWS.md: Add an entry for MODEUS-244.
  • .gitignore: Add dependency-reduced-pom.xml to the Maven section

@alb3rtino
alb3rtino self-requested a review October 6, 2026 09:14
Comment thread mod-erm-usage-server/dependency-reduced-pom.xml Outdated
Comment thread mod-erm-usage-server/src/main/resources/templates/db_scripts/schema.json Outdated
…to inactive on upgrade

* Add migration script
* Register migration script
* Update sample data for tests
* Add news
…to inactive on upgrade

Update "UsageDataProvidersIT" to JUnit5, since we don't want to add new
tests to outdated test frameworks.
…to inactive on upgrade

Adding integration test for the newly added data migration script when
updating from 5.2.0 to 5.3.0.
@charismatic-claire
charismatic-claire force-pushed the MODEUS-244-set-harvesting-status-to-inactive branch from e5b0dfb to 450f255 Compare October 12, 2026 14:28
@charismatic-claire
charismatic-claire force-pushed the MODEUS-244-set-harvesting-status-to-inactive branch from 450f255 to e73645a Compare October 12, 2026 14:36
Comment thread sample-data/usage-data-providers/SAMPLE_R4.json Outdated
Comment thread mod-erm-usage-server/src/test/java/org/folio/rest/impl3/UsageDataProvidersIT.java Outdated
Comment thread .gitignore Outdated
* Remove obsolete test from UsageDataProvidersIT
* Rename MigrateRemoveAggregatorIT
* Add tests there instead of UsageDataProvidersIT
* Remove obsolete fields from SAMPLE_R4.json
* Revert .gitignore update
@sonarqubecloud

Copy link
Copy Markdown

@alb3rtino alb3rtino left a comment

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.

Thanks!

@charismatic-claire
charismatic-claire merged commit 516ef59 into master Oct 13, 2026
28 checks passed
@charismatic-claire
charismatic-claire deleted the MODEUS-244-set-harvesting-status-to-inactive branch October 13, 2026 10:55
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.

2 participants