feat(migration): add webhook secretKey to authType migration in v1130#27438
feat(migration): add webhook secretKey to authType migration in v1130#27438
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a v1130 data migration to move legacy webhook secretKey configuration into the newer authType structure for event subscription webhook destinations, and introduces unit tests to validate the migration behavior across MySQL/Postgres.
Changes:
- Add
migrateWebhookSecretKeyToAuthType(Handle)to v1130MigrationUtilto rewrite webhook destination config fromsecretKey→authType: { type: bearer, secretKey }. - Invoke the new migration from both MySQL and Postgres v1130 migration runners with error logging.
- Add a v1130 migration unit test suite covering no-op and migration paths for MySQL/Postgres SQL updates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v1130/MigrationUtil.java | Implements the webhook secretKey → authType JSON rewrite + DB update logic. |
| openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v1130/Migration.java | Wires the new migration step into the Postgres v1130 data migration flow. |
| openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v1130/Migration.java | Wires the new migration step into the MySQL v1130 data migration flow. |
| openmetadata-service/src/test/java/org/openmetadata/service/migration/utils/v1130/MigrationUtilTest.java | Adds tests validating the migration behavior and SQL selection for MySQL vs Postgres. |
Code Review ✅ Approved 1 resolved / 1 findingsAdds webhook secretKey support to the v1130 authType migration and includes a new idempotency test, addressing the previously missing coverage for already-migrated rows. ✅ 1 resolved✅ Edge Case: Missing idempotency test for already-migrated rows
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
🟡 Playwright Results — all passed (21 flaky)✅ 3638 passed · ❌ 0 failed · 🟡 21 flaky · ⏭️ 89 skipped
🟡 21 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…#27438) * feat(migration): add webhook secretKey to authType migration in v1130 * test(migration): add idempotency test for already-migrated webhook rows in v1130



Summary
On the 1.12.5 branch,
migrateWebhookSecretKeyToAuthTypewas incorrectly cherry-picked from the certification refactor, causing Jackson deserialization failures sincewebhook.jsonon 1.12.x had noauthTypefield. That migration was removed from v1125 and a reverse migration was added in v1126 to fix users who had already upgraded.This PR ensures users who were on 1.12.4 or older and upgrade directly to 1.13 (skipping 1.12.5 entirely) still get the webhook migration. It adds
migrateWebhookSecretKeyToAuthTypeto the v1130 migration, which converts:→
This is the correct canonical format on main/1.13 —
SubscriptionUtil,WebhookRecipient, andFernetall readauthTypefrom the webhook config.The migration is idempotent: rows that already have
authType(nosecretKey) are skipped.Changes
v1130/MigrationUtil.java— addedmigrateWebhookSecretKeyToAuthType(Handle handle)mysql/v1130/Migration.java+postgres/v1130/Migration.java— call the new method inrunDataMigration()v1130/MigrationUtilTest.java— 6 unit tests covering: no rows, no secretKey, empty secretKey, non-webhook destination, MySQL path (JSON + SQL verified), Postgres path (JSON + SQL verified)Type of change
Checklist