From ef8eb87fae4e11fe6d3e0cca52a70ec8ae4189e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:24:12 +0000 Subject: [PATCH 1/3] Initial plan From 21c02c3f628b296762eae332634fcbff319e483c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:32:14 +0000 Subject: [PATCH 2/3] Fix enum mismatches: add SKIP to TableMode, DEBUG to LogLevel, handle SKIP in JobService, expand EnumAlignmentTest Agent-Logs-Url: https://github.com/MaximumTrainer/OpenDataMask/sessions/d8086b3c-abf3-447b-8c14-a69157dfed83 Co-authored-by: MaximumTrainer <1376575+MaximumTrainer@users.noreply.github.com> --- .../kotlin/com/opendatamask/model/JobLog.kt | 2 +- .../opendatamask/model/TableConfiguration.kt | 2 +- .../com/opendatamask/service/JobService.kt | 3 ++ .../opendatamask/model/EnumAlignmentTest.kt | 33 +++++++++++++++++-- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/backend/src/main/kotlin/com/opendatamask/model/JobLog.kt b/backend/src/main/kotlin/com/opendatamask/model/JobLog.kt index 8be795e..f933112 100644 --- a/backend/src/main/kotlin/com/opendatamask/model/JobLog.kt +++ b/backend/src/main/kotlin/com/opendatamask/model/JobLog.kt @@ -4,7 +4,7 @@ import jakarta.persistence.* import java.time.LocalDateTime enum class LogLevel { - INFO, WARN, ERROR + DEBUG, INFO, WARN, ERROR } @Entity diff --git a/backend/src/main/kotlin/com/opendatamask/model/TableConfiguration.kt b/backend/src/main/kotlin/com/opendatamask/model/TableConfiguration.kt index c1f1f1a..00b1bfe 100644 --- a/backend/src/main/kotlin/com/opendatamask/model/TableConfiguration.kt +++ b/backend/src/main/kotlin/com/opendatamask/model/TableConfiguration.kt @@ -4,7 +4,7 @@ import jakarta.persistence.* import java.time.LocalDateTime enum class TableMode { - PASSTHROUGH, MASK, GENERATE, SUBSET + PASSTHROUGH, MASK, GENERATE, SUBSET, SKIP } @Entity diff --git a/backend/src/main/kotlin/com/opendatamask/service/JobService.kt b/backend/src/main/kotlin/com/opendatamask/service/JobService.kt index d8659be..574b737 100644 --- a/backend/src/main/kotlin/com/opendatamask/service/JobService.kt +++ b/backend/src/main/kotlin/com/opendatamask/service/JobService.kt @@ -194,6 +194,9 @@ class JobService( val written = destConnector.writeData(tableConfig.tableName, data) addLog(jobId, "Wrote $written rows to destination ${tableConfig.tableName}", LogLevel.INFO) } + TableMode.SKIP -> { + addLog(jobId, "Skipping table: ${tableConfig.tableName}", LogLevel.INFO) + } } } diff --git a/backend/src/test/kotlin/com/opendatamask/model/EnumAlignmentTest.kt b/backend/src/test/kotlin/com/opendatamask/model/EnumAlignmentTest.kt index 83a6ab8..c01bbae 100644 --- a/backend/src/test/kotlin/com/opendatamask/model/EnumAlignmentTest.kt +++ b/backend/src/test/kotlin/com/opendatamask/model/EnumAlignmentTest.kt @@ -21,8 +21,37 @@ class EnumAlignmentTest { } @Test - fun `WorkspaceRole contains VIEWER`() { + fun `UserRole contains canonical set`() { + val values = UserRole.values().map { it.name }.toSet() + val expected = setOf("ADMIN", "USER", "VIEWER") + assertEquals(expected, values, "UserRole values do not match canonical set") + } + + @Test + fun `WorkspaceRole contains canonical set`() { val values = WorkspaceRole.values().map { it.name }.toSet() - assertTrue(values.contains("VIEWER"), "WorkspaceRole must contain VIEWER") + val expected = setOf("ADMIN", "USER", "VIEWER") + assertEquals(expected, values, "WorkspaceRole values do not match canonical set") + } + + @Test + fun `TableMode contains canonical set`() { + val values = TableMode.values().map { it.name }.toSet() + val expected = setOf("PASSTHROUGH", "MASK", "GENERATE", "SUBSET", "SKIP") + assertEquals(expected, values, "TableMode values do not match canonical set") + } + + @Test + fun `LogLevel contains canonical set`() { + val values = LogLevel.values().map { it.name }.toSet() + val expected = setOf("DEBUG", "INFO", "WARN", "ERROR") + assertEquals(expected, values, "LogLevel values do not match canonical set") + } + + @Test + fun `JobStatus contains canonical set`() { + val values = JobStatus.values().map { it.name }.toSet() + val expected = setOf("PENDING", "RUNNING", "COMPLETED", "FAILED", "CANCELLED") + assertEquals(expected, values, "JobStatus values do not match canonical set") } } From dbb638a5ae839b1c785780116e421bb38c11bb40 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 17:32:37 +0000 Subject: [PATCH 3/3] Fix SKIP mode to also bypass schema mirroring in runJob loop Agent-Logs-Url: https://github.com/MaximumTrainer/OpenDataMask/sessions/a02683db-177a-4aa6-bc70-1d0eac17c259 Co-authored-by: MaximumTrainer <1376575+MaximumTrainer@users.noreply.github.com> --- .../src/main/kotlin/com/opendatamask/service/JobService.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/com/opendatamask/service/JobService.kt b/backend/src/main/kotlin/com/opendatamask/service/JobService.kt index 574b737..8f0c185 100644 --- a/backend/src/main/kotlin/com/opendatamask/service/JobService.kt +++ b/backend/src/main/kotlin/com/opendatamask/service/JobService.kt @@ -123,6 +123,10 @@ class JobService( addLog(job.id, "Processing ${tableConfigs.size} table(s)", LogLevel.INFO) for (tableConfig in tableConfigs) { + if (tableConfig.mode == TableMode.SKIP) { + addLog(job.id, "Skipping table: ${tableConfig.tableName}", LogLevel.INFO) + continue + } addLog(job.id, "Mirroring schema for table: ${tableConfig.tableName}", LogLevel.INFO) destinationSchemaService.mirrorSchema( sourceConnector, sourceConn.type, @@ -195,7 +199,7 @@ class JobService( addLog(jobId, "Wrote $written rows to destination ${tableConfig.tableName}", LogLevel.INFO) } TableMode.SKIP -> { - addLog(jobId, "Skipping table: ${tableConfig.tableName}", LogLevel.INFO) + // unreachable: SKIP tables are short-circuited in the calling loop } } }