Skip to content

feat: extend db enum check support to remaining enum-backed columns#306

Open
niazkhansap wants to merge 1 commit into
mainfrom
task/extend-enum-check-support
Open

feat: extend db enum check support to remaining enum-backed columns#306
niazkhansap wants to merge 1 commit into
mainfrom
task/extend-enum-check-support

Conversation

@niazkhansap

@niazkhansap niazkhansap commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@niazkhansap
niazkhansap force-pushed the task/extend-enum-check-support branch from e28b4a0 to d8bab29 Compare July 1, 2026 16:40
@niazkhansap niazkhansap self-assigned this Jul 2, 2026
@openkcm openkcm deleted a comment from coderabbitai Bot Jul 2, 2026
@openkcm openkcm deleted a comment from coderabbitai Bot Jul 2, 2026
@niazkhansap

Copy link
Copy Markdown
Contributor Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
✅ Action performed

Summary regeneration triggered.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2a2787d-4817-405d-b84e-bc76d18816f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The PR adds database serialization hooks for new enum-like types, updates model and workflow fields to typed enum values, propagates those types through transforms, managers, controllers, and tests, and adds PostgreSQL CHECK constraints plus migration coverage for the enum-backed columns.

Changes

Typed Enum Migration

Layer / File(s) Summary
cmkapi enum Value/Scan implementations and tests
internal/api/cmkapi/enum_db.go, internal/api/cmkapi/enum_db_test.go
Adds invalid-value errors and database Value/Scan hooks for cmkapi key and wrapping enum types, with shared value-test scaffolding and enum coverage.
Model enum definitions and fields
internal/model/system.go, internal/model/certificate.go, internal/model/importparams.go, internal/model/key.go, internal/model/workflow.go, internal/workflow/types.go, internal/constants/api.go
Adds model enum types for system, certificate, import, and workflow fields, updates model struct field types, and removes duplicated workflow FSM enum surface.
Transform layer enum assignments
internal/api/transform/key/..., internal/api/transform/system/..., internal/api/transform/workflow/..., internal/api/transform/importparams/...
Updates key, byok, hyokkey, system, workflow, and importparams transforms and tests to pass typed enum values directly or stringify them explicitly where required.
Registry systems SystemType alias
internal/clients/registry/systems/enums.go, mapper.go, mapper_test.go
Aliases registry systems SystemType to model.SystemType and updates mapper behavior and tests to use the typed value directly.
Manager key and import flows
internal/manager/key.go, importparams.go, providerconfigmanager.go, tenantconfigs.go, workflow.go
Replaces constants-based key-type handling with cmkapi enum comparisons across key, import params, provider config, tenant config, and workflow manager code.
Manager key and workflow fixtures
internal/manager/key_test.go, keyconfiguration_test.go, providerconfigmanager_test.go, importparams_test.go, workflow_test.go
Updates key, keyconfiguration, provider-config, import-params, and workflow tests to use typed cmkapi values and BYOK helper creation paths.
System manager and event-processor updates
internal/manager/system.go, systeminformation.go, internal/event-processor/*, internal/model/log.go, tests
Adjusts system type stringification and typed SystemType fixtures across manager, event-processor, logging, and reconciliation tests.
Workflow FSM type cleanup
internal/workflow/types.go, internal/controllers/cmk/workflow_controller_test.go, internal/model/workflow_test.go
Moves workflow parameter resource typing into model enums and updates workflow controller and workflow tests to use the new model values.
Controller and security test fixtures
internal/controllers/cmk/key_controller.go, internal/controllers/cmk/key_controller_test.go, internal/authz/policy_tests/hyok_sync_test.go, test/integration/event-processor/reconciliation_test.go, test/security/xss/key_controller_test.go
Updates key controller, authz, integration, and XSS tests to use cmkapi typed key values directly and remove constants-based setup.
Database CHECK constraints and migration tests
migrations/tenant/schema/00014_add_more_enum_check_constraints.sql, test/db-migration/migration_test.go
Adds enum-style CHECK constraints for keys, import_params, workflows, systems, and certificates, and updates migration tests for the new version.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@niazkhansap

Copy link
Copy Markdown
Contributor Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
✅ Action performed

Summary regeneration triggered.

@niazkhansap
niazkhansap force-pushed the task/extend-enum-check-support branch 2 times, most recently from 3ffec30 to 6efe517 Compare July 7, 2026 11:19
Comment thread test/db-migration/migration_test.go Outdated
@niazkhansap
niazkhansap force-pushed the task/extend-enum-check-support branch from 6efe517 to 38d06bd Compare July 9, 2026 12:17
@niazkhansap

Copy link
Copy Markdown
Contributor Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
✅ Action performed

Summary regeneration triggered.

Signed-off-by: Niaz Khan <niazkhansap@gmail.com>
@niazkhansap
niazkhansap force-pushed the task/extend-enum-check-support branch from 38d06bd to 2f87dc3 Compare July 14, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants