test(a11y): add migration-phase / store control to ContentletDataGen (#36266)#36268
test(a11y): add migration-phase / store control to ContentletDataGen (#36266)#36268fabrizzio-dotCMS wants to merge 1 commit into
Conversation
…36266) Add per-checkin migration-phase control to ContentletDataGen so tests can direct a generated contentlet to ElasticSearch, OpenSearch, or both during the ES->OS migration: - migrationPhase(MigrationPhase): phase-oriented primary API - targetStore(ES|OS|BOTH): store-oriented convenience over the phase override - per-checkin scope: wraps the checkin in persist(), captures and restores the prior FEATURE_FLAG_OPEN_SEARCH_PHASE value (restored even on throw) - backward compatible: no override -> respects the globally-active phase - applied to both persist(...) overloads and nextPersistedAndPublish() Add ContentletDataGenPhaseControlIT (registered in OpenSearchUpgradeSuite), which asserts placement by document _id directly on each provider's working index. ES content-write scenarios skip in the single-cluster opensearch-upgrade profile (the legacy ES client cannot content-bulk-write to OS 3.x); the OS-only placement and per-checkin restore tests run everywhere. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @fabrizzio-dotCMS's task in 1m 34s —— View job Rollback Safety Analysis
Verdict: ✅ Safe to RollbackAll 3 changed files are exclusively in
Against every unsafe category:
The only runtime behavior added is a test-time per-checkin |
🤖 Bedrock Review —
|
Proposed Changes
Closes #36266.
Tests previously had no way to control which search store a contentlet created through
ContentletDataGenis indexed into (ES, OpenSearch, or both), which blocked verifying the ES→OS dual-write pipeline from the data-generation layer. This adds a per-checkin migration-phase override to the data-gen and an integration test that asserts store placement.ContentletDataGenmigrationPhase(MigrationPhase)— phase-oriented primary API.targetStore(ES | OS | BOTH)— store-oriented convenience over the phase override (ES→Phase 0, OS→Phase 3, BOTH→Phase 1 dual-write).checkin()insidepersist(), captures and restores the priorFEATURE_FLAG_OPEN_SEARCH_PHASEvalue (not blindly cleared), restored even whencheckin()throws (finally).persist(...)overloads andnextPersistedAndPublish().ContentletDataGenPhaseControlITNew IT registered in
OpenSearchUpgradeSuite. It bootstraps both stores in setup (phase 1 +checkAndInitializeIndex()) and asserts placement by querying the document_id(identifier_languageId_variantId) directly on each provider's working index — noise-free and sidesteps the high-levelinferIndexToHitbootstrap gap.targetStore(OS)targetStore(BOTH)/targetStore(ES)/migrationPhase(PHASE_1)Why these changes are needed
Unblocks ES→OS dual-write verification at the data-gen layer for the migration test suite.
How to test
Verified locally against the live OpenSearch 3.4.0 container: 0 failures / 0 errors, the OS-only placement and per-checkin restore tests pass.
Notes / known limitation
The ES content-write scenarios (
targetStore(BOTH),targetStore(ES),migrationPhase(PHASE_1)) skip themselves in the single-clusteropensearch-upgradeprofile viaassumeFalse(esSameAsOs()): the legacy ESRestHighLevelClientcannot parse an OpenSearch 3.x content bulk-write response (NullPointerExceptioninDocWriteResponse), so ES content writes only work against a truly separate ES cluster. This mirrors the existing migration ITs' skip pattern. Index/admin ops against OS 3.x are unaffected.🤖 Generated with Claude Code