Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1ee954f
fix glossary status
Jan 21, 2026
0b42105
add glossaryTerm spec
Jan 21, 2026
4c7d2eb
fix: improve ListFilter implementation in list filtering logic
gitar-bot Jan 21, 2026
085a31e
reset main backend
Jan 21, 2026
b4a881c
reset backend
Jan 21, 2026
ad20a92
fix be
Jan 22, 2026
6b037d3
rever
Jan 22, 2026
6b433b7
spottless
Jan 22, 2026
f81b5e6
Fix GlossrayTerm search api endpoint
yan-3005 Jan 22, 2026
3857382
Merge branch 'main' into sid/fix-status-glossary
yan-3005 Jan 22, 2026
90c791e
status enum validation
yan-3005 Jan 22, 2026
83dd11e
fix spec
Jan 22, 2026
83a0a7b
Merge branch 'sid/fix-status-glossary' of https://github.com/open-met…
Jan 22, 2026
b3cb08e
Replace quotes, validate enum
yan-3005 Jan 22, 2026
d981608
Merge branch 'main' into sid/fix-status-glossary
yan-3005 Jan 22, 2026
6fc6a60
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Jan 23, 2026
8fe4dbf
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Jan 23, 2026
c64787d
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Jan 24, 2026
433b3ab
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Jan 25, 2026
6a6bd19
bind param queries
yan-3005 Jan 25, 2026
3038077
Merge branch 'main' into sid/fix-status-glossary
yan-3005 Jan 25, 2026
cdbe7e5
Merge branch 'main' into sid/fix-status-glossary
harshach Jan 25, 2026
3709c6d
Merge branch 'main' into sid/fix-status-glossary
sonika-shah Feb 25, 2026
e80cc36
Move migrations to 1.12.0
sonika-shah Feb 25, 2026
7618a04
Merge branch 'main' into sid/fix-status-glossary
sonika-shah Feb 26, 2026
a336e28
fix api docs
sonika-shah Feb 26, 2026
786a44a
optimize performance of fallback , refactoring
sonika-shah Feb 26, 2026
c94738c
fix ListFilter
sonika-shah Feb 26, 2026
d1afd00
Merge branch 'main' into sid/fix-status-glossary
sonika-shah Feb 26, 2026
c42e0fd
Merge branch 'main' into sid/fix-status-glossary
sonika-shah Feb 26, 2026
0a3365f
Merge branch 'main' into sid/fix-status-glossary
sonika-shah Feb 27, 2026
5cc9051
GlossaryTermService.java cleanup
sonika-shah Feb 27, 2026
d9f0301
address gitar-bot feedback
sonika-shah Feb 27, 2026
6ca0e7e
add entityStatus param in list api
sonika-shah Feb 27, 2026
5ce6520
add entityStatus param in list api
sonika-shah Feb 27, 2026
759fb1a
Send entityStatus param with both search and list glossary term APIs
Feb 27, 2026
fed72f2
update list API path (ListFilter.getEntityStatusCondition) to validat…
sonika-shah Feb 27, 2026
83d2e15
fix playwright
sonika-shah Mar 1, 2026
2fcae44
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 1, 2026
8d5f3cc
Fix rejected glossary term staying visible in listing
Mar 2, 2026
2b9e5b6
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 2, 2026
4a7caa8
add initian load
Mar 2, 2026
58629fb
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 2, 2026
f42fa77
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 4, 2026
dd53cf5
Fix Expand All ignoring active status filter and add E2E tests
Mar 4, 2026
ea80cb8
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 4, 2026
5943b97
Rewrite Glossary Expand All E2E tests to follow Playwright handbook p…
Mar 4, 2026
61649be
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 4, 2026
3fde45a
Fix flaky GlossaryPagination test by scoping locators to glossary table
Mar 4, 2026
0cf157c
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 4, 2026
4d5e7e7
Fix Expand All to fetch children irrespective of entity status filter
Mar 4, 2026
dc2234d
Merge branch 'main' into sid/fix-status-glossary
siddhant1 Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bootstrap/sql/migrations/native/1.12.2/mysql/schemaChanges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ CREATE INDEX idx_data_quality_data_ts_keyset ON data_quality_data_time_series(ti
CREATE INDEX idx_test_case_resolution_status_ts_keyset ON test_case_resolution_status_time_series(timestamp, entityFQNHash);

CREATE INDEX idx_query_cost_ts_keyset ON query_cost_time_series(timestamp, entityFQNHash);

-- Add entityStatus generated column to glossary_term_entity table for efficient filtering
-- This supports the entityStatus filtering in the search API endpoint
ALTER TABLE glossary_term_entity
Comment thread
sonika-shah marked this conversation as resolved.
Resolved
ADD COLUMN entityStatus VARCHAR(32)
GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.entityStatus')))
STORED;

-- Add index for efficient entityStatus filtering
CREATE INDEX idx_glossary_term_entity_status ON glossary_term_entity (entityStatus);
10 changes: 10 additions & 0 deletions bootstrap/sql/migrations/native/1.12.2/postgres/schemaChanges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ CREATE INDEX IF NOT EXISTS idx_test_case_resolution_status_ts_keyset

CREATE INDEX IF NOT EXISTS idx_query_cost_ts_keyset
ON query_cost_time_series(timestamp, entityFQNHash);

-- Add entityStatus generated column to glossary_term_entity table for efficient filtering
-- This supports the entityStatus filtering in the search API endpoint
ALTER TABLE glossary_term_entity
ADD COLUMN IF NOT EXISTS entityStatus VARCHAR(32)
GENERATED ALWAYS AS (json ->> 'entityStatus')
STORED;

-- Add index for efficient entityStatus filtering
CREATE INDEX IF NOT EXISTS idx_glossary_term_entity_status ON glossary_term_entity (entityStatus);
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.openmetadata.schema.entity.data.Glossary;
import org.openmetadata.schema.entity.data.GlossaryTerm;
import org.openmetadata.schema.type.EntityHistory;
import org.openmetadata.schema.type.EntityStatus;
import org.openmetadata.schema.utils.ResultList;
import org.openmetadata.sdk.client.OpenMetadataClient;
import org.openmetadata.sdk.models.ListParams;
import org.openmetadata.sdk.models.ListResponse;
Expand Down Expand Up @@ -2146,4 +2148,260 @@ void test_glossaryTermOwnersUpdate(TestNamespace ns) {
assertEquals(1, updated.getOwners().size());
assertEquals(testUser2().getId(), updated.getOwners().get(0).getId());
}

/**
* Helper method to search glossary terms with pagination and filters.
* This is test-only code that directly calls the search API endpoint.
*/
private ResultList<GlossaryTerm> searchGlossaryTerms(
OpenMetadataClient client,
String query,
String glossaryFqn,
String entityStatus,
Integer limit,
Integer offset) {
org.openmetadata.sdk.network.RequestOptions.Builder optionsBuilder =
org.openmetadata.sdk.network.RequestOptions.builder();

if (query != null) {
optionsBuilder.queryParam("q", query);
}
if (glossaryFqn != null) {
optionsBuilder.queryParam("glossaryFqn", glossaryFqn);
}
if (entityStatus != null) {
optionsBuilder.queryParam("entityStatus", entityStatus);
}
if (limit != null) {
optionsBuilder.queryParam("limit", limit.toString());
}
if (offset != null) {
optionsBuilder.queryParam("offset", offset.toString());
}

return client
.getHttpClient()
.execute(
org.openmetadata.sdk.network.HttpMethod.GET,
"/v1/glossaryTerms/search",
null,
GlossaryTermResultList.class,
optionsBuilder.build());
}

/** Result list type for deserializing glossary term search results. */
private static class GlossaryTermResultList extends ResultList<GlossaryTerm> {}

@Test
void test_listGlossaryTermsWithEntityStatusFilter(TestNamespace ns) {
OpenMetadataClient client = SdkClients.adminClient();

// Create a dedicated glossary for this test
CreateGlossary createGlossary =
new CreateGlossary()
.withName(ns.prefix("status_list_glossary"))
.withDescription("Glossary for entityStatus list filter test");
Glossary glossary = client.glossaries().create(createGlossary);

// Create two terms - both start as APPROVED (default status when no reviewers)
CreateGlossaryTerm request1 =
new CreateGlossaryTerm()
.withName(ns.prefix("list_approved_term"))
.withGlossary(glossary.getFullyQualifiedName())
.withDescription("Term that will stay approved");
GlossaryTerm approvedTerm = createEntity(request1);
assertEquals(EntityStatus.APPROVED, approvedTerm.getEntityStatus());

CreateGlossaryTerm request2 =
new CreateGlossaryTerm()
.withName(ns.prefix("list_draft_term"))
.withGlossary(glossary.getFullyQualifiedName())
.withDescription("Term that will be changed to draft");
GlossaryTerm draftTerm = createEntity(request2);
assertEquals(EntityStatus.APPROVED, draftTerm.getEntityStatus());

// Update second term to DRAFT status
draftTerm.setEntityStatus(EntityStatus.DRAFT);
GlossaryTerm updatedDraftTerm = client.glossaryTerms().update(draftTerm.getId(), draftTerm);
assertEquals(EntityStatus.DRAFT, updatedDraftTerm.getEntityStatus());

// List with APPROVED status filter - only approved term should be returned
ListParams approvedParams = new ListParams();
approvedParams.setLimit(100);
approvedParams.addQueryParam("glossary", glossary.getId().toString());
approvedParams.addQueryParam("entityStatus", EntityStatus.APPROVED.value());
ListResponse<GlossaryTerm> approvedTerms = client.glossaryTerms().list(approvedParams);

assertNotNull(approvedTerms);
assertNotNull(approvedTerms.getData());
java.util.List<GlossaryTerm> ourApprovedTerms =
approvedTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedDraftTerm.getName()))
.toList();
assertEquals(1, ourApprovedTerms.size(), "Only approved term should be returned from list API");
assertEquals(approvedTerm.getName(), ourApprovedTerms.getFirst().getName());

// List with DRAFT status filter - only draft term should be returned
ListParams draftParams = new ListParams();
draftParams.setLimit(100);
draftParams.addQueryParam("glossary", glossary.getId().toString());
draftParams.addQueryParam("entityStatus", EntityStatus.DRAFT.value());
ListResponse<GlossaryTerm> draftTerms = client.glossaryTerms().list(draftParams);

assertNotNull(draftTerms);
assertNotNull(draftTerms.getData());
java.util.List<GlossaryTerm> ourDraftTerms =
draftTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedDraftTerm.getName()))
.toList();
assertEquals(1, ourDraftTerms.size(), "Only draft term should be returned from list API");
assertEquals(updatedDraftTerm.getName(), ourDraftTerms.getFirst().getName());

// List with multiple status filter (APPROVED,DRAFT) - both terms should be returned
ListParams multiParams = new ListParams();
multiParams.setLimit(100);
multiParams.addQueryParam("glossary", glossary.getId().toString());
multiParams.addQueryParam("entityStatus", "Approved,Draft");
ListResponse<GlossaryTerm> multiStatusTerms = client.glossaryTerms().list(multiParams);

assertNotNull(multiStatusTerms);
assertNotNull(multiStatusTerms.getData());
java.util.List<GlossaryTerm> ourMultiTerms =
multiStatusTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedDraftTerm.getName()))
.toList();
assertEquals(
2,
ourMultiTerms.size(),
"Both terms should be returned with multi-status filter on list API");
}

@Test
void test_glossaryTermEntityStatusFiltering(TestNamespace ns) {
OpenMetadataClient client = SdkClients.adminClient();

// Step 1: Create a dedicated glossary for this test to avoid interference
CreateGlossary createGlossary =
new CreateGlossary()
.withName(ns.prefix("status_filter_glossary"))
.withDescription("Glossary for entityStatus filtering test");
Glossary glossary = client.glossaries().create(createGlossary);

// Step 2: Create two terms - both should start as APPROVED (default status when no reviewers)
CreateGlossaryTerm request1 =
new CreateGlossaryTerm()
.withName(ns.prefix("approved_term"))
.withGlossary(glossary.getFullyQualifiedName())
.withDescription("Term that will stay approved");
GlossaryTerm approvedTerm = client.glossaryTerms().create(request1);
assertEquals(EntityStatus.APPROVED, approvedTerm.getEntityStatus());

CreateGlossaryTerm request2 =
new CreateGlossaryTerm()
.withName(ns.prefix("review_term"))
.withGlossary(glossary.getFullyQualifiedName())
.withDescription("Term that will be changed to in review");
GlossaryTerm reviewTerm = client.glossaryTerms().create(request2);
assertEquals(EntityStatus.APPROVED, reviewTerm.getEntityStatus());

// Step 3: Update the second term to IN_REVIEW status
reviewTerm.setEntityStatus(EntityStatus.IN_REVIEW);
GlossaryTerm updatedReviewTerm = client.glossaryTerms().update(reviewTerm.getId(), reviewTerm);
assertEquals(EntityStatus.IN_REVIEW, updatedReviewTerm.getEntityStatus());

// Step 4: Search without entityStatus filter - both terms should be returned
ResultList<GlossaryTerm> allTerms =
searchGlossaryTerms(client, null, glossary.getFullyQualifiedName(), null, 1000, 0);

assertNotNull(allTerms);
assertNotNull(allTerms.getData());
// Should contain at least our 2 terms (may contain more if other tests created terms in this
// glossary)
long ourTermsCount =
allTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedReviewTerm.getName()))
.count();
assertEquals(2, ourTermsCount, "Both terms should be returned without entityStatus filter");

// Step 5: Search with APPROVED status - only the first term should be returned
ResultList<GlossaryTerm> approvedTerms =
searchGlossaryTerms(
client, null, glossary.getFullyQualifiedName(), EntityStatus.APPROVED.value(), 1000, 0);

assertNotNull(approvedTerms);
assertNotNull(approvedTerms.getData());

// Filter to only our test terms and verify only approved term is present
java.util.List<GlossaryTerm> ourApprovedTerms =
approvedTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedReviewTerm.getName()))
.toList();

assertEquals(
1, ourApprovedTerms.size(), "Only one term should be returned with APPROVED filter");
assertEquals(approvedTerm.getName(), ourApprovedTerms.getFirst().getName());
assertEquals(EntityStatus.APPROVED, ourApprovedTerms.getFirst().getEntityStatus());

// Step 6: Search with IN_REVIEW status - only the second term should be returned
ResultList<GlossaryTerm> reviewTerms =
searchGlossaryTerms(
client,
null,
glossary.getFullyQualifiedName(),
EntityStatus.IN_REVIEW.value(),
1000,
0);

assertNotNull(reviewTerms);
assertNotNull(reviewTerms.getData());

// Filter to only our test terms and verify only under review term is present
java.util.List<GlossaryTerm> ourReviewTerms =
reviewTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedReviewTerm.getName()))
.toList();

assertEquals(
1, ourReviewTerms.size(), "Only one term should be returned with IN_REVIEW filter");
assertEquals(updatedReviewTerm.getName(), ourReviewTerms.getFirst().getName());
assertEquals(EntityStatus.IN_REVIEW, ourReviewTerms.getFirst().getEntityStatus());

// Additional test: Multiple status filter (APPROVED,IN_REVIEW) - both terms should be returned
ResultList<GlossaryTerm> multiStatusTerms =
searchGlossaryTerms(
client, null, glossary.getFullyQualifiedName(), "Approved,In Review", 1000, 0);

assertNotNull(multiStatusTerms);
assertNotNull(multiStatusTerms.getData());

// Filter to only our test terms - both should be present
java.util.List<GlossaryTerm> ourMultiStatusTerms =
multiStatusTerms.getData().stream()
.filter(
t ->
t.getName().equals(approvedTerm.getName())
|| t.getName().equals(updatedReviewTerm.getName()))
.toList();

assertEquals(
2, ourMultiStatusTerms.size(), "Both terms should be returned with multi-status filter");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3941,18 +3941,21 @@ String getGlossaryTermByNameAndGlossaryIgnoreCase(
String fqnhash,
@Bind("termName") String termName);

// Search glossary terms by both name and displayName using LIKE queries
// Search glossary terms by name and displayName using LIKE queries
// The displayName column is a generated column added in migration 1.9.3
// entityStatus filtering uses generated column added in migration 1.12.2
@SqlQuery(
"SELECT json FROM glossary_term_entity WHERE deleted = FALSE "
+ "AND fqnHash LIKE :parentHash "
+ "AND (LOWER(name) LIKE LOWER(:searchTerm) "
+ "OR LOWER(COALESCE(displayName, '')) LIKE LOWER(:searchTerm)) "
+ "<statusCondition> "
+ "ORDER BY name "
+ "LIMIT :limit OFFSET :offset")
List<String> searchGlossaryTerms(
@Bind("parentHash") String parentHash,
@Bind("searchTerm") String searchTerm,
@Define("statusCondition") String statusCondition,
@Bind("limit") int limit,
@Bind("offset") int offset);
}
Expand Down
Loading
Loading