Skip to content

Align TableMode and LogLevel enums between frontend and backend#21

Merged
MaximumTrainer merged 3 commits intomainfrom
copilot/fix-type-mismatches-between-frontend-backend
Apr 1, 2026
Merged

Align TableMode and LogLevel enums between frontend and backend#21
MaximumTrainer merged 3 commits intomainfrom
copilot/fix-type-mismatches-between-frontend-backend

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

  • Analyze existing state of frontend and backend enums
  • Add SKIP to backend TableMode enum (TableConfiguration.kt)
  • Add DEBUG to backend LogLevel enum (JobLog.kt)
  • Handle TableMode.SKIP in JobService.kt — short-circuit the table loop to skip both schema mirroring and data processing
  • Expand EnumAlignmentTest.kt to cover all enum alignments
  • Run backend tests — all 7 EnumAlignmentTest tests pass

Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
… 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>
Copilot AI changed the title [WIP] Fix frontend and backend type mismatches in connection types Align TableMode and LogLevel enums between frontend and backend Apr 1, 2026
Copilot AI requested a review from MaximumTrainer April 1, 2026 16:32
@MaximumTrainer MaximumTrainer requested review from Copilot and removed request for MaximumTrainer April 1, 2026 16:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Aligns backend enum definitions with the frontend to prevent enum deserialization/persistence failures (HTTP 400s) when the UI sends newer enum values, and strengthens CI coverage to catch future enum drift.

Changes:

  • Added missing enum values on backend: TableMode.SKIP and LogLevel.DEBUG.
  • Updated job processing logic to handle TableMode.SKIP explicitly.
  • Strengthened EnumAlignmentTest to assert exact canonical enum value sets across multiple enums.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
backend/src/main/kotlin/com/opendatamask/model/TableConfiguration.kt Adds SKIP to TableMode to match frontend values.
backend/src/main/kotlin/com/opendatamask/model/JobLog.kt Adds DEBUG to LogLevel to match frontend values.
backend/src/main/kotlin/com/opendatamask/service/JobService.kt Adds SKIP handling branch when processing a table.
backend/src/test/kotlin/com/opendatamask/model/EnumAlignmentTest.kt Replaces a weak containment assertion with exact-set assertions for several enums.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

addLog(jobId, "Wrote $written rows to destination ${tableConfig.tableName}", LogLevel.INFO)
}
TableMode.SKIP -> {
addLog(jobId, "Skipping table: ${tableConfig.tableName}", LogLevel.INFO)
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

TableMode.SKIP only skips the data-processing step in processTable, but runJob still calls destinationSchemaService.mirrorSchema(...) for every table before processTable runs. As a result, a “skipped” table will still have its schema created/updated in the destination, which contradicts the log message and likely the intent of SKIP. Consider short-circuiting earlier (e.g., in the table loop) so SKIP avoids schema mirroring as well, or adjust the logging/semantics to make it explicit that schema is still mirrored.

Suggested change
addLog(jobId, "Skipping table: ${tableConfig.tableName}", LogLevel.INFO)
addLog(
jobId,
"Skipping data processing for table: ${tableConfig.tableName} (schema may still be mirrored)",
LogLevel.INFO
)

Copilot uses AI. Check for mistakes.
@MaximumTrainer
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Done in dbb638a. The SKIP check now short-circuits at the top of the table loop in runJob, so both mirrorSchema and processTable are bypassed for skipped tables. The SKIP branch in processTable is kept (Kotlin requires it for exhaustiveness) but marked unreachable.

Copilot AI requested a review from MaximumTrainer April 1, 2026 17:33
@MaximumTrainer MaximumTrainer marked this pull request as ready for review April 1, 2026 18:11
@MaximumTrainer MaximumTrainer merged commit 950fe75 into main Apr 1, 2026
6 of 7 checks passed
@MaximumTrainer MaximumTrainer deleted the copilot/fix-type-mismatches-between-frontend-backend branch April 1, 2026 18:12
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.

Frontend ↔ Backend Type Mismatches

3 participants