Skip to content

Move ontology/glossary relation migration from 1.14.0 back to 1.13.0#27431

Merged
sonika-shah merged 7 commits intomainfrom
move-ontology-migration-to-1.13.0
Apr 16, 2026
Merged

Move ontology/glossary relation migration from 1.14.0 back to 1.13.0#27431
sonika-shah merged 7 commits intomainfrom
move-ontology-migration-to-1.13.0

Conversation

@sonika-shah
Copy link
Copy Markdown
Collaborator

@sonika-shah sonika-shah commented Apr 16, 2026

Summary

  • Move glossary term relation migrations from 1.14.0 back to 1.13.0 since the ontology feature will ship in 1.13.0
  • Migrations moved: relationType backfill, glossaryTermRelationSettings insert, stale relatedTerms strip, conceptMappings backfill
  • Removes the now-empty 1.14.0 migration directory
  • Both MySQL and PostgreSQL scripts updated

Context

The ontology migration was originally added in 1.13.0 (#25886), reverted, then moved to 1.14.0 (#26755). Since we're releasing in 1.13.0, this moves it back with all accumulated fixes (design system colors from #27142, stale relatedTerms strip from #26586).

Test plan

  • Verify 1.13.0 MySQL migration runs cleanly on a fresh database
  • Verify 1.13.0 PostgreSQL migration runs cleanly on a fresh database
  • Verify no 1.14.0 migration directory remains
  • Verify glossary term relations work end-to-end after migration

Ontology feature will ship in 1.13.0, not 1.14.0. Move the glossary term
relation migrations (relationType backfill, settings insert, stale
relatedTerms strip, conceptMappings backfill) back to the 1.13.0
postDataMigrationSQLScript for both MySQL and PostgreSQL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 16, 2026 10:35
@github-actions github-actions bot added backend safe to test Add this label to run secure Github workflows on PRs labels Apr 16, 2026
Comment thread bootstrap/sql/migrations/native/1.13.0/postgres/postDataMigrationSQLScript.sql Outdated
Copy link
Copy Markdown
Contributor

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

This PR moves the glossary term relation/ontology data migration steps from the 1.14.0 native migrations back into 1.13.0, aligning the DB migration timeline with the planned feature release in 1.13.0.

Changes:

  • Removed the glossary relation post-data migration SQL from bootstrap/sql/migrations/native/1.14.0 (MySQL + PostgreSQL).
  • Added the same glossary relation migration steps into bootstrap/sql/migrations/native/1.13.0/postDataMigrationSQLScript.sql (MySQL + PostgreSQL).
  • Eliminated the now-unused 1.14.0 native migration directory content (and the directory no longer exists in the updated tree).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
bootstrap/sql/migrations/native/1.14.0/postgres/postDataMigrationSQLScript.sql Removed glossary-relation post-data migration content (migration moved earlier).
bootstrap/sql/migrations/native/1.14.0/mysql/postDataMigrationSQLScript.sql Removed glossary-relation post-data migration content (migration moved earlier).
bootstrap/sql/migrations/native/1.13.0/postgres/postDataMigrationSQLScript.sql Added glossary term relation backfill/cleanup/settings insert steps to run in 1.13.0.
bootstrap/sql/migrations/native/1.13.0/mysql/postDataMigrationSQLScript.sql Added glossary term relation backfill/cleanup/settings insert steps to run in 1.13.0.

sonika-shah and others added 2 commits April 16, 2026 16:11
The V114 MigrationUtil.java package requires the 1.14.0 migration
directory to exist with SQL files for the migration to be picked up.
Keep them as empty files (matching convention of other versions with
no post-data SQL).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add both schemaChanges.sql and postDataMigrationSQLScript.sql for
mysql and postgres with a comment explaining the directory is required
for the V114 Java migrations to be picked up by the migration framework.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 16, 2026 10:42
@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 16, 2026

Reviewing your code

Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Migration files for ontology and glossary relations are backported to version 1.13.0 as requested. Ensure trailing newlines are added to the end of both the PostgreSQL and MySQL scripts.

💡 Quality: Missing newline at end of both migration files

📄 bootstrap/sql/migrations/native/1.13.0/postgres/postDataMigrationSQLScript.sql:88 📄 bootstrap/sql/migrations/native/1.13.0/mysql/postDataMigrationSQLScript.sql:86

Both the PostgreSQL (line 88) and MySQL (line 86) migration scripts are missing a trailing newline. This is indicated by the \ No newline at end of file marker in the diff for the Postgres file, and the MySQL file similarly ends without one. While not a functional issue, most editors and POSIX tools expect text files to end with a newline, and it can cause noisy diffs when content is appended later (as seen in this very PR where the existing Postgres file lacked a trailing newline).

Suggested fix
Add a trailing newline to the end of both files.
🤖 Prompt for agents
Code Review: Migration files for ontology and glossary relations are backported to version 1.13.0 as requested. Ensure trailing newlines are added to the end of both the PostgreSQL and MySQL scripts.

1. 💡 Quality: Missing newline at end of both migration files
   Files: bootstrap/sql/migrations/native/1.13.0/postgres/postDataMigrationSQLScript.sql:88, bootstrap/sql/migrations/native/1.13.0/mysql/postDataMigrationSQLScript.sql:86

   Both the PostgreSQL (line 88) and MySQL (line 86) migration scripts are missing a trailing newline. This is indicated by the `\ No newline at end of file` marker in the diff for the Postgres file, and the MySQL file similarly ends without one. While not a functional issue, most editors and POSIX tools expect text files to end with a newline, and it can cause noisy diffs when content is appended later (as seen in this very PR where the existing Postgres file lacked a trailing newline).

   Suggested fix:
   Add a trailing newline to the end of both files.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread bootstrap/sql/migrations/native/1.14.0/mysql/schemaChanges.sql Outdated
Comment thread bootstrap/sql/migrations/native/1.14.0/mysql/postDataMigrationSQLScript.sql Outdated
Comment thread bootstrap/sql/migrations/native/1.14.0/postgres/schemaChanges.sql Outdated
Comment thread bootstrap/sql/migrations/native/1.14.0/postgres/postDataMigrationSQLScript.sql Outdated
yan-3005
yan-3005 previously approved these changes Apr 16, 2026
@yan-3005 yan-3005 enabled auto-merge (squash) April 16, 2026 14:12
@sonika-shah sonika-shah disabled auto-merge April 16, 2026 14:31
Copilot AI review requested due to automatic review settings April 16, 2026 14:45
@sonika-shah sonika-shah enabled auto-merge (squash) April 16, 2026 14:49
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

-- Old data stored relatedTerms as EntityReference objects which fail to deserialize as TermRelation.
UPDATE glossary_term_entity
SET json = JSON_REMOVE(json, '$.relatedTerms')
WHERE JSON_EXTRACT(json, '$.relatedTerms') IS NOT NULL;
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

In MySQL, WHERE JSON_EXTRACT(json, '$.relatedTerms') IS NOT NULL will not match rows where relatedTerms exists but is JSON null, so the key won’t be removed (unlike the Postgres migration, which removes the key whenever it exists). To reliably strip the field whenever present, use a key-existence predicate (e.g., JSON_CONTAINS_PATH(json, 'one', '$.relatedTerms')) rather than checking the extracted value for NULL.

Suggested change
WHERE JSON_EXTRACT(json, '$.relatedTerms') IS NOT NULL;
WHERE JSON_CONTAINS_PATH(json, 'one', '$.relatedTerms');

Copilot uses AI. Check for mistakes.
-- Backfill conceptMappings for existing glossary terms
UPDATE glossary_term_entity
SET json = jsonb_set(COALESCE(json::jsonb, '{}'::jsonb), '{conceptMappings}', '[]'::jsonb)
WHERE json IS NULL OR json::jsonb->'conceptMappings' IS NULL;
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Postgres backfill for conceptMappings only checks json IS NULL OR json::jsonb->'conceptMappings' IS NULL. If the key exists but is explicitly set to JSON null, -> returns a JSON null value (not SQL NULL) and this condition won’t run, leaving conceptMappings as null. Consider also handling the JSON-null case so all existing terms end up with an array (e.g., treat JSON null the same as missing).

Suggested change
WHERE json IS NULL OR json::jsonb->'conceptMappings' IS NULL;
WHERE json IS NULL
OR json::jsonb->'conceptMappings' IS NULL
OR jsonb_typeof(json::jsonb->'conceptMappings') = 'null';

Copilot uses AI. Check for mistakes.
@sonika-shah sonika-shah merged commit 077982c into main Apr 16, 2026
41 checks passed
@sonika-shah sonika-shah deleted the move-ontology-migration-to-1.13.0 branch April 16, 2026 16:45
@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (30 flaky)

✅ 3629 passed · ❌ 0 failed · 🟡 30 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 472 0 8 4
🟡 Shard 2 644 0 3 7
🟡 Shard 3 647 0 5 1
🟡 Shard 4 621 0 5 27
🟡 Shard 5 612 0 2 42
🟡 Shard 6 633 0 7 8
🟡 30 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the ApiEndpoint entity item action after rules disabled (shard 1, 1 retry)
  • Features/CustomizeDetailPage.spec.ts › Topic - customization should work (shard 1, 1 retry)
  • Features/CustomizeDetailPage.spec.ts › Ml Model - customization should work (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from help section (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from welcome screen (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from URL directly (shard 1, 1 retry)
  • Pages/Customproperties-part1.spec.ts › sqlQuery shows scrollable CodeMirror container and no expand toggle (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should inherit reviewers from glossary when term is created (shard 2, 1 retry)
  • Features/IncidentManager.spec.ts › Complete Incident lifecycle with table owner (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show online status badge on user profile for active users (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/DomainAdvanced.spec.ts › Filter assets by domain from explore page (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Should clear assets from data products after deletion of data product in Domain (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Multiple consecutive domain renames preserve all associations (shard 4, 1 retry)
  • Pages/EntityDataSteward.spec.ts › User as Owner Add, Update and Remove (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Container (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Inactive Announcement create & delete (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

yan-3005 pushed a commit that referenced this pull request Apr 16, 2026
…27431)

* Move ontology/glossary relation migration from 1.14.0 back to 1.13.0

Ontology feature will ship in 1.13.0, not 1.14.0. Move the glossary term
relation migrations (relationType backfill, settings insert, stale
relatedTerms strip, conceptMappings backfill) back to the 1.13.0
postDataMigrationSQLScript for both MySQL and PostgreSQL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Restore empty 1.14.0 SQL migration files for Java migration framework

The V114 MigrationUtil.java package requires the 1.14.0 migration
directory to exist with SQL files for the migration to be picked up.
Keep them as empty files (matching convention of other versions with
no post-data SQL).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add schemaChanges.sql and comment all 1.14.0 SQL migration files

Add both schemaChanges.sql and postDataMigrationSQLScript.sql for
mysql and postgres with a comment explaining the directory is required
for the V114 Java migrations to be picked up by the migration framework.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix missing trailing newline in postgres postDataMigrationSQLScript

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* address feedback

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>

(cherry picked from commit 077982c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants