From 2a69aba4514d5ec842f187536ffa455200533e2e Mon Sep 17 00:00:00 2001 From: David An Date: Mon, 9 Feb 2026 11:15:22 -0500 Subject: [PATCH 1/2] handle mixed-but-not-correctable attribute statuses --- .../monitor/QuicksilverMigrationMonitorSupport.scala | 10 ++++++---- .../QuicksilverMigrationMonitorSupportSpec.scala | 11 ++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala b/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala index 42539c98f2..ec5e9fb063 100644 --- a/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala +++ b/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala @@ -22,9 +22,9 @@ object AttributeCorrectionStatus extends Enumeration { object EntityCorrectionStatus extends Enumeration { type EntityCorrectionStatusType = Value - val CurrentGone, Correct, CorrectModified, Correctable, CorrectableModified, Corrected, Mixed, MixedModified, - Intersect, IntersectModified, Different, DifferentModified, NothingInCommon, NothingInCommonModified, NotAList, - NotAListModified, TypeDifferent, TypeDifferentModified = Value + val CurrentGone, Correct, CorrectModified, Correctable, CorrectableModified, Corrected, Mixed, MixedButNotCorrectable, + MixedModified, Intersect, IntersectModified, Different, DifferentModified, NothingInCommon, NothingInCommonModified, + NotAList, NotAListModified, TypeDifferent, TypeDifferentModified = Value } trait QuicksilverMigrationMonitorSupport extends LazyLogging { @@ -154,8 +154,10 @@ trait QuicksilverMigrationMonitorSupport extends LazyLogging { EntityCorrectionStatus.NotAList } else if (attrStatuses == Set(AttributeCorrectionStatus.TypeDifferent)) { EntityCorrectionStatus.TypeDifferent - } else { + } else if (attrStatuses.contains(AttributeCorrectionStatus.Reordered)) { EntityCorrectionStatus.Mixed + } else { + EntityCorrectionStatus.MixedButNotCorrectable } } diff --git a/core/src/test/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupportSpec.scala b/core/src/test/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupportSpec.scala index 1ff2dc9021..0f126adf42 100644 --- a/core/src/test/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupportSpec.scala +++ b/core/src/test/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupportSpec.scala @@ -236,12 +236,21 @@ class QuicksilverMigrationMonitorSupportSpec } } - it should s"return Mixed when attributes have multiple statuses" in { + it should s"return MixedButNotCorrectable when attributes have multiple statuses but none are Reordered" in { val statusMap = Map( AttributeName.withDefaultNS("foo") -> AttributeCorrectionStatus.Correct, AttributeName.withLibraryNS("bar") -> AttributeCorrectionStatus.Different ) val actual = calculateEntityStatus(statusMap) + actual shouldBe EntityCorrectionStatus.MixedButNotCorrectable + } + + it should s"return Mixed when attributes have multiple statuses and some are Reordered" in { + val statusMap = Map( + AttributeName.withDefaultNS("foo") -> AttributeCorrectionStatus.Correct, + AttributeName.withLibraryNS("bar") -> AttributeCorrectionStatus.Reordered + ) + val actual = calculateEntityStatus(statusMap) actual shouldBe EntityCorrectionStatus.Mixed } } From ccc263e963320e9518aa9afdc085cb60996c8225 Mon Sep 17 00:00:00 2001 From: David An Date: Mon, 9 Feb 2026 12:48:35 -0500 Subject: [PATCH 2/2] code comments --- .../QuicksilverMigrationMonitorSupport.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala b/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala index ec5e9fb063..83d8de8828 100644 --- a/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala +++ b/core/src/main/scala/org/broadinstitute/dsde/rawls/monitor/QuicksilverMigrationMonitorSupport.scala @@ -134,10 +134,15 @@ trait QuicksilverMigrationMonitorSupport extends LazyLogging { ): EntityCorrectionStatusType = { val attrStatuses = attributeStatuses.values.toSet + // when no attributes exist, use Correct; there is nothing that could be corrected if (attrStatuses.isEmpty) { EntityCorrectionStatus.Correct + + // if any attribute was corrected, mark the entity as Corrected } else if (attrStatuses.contains(AttributeCorrectionStatus.Corrected)) { EntityCorrectionStatus.Corrected + + // handle cases where all attributes have the same status } else if (attrStatuses == Set(AttributeCorrectionStatus.Correct)) { EntityCorrectionStatus.Correct } else if (attrStatuses == Set(AttributeCorrectionStatus.Reordered)) { @@ -154,8 +159,18 @@ trait QuicksilverMigrationMonitorSupport extends LazyLogging { EntityCorrectionStatus.NotAList } else if (attrStatuses == Set(AttributeCorrectionStatus.TypeDifferent)) { EntityCorrectionStatus.TypeDifferent + + // single-status sets were handled above. Now handle cases where attributes + // have multiple cases. + // + // if any attribute is correctable (e.g. "Reordered"), mark the entity as Mixed. + // Mixed entities will get processed by the correction monitor. } else if (attrStatuses.contains(AttributeCorrectionStatus.Reordered)) { EntityCorrectionStatus.Mixed + + // We have multiple attribute statuses, but none of them is "Reordered". + // Mark the entity as MixedButNotCorrectable, which will not be processed by + // the correction monitor. } else { EntityCorrectionStatus.MixedButNotCorrectable }