Skip to content

Fixes #38002: Serve certification with both dates on every read; profiler skips unparseable tables - #38257

Merged
yan-3005 merged 3 commits into
open-metadata:mainfrom
Vamsi-klu:fix/38002-certification-read-derives-expiry
Nov 24, 2026
Merged

yan-3005 merged 3 commits into
open-metadata:mainfrom
Vamsi-klu:fix/38002-certification-read-derives-expiry

Conversation

@Vamsi-klu

@Vamsi-klu Vamsi-klu commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #38002

The server could return certification: {tagLabel, appliedDate} with no expiryDate. The generated Python AssetCertification requires all three, so every typed call that parsed such an entity raised ValidationError: certification.expiryDate Field required. In the profiler and auto-classification, one such table failed its list page and dropped every table from that page to the end of the database.

This PR makes every read serve a certification with both dates, stops raw row writes from leaving a stale inline certification, lets stale Redis bundle entries heal, and makes the profiler skip and report a table it cannot parse. expiryDate stays required; no schema change and no migration.

needs 2.0.x and 2.1 backport (reporter is on 2.0.7; backports follow once this merges).

Type of change:

  • Bug fix

High-level design:

Root cause (two independent defects):

  • R1: a certification is read from whichever tag_usage row sits under the configured classification, and not every row carries metadata.expiryDate. Certification tags sent through tags on create / bulk create, dbt PUT /tables/{id}/dataModel tags, the 2.0.x Tags-page asset picker, a switch of allowedClassification, and the 1.12.5 migration of JSON that had no expiry all leave rows without it. buildCertificationFromCertTag (and a second inline copy in batchFetchCertification) copied the null through. appliedAt can also be NULL: on pre-1.11.5 Postgres rows, and on rows the 1.12.5 migration moved without an appliedDate (both engines).
  • R2: TableRepository.addDataModel and createChangeEventForBulkOperation wrote the entity row with JsonUtils.pojoToJson instead of serializeForStorage, so the certification was stored inline. A list with fields=tags (what the profiler requests) never reached a builder: fetchAndSetCertification returned early unless certification was requested, so the stored (and possibly stale) copy was served.

Changes:

  • S1 EntityRepository.buildCertificationFromCertTag: a missing expiry reads as appliedDate + validityPeriod, using the same UTC LocalDateTime.plus(Period) arithmetic as stamping (extracted to expiryFor, which stamping now uses too). A missing appliedAt reads as the epoch, so it reads as expired. An unparseable or null validity period falls back to P30D with a WARN on read (writes still throw, as today). The batch list path calls the same builder instead of its inline copy.
  • S2 fetchAndSetCertification: bulk reads load certification when tags or certification is requested (the rule setFieldsInternal already applies to single GETs) and set it to null otherwise, so an inline copy is never served.
  • S3 addDataModel and createChangeEventForBulkOperation write through serializeForStorage, so the stored row matches what store() writes.
  • S4 Redis read bundle: an entry whose certification lacks a date is treated as not loaded, so the existing back-fill rebuilds it and the re-put overwrites it. No flush or TTL wait.
  • S5 Python: list_entities / list_all_entities take an optional on_skip(raw, exc) hook; the profiler lists tables with skip_on_failure=True and records each skipped table in status.failed with its FQN. This also covers a fixed client talking to an unpatched server.

Persistence, freeze vs follow: the read writes nothing to tag_usage. Copies taken from a read (version snapshots, change events, search and RDF docs, Redis bundles) keep the value derived at that moment. A legacy row's expiry therefore follows later validityPeriod edits while those copies do not; stamped rows never move. Derivation reads SettingsCache (3-minute TTL) while stamping reads the DB, so right after a period edit a pod can derive with the old period; only the strong body ETag (conditional GET 200 vs 304) can differ, If-Match uses the weak version ETag.

Rejected:

  • Omit a certification that has no expiry: hides stored data, and matchAnyCertification would silently stop matching, so a Deny rule would quietly stop applying.
  • Make expiryDate optional in the schema: weakens a contract the server keeps on every write it controls, leaves deployed clients broken, and needs a three-language regeneration.
  • skip_on_failure alone in the profiler: skipped tables would vanish from the run summary.

Recorded in ADR:2026-11-20-certification-reads-derive-a-missing-expiry-from-the-validity-period.

Known and accepted, not changed here:

  • An unparseable table is recorded as failed before the profiler's client-side view, classification and deferred-exclude filters run (they need the parsed model). This only happens against an unpatched server, and before this PR the rest of the database was dropped instead.
  • A fields=tags list page now runs a second tag_usage query for certification rows. A possible follow-up is to build certifications from the rows batchFetchTags already loads.

Tests:

Use cases covered

  • Table created with Certification.Gold in tags: GET, list with fields=certification, and PATCH of an unrelated field all return appliedDate and expiryDate = appliedDate + P30D; the PATCH does not move the expiry.
  • dbt PUT /tables/{id}/dataModel with a certification tag: the response carries both dates.
  • List with fields=tags (the profiler's projection) after two dbt runs serves the current certification. After a PATCH to Certification.Silver, with the dateless Gold copy an older server left in the entity row planted back, it still serves Silver; a list with neither field returns no certification.
  • Stored expiry (including one in the past) is returned unchanged; a NULL appliedAt reads as the epoch.
  • A Redis bundle entry cached without dates is rebuilt on its first hit, then served from cache.
  • One unparseable table in a profiler page: the others are profiled and the broken one is one status.failures entry with its FQN.

Unit tests

  • I added unit tests for the new/changed logic.
  • EntityRepositoryCertificationTest: getCertificationDerivesMissingExpiryFromConfiguredValidityPeriod (metadata null / empty, P90D stub), getCertificationKeepsStoredExpiry, getCertificationWithoutAppliedAtReadsAsAppliedAtEpoch, expiryForAddsTheCalendarPeriodInUtc, derivedExpiryFallsBackToDefaultPeriodWhenSettingIsNotAPeriod (PT720H, null), fetchAndSetFieldsDerivesMissingExpiryWhenCertificationRequested, fetchAndSetFieldsWithTagsOnlyReplacesStaleInlineCertification, fetchAndSetFieldsWithoutTagsOrCertificationClearsInlineCertification; applyCertificationSkipsWhenSameCertAlreadyExists amended (it passed only because null == null).
  • BundleWarmupCertificationBackfillTest#cachedCertificationWithoutExpiryIsRebuiltAndReCached.
  • test_entity_fetcher.py::TestGetTableEntities::test_unparseable_table_is_skipped_and_recorded_as_failed: real list_entities and fetcher, HTTP client mocked.
  • RED (production code at origin/main, compile stubs only for expiryFor/derivedExpiry): EntityRepositoryCertificationTest 46 run, 6 failures + 2 errors: getCertificationDerivesMissingExpiry... (both params, expected: <1707776000000> but was: <null>), ...WithoutAppliedAtReadsAsAppliedAtEpoch (expected: <0> but was: <null>), derivedExpiryFallsBackToDefaultPeriod... (null: NPE in Period.parse; PT720H: DateTimeParseException), fetchAndSetFieldsDerivesMissingExpiry... (expiry null), ...WithTagsOnlyReplacesStaleInlineCertification (expected: <Certification.Silver> but was: <Certification.Gold>), ...WithoutTagsOrCertificationClearsInlineCertification (stale Gold copy kept). BundleWarmupCertificationBackfillTest 5 run, 1 failure: cachedCertificationWithoutExpiryIsRebuiltAndReCached (expected: <1700000000000> but was: <null>). getCertificationKeepsStoredExpiry, expiryForAddsTheCalendarPeriodInUtc and the amended test pass: they pin existing semantics. The pytest fails with ValidationError: certification.expiryDate Field required from list_entities; with only on_skip reverted it fails on assert [] == ['my_service.prod.finance.broken'].
  • GREEN on 1a46199e0cc (block below): EntityRepositoryCertificationTest 46/46, BundleWarmupCertificationBackfillTest 5/5; the pytest passes. Earlier, on 3650ba4e343 (production code has changed only in comments since), the regressions BundleWarmupReadPathCertificationTest 4/4, EntityRepositoryBulkImportSecretsTest 3/3, BulkImportChangeEventMaskingTest 2/2 (both exercise the createChangeEventForBulkOperation row write) and EntityRepositoryTagCacheTest 8/8 also passed (68 unit tests in that run).
  • Coverage of changed lines: EntityRepository.java 29/29 executable changed lines covered by the unit tests above (jacoco). TableRepository.java: the one changed line (the addDataModel row write) is covered by ITs only (CertificationWithoutExpiryIT, TableDataModelCertificationIT). Python: every changed line in ometa_api.py and fetcher_strategy.py is covered by test_entity_fetcher.py + test_classification_manager.py (the latter covers the paginated list_all_entities call).

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/: CertificationWithoutExpiryIT (5 tests).
  • RED on MySQL + Elasticsearch:
    • Production Java at origin/main (plus the two compile stubs): 5 run, 4 failures + 1 error. get_certificationTagOnCreate_hasExpiry, list_withCertificationField_hasExpiry, addDataModel_withCertificationTag_responseHasExpiry: no expiryDate: ...appliedDate=1795140306115,expiryDate=<null>; patchUnrelatedField_returnsStableExpiry: NPE reading the pre-PATCH expiry (it now asserts that read first, so it fails as an assertion); listWithTagsOnly_servesCurrentCertification: certification is missing on the fields=tags list.
    • Only the bulk overwrite and the row-write change reverted (fetchAndSetCertification and both serializeForStorage writes back to main): listWithTagsOnly_servesCurrentCertification fails at the post-PATCH list with expected: <Certification.Silver> but was: <Certification.Gold>, i.e. the stale inline copy is served. The other 4 tests pass.
  • GREEN CertificationWithoutExpiryIT on 1a46199e0cc: 5/5 on MySQL + Elasticsearch (block below) and 5/5 on Postgres + OpenSearch.
  • Wider regressions, on 3650ba4e343 (production code has changed only in comments since; test changes since are limited to CertificationWithoutExpiryIT and two test comments): CertificationWithoutExpiryIT,TableCreateCertificationIT,TableDataModelCertificationIT,TableCertificationPropagationIT,SearchIndexingFieldsParityIT,EnricherBulkVsHistoryPathEquivalenceIT,DatabaseSchemaResourceIT,TeamResourceIT,UserResourceIT,UserImportPrivilegeEscalationIT:
    • MySQL + Elasticsearch (planner run): 902 tests, 0 failed, 58 skipped.
    • Postgres + OpenSearch (hand-run): 902 tests, 0 errors, 58 skipped, 1 failure in listWithTagsOnly_servesCurrentCertification, a test defect also seen on MySQL before that run: a stamped certification reads appliedDate from tag_usage.appliedAt, a few ms off the clock the expiry was stamped with, so the exact appliedDate + P30D check holds only for derived rows. The test now checks the stamped expiry.
    • cache-tests lane (Postgres + Elasticsearch + Redis): BundleWarmupCertificationIT 2/2.
  • Full IT suite runs in the merge queue; core area changes select the full suite there.

Local Java test run: PASSED

  • Commit: 1a46199e0cc4 (base origin/main)
  • Finished: 2026-11-20 04:09 UTC · 5.2 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 9 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (2 classes) 2 51 0 0 1.7 passed
integration mysql-elasticsearch · parallel 1 5 0 0 3.5 passed
  • Impacted, not run locally: 7 classes (listed in the details)

Ingestion integration tests

  • Not applicable: no connector change. Unit tests run:
    cd ingestion && PYTHONPATH=src python -W ignore -m pytest -q -p no:cacheprovider tests/unit/observability/profiler/test_entity_fetcher.py tests/unit/observability/profiler/test_workflow.py tests/unit/metadata/pii/test_classification_manager.py -> 70 passed (51 + 7 + 12); RED/GREEN for the new pytest above. ruff check and ruff format --check clean on the three changed files.
    Wider check (fetcher, SDK and classification tests that exercise list_entities): test_container_fetcher.py, test_entity_fetcher.py, test_classification_manager.py, test_tag_processor.py, test_patch_serialization.py, tests/unit/sdk: 578 passed, 1 skipped.

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Not run. The repro in the issue (create with tags:[Certification.Gold], a dbt PUT /tables/{id}/dataModel, then GET ...?fields=certification and GET /tables?databaseSchema=...&fields=tags, then om.get_by_name / om.list_all_entities from the Python SDK) needs a full local server image build. The same API calls run against the real server in CertificationWithoutExpiryIT on both engines, and the client side is covered by the pytest above.

UI screen recording:

Not applicable: backend and ingestion fix, no UI change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable, no schema change.
  • For a UI feature or feature task: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review against REVIEW.md: an independent reviewer ran on 3650ba4 (verdict: ready with nits). The should-fix (IT5 never built a stale inline copy) and the comment/ADR nits are applied in 1a46199; two nits are declined under "Known and accepted". Details in the review on this PR.
  • Decision check: adds ADR:2026-11-20-certification-reads-derive-a-missing-expiry-from-the-validity-period.
  • I have added a test that covers the exact scenario we are fixing.

Questions for maintainers

  1. Freeze or follow? This PR derives on read, so a legacy row's expiry follows validityPeriod edits. If expiries must be fixed at apply time, I would follow up with stamping on every tag write path, a settings-change hook and a backfill (a backfill alone still leaves new rows on the follow path).
  2. A NULL appliedAt (pre-1.11.5 Postgres rows) reads as the epoch, so the certification reads as expired. Acceptable?
  3. Certification tags sent through tags (create, bulk create, dbt dataModel) are still stored without stamping. Should they be rejected, as AssetTagLabelService does, or routed into certification and stamped? The update path already drops them.
  4. Is a new optional on_skip keyword on list_entities / list_all_entities acceptable, or would you prefer the profiler to page by hand?
  5. Version snapshots and change events written before this fix keep the shape without an expiry; only the Python get_entity_version parses snapshots. Leave them?
  6. Found during the audit, not changed here: a CSV batch update appears to store expiryDate = import time (EntityCsv.getCertificationLabels -> updateManyEntitiesForImport -> applyCertificationBatch, stamping skipped). Not verified at runtime. Separate issue?
  7. S3 in createChangeEventForBulkOperation runs prepareForStorage, which encrypts secrets for User, IngestionPipeline and Workflow. None of them reaches this path today (UserRepository.supportsBulkImportVersioning() is false; the other two have no CSV import), and store() already re-runs it on every update. Keep it, or limit S3 to addDataModel?

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable defects were found.

Summary

The PR supplies missing certification dates on reads and keeps stale inline copies out of responses.

  • Certification reads return both dates and use the current tag value.
  • The profiler records an unparseable table and continues through the rest of the list.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read certification] --> B{Cached value has both dates?}
  B -->|Yes| C[Return cached value]
  B -->|No or cache miss| D[Read certification tag]
  D --> E{Stored expiry exists?}
  E -->|Yes| F[Keep stored expiry]
  E -->|No| G[Derive expiry from applied date and validity period]
  F --> H[Return certification with both dates]
  G --> H
  H --> I[Refresh read bundle when needed]
Loading

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

…ry read

A certification is read from any tag_usage row under the configured
classification, but only rows written through validateAndStampCertification
carry an expiry. Tags on create, dbt dataModel tags, a classification switch
and the 1.12.5 migration leave it out, so typed clients (the Python
AssetCertification requires expiryDate) reject the entity.

- The read builder derives a missing expiry as appliedDate + the configured
  validityPeriod (the stamping arithmetic, now shared through expiryFor); a
  missing appliedAt reads as the epoch. The batch list path uses the same
  builder instead of its inline copy.
- Bulk reads load certification whenever tags or certification is requested,
  as setFieldsInternal does, and clear it otherwise, so a stale inline copy in
  the entity row is never served (the profiler lists with fields=tags).
- addDataModel and the CSV change-event write go through serializeForStorage,
  so they stop storing certification inline.
- A Redis read-bundle entry whose certification lacks a date is treated as not
  loaded and rebuilds itself.

ADR:2026-11-20-certification-reads-derive-a-missing-expiry-from-the-validity-period
…ot parse

One table the client cannot parse (a certification served without the
expiryDate its model requires, by a server without the fix) failed the whole
list page, and the profiler dropped every table from that page to the end of
the database.

list_entities and list_all_entities take an optional on_skip hook, called for
each element skip_on_failure drops. The profiler lists tables with
skip_on_failure=True and records each skipped table in status.failed with its
FQN, so the run summary still counts it.
@Vamsi-klu
Vamsi-klu requested review from a team as code owners November 20, 2026 04:15
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@Vamsi-klu Vamsi-klu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Self-review against REVIEW.md (independent reviewer, run on 3650ba4; fixes in 1a46199)

Verdict on 3650ba4: ready with nits (one should-fix).

  1. should-fix, applied: CertificationWithoutExpiryIT.listWithTagsOnly_servesCurrentCertification never built the stale inline copy it claimed to test. addDataModel loads certification before it applies the dbt tag, so a first dbt call on an uncertified table writes no copy, and a later PATCH goes through store(), which strips it again. The test now runs dbt twice, then puts back the dateless Gold copy an older server would have left in the row (tableDAO plus a cache invalidation, as ColumnCustomPropertiesIT does). With the bulk overwrite and the serializeForStorage writes reverted, it fails with expected Certification.Silver but was Certification.Gold. It also asserts a fields=owners list carries no certification.
  2. nit, applied: the appliedAt comment and the builder Javadoc were too narrow. A NULL appliedAt also comes from the 1.12.5 migration on both engines, and that migration and the CSV batch path also write an expiry.
  3. nit, applied: the ADR names "OpenMetadata maintainers" as deciders and cites real test names.
  4. nit, applied: issue numbers dropped from code comments; the fetchAndSetCertification comment now says it always overwrites, and nulls the field when neither tags nor certification is requested.
  5. nit, declined: an unparseable table is recorded as failed before the profiler's client-side view/classification filters run. This only happens against an unpatched server, and before this change the rest of the database was dropped.
  6. nit, declined (possible follow-up): a fields=tags list page now makes a second tag_usage query for certification rows; it could reuse the rows batchFetchTags already loads.

Checked with no finding: every read builder goes through buildCertificationFromCertTag (single GET, read bundle, bulk and its fallback, version latest, RDF, reindex, MCP); Redis bundles missing a date rebuild on hydration; nulling certification on lists that request neither field adds no deletion (updateCertification deletes on a null update regardless, and write paths load certification); serializeForStorage works on a copy, Table has no prepareForStorage, and re-encrypting an already tokenized secret is idempotent; stamping and derivation share one UTC Period calculation; on_skip runs inside the except block, defaults to None for other callers, and an exception in it is still caught per database. Reverting each part fails a test.

Unverified: whether Collate acts on certification.expiryDate. Legacy rows now read as expired once older than the validity period (or since 1970 when appliedAt is NULL).

Tests on the final SHA: CertificationWithoutExpiryIT 5/5 on MySQL+ES and on Postgres+OS; unit 51/51; profiler pytest and ruff clean. The wider 902-test regression run is at 3650ba4; production code has changed only in comments since.

@Vamsi-klu

Copy link
Copy Markdown
Contributor Author

Local Java test run: PASSED — details

  • Commit: 1a46199e0cc4 (base origin/main)
  • The summary is in the PR description.

Tests run locally

  • unit · openmetadata-service (2 classes): BundleWarmupCertificationBackfillTest (5 passed), EntityRepositoryCertificationTest (46 passed)
  • integration · mysql-elasticsearch · parallel: CertificationWithoutExpiryIT (5 passed)

Broader coverage not executed by this focused run

  • mvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true '-Dtest=org/openmetadata/DefaultOperationalConfigProviderTest.java,org/openmetadata/csv/**/*Test.java,org/openmetadata/csv/**/Test*.java,org/openmetadata/csv/**/*Tests.java,org/openmetadata/csv/**/*TestCase.java,org/openmetadata/schema/**/*Test.java,org/openmetadata/schema/**/Test*.java,org/openmetadata/schema/**/*Tests.java,org/openmetadata/schema/**/*TestCase.java,org/openmetadata/sdk/**/*Test.java,org/openmetadata/sdk/**/Test*.java,org/openmetadata/sdk/**/*Tests.java,org/openmetadata/sdk/**/*TestCase.java,org/openmetadata/service/**/*Test.java,org/openmetadata/service/**/Test*.java,org/openmetadata/service/**/*Tests.java,org/openmetadata/service/**/*TestCase.java,CreateEntityToolTest,PatchEntityToolTest' -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<514 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state '-Dit.test=<39 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf '-Dit.test=<37 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=parallel -Dit.test=AlertStateIT,BundleWarmupCertificationIT,ContainerCacheCorrectnessIT,EntityCacheWriteOrderIT,OneTransactionFlushAtomicityIT,RelationshipCacheInvalidationIT,TagRenameCacheIT,UncachedReadIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=global-state -Dit.test=CredentialRedisDownIT,CredentialRedisNoRoundTripIT,SessionRedisMultiNodeIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=parallel -Dit.test=FlattenedChildrenHighlightSearchIT,InheritedFieldPropagationRecoveryIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=global-state -Dit.test=PatchTableEmbeddingIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Psearch-it -DdatabaseType=postgres -DsearchType=opensearch -Djpw.data.mode=ingest -Dit.test=ColumnIndexingToggleIT,GlossarySynonymNgramIT,SearchAccessRulesIT,SearchAggregateRbacIT,SearchClusterFitnessReindexE2EIT,SearchCountConsistencyIT,SearchEntityRankingIT,SearchQueryPostIT,SearchRelevancyPreviewIT,SearchScoringIT,TableTotalCountAggregationIT,TestCaseStaleDefinitionReindexIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
Impacted, not run locally (7)
  • ReindexBenchmarkIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • TableTotalCountScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • EntityLoaderSmokeUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • PipelineOwnerIndexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SearchAvailableAllKindsDuringReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SearchAvailableDuringReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SelectiveFieldReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
Commands
mvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=BundleWarmupCertificationBackfillTest,EntityRepositoryCertificationTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=CertificationWithoutExpiryIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

@stout-yeoman

Copy link
Copy Markdown
Contributor

Approved from the ingestion side. @yan-3005 feel free to approve the PR once you're happy with the backend changes.

@yan-3005 yan-3005 added the To release Will cherry-pick this PR into the release branch label Nov 23, 2026
@yan-3005

Copy link
Copy Markdown
Contributor

@Vamsi-klu reviewed this. The fix is correct and I have no code changes to ask for: every read now hydrates the certification dates, the list path adds one batched query per page, and the profiler skip is in scope for #38002.

One thing blocks merging: the branch now conflicts with main in TableRepository.java (main changed the same addDataModel area). Please rebase or merge main, keep your serializeForStorage change there, and push. I'll take it from there.

Also, gitar's open thread about the P30D fallback for a null validityPeriod just needs a one-line reply (the rule lives in derivedExpiry's javadoc) so the "Changes requested" badge clears.

…on-read-derives-expiry

# Conflicts:
#	openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java
@Vamsi-klu

Copy link
Copy Markdown
Contributor Author

@yan-3005 thanks for taking a look. I merged main into the branch and pushed. In TableRepository.addDataModel I kept main's storePendingGlossaryTerms call, and the row is still written through serializeForStorage. After the merge I ran EntityRepositoryCertificationTest, BundleWarmupCertificationBackfillTest, CertificationWithoutExpiryIT and GlossaryTermApprovedTaggingIT locally on MySQL + Elasticsearch, and they all pass. I also replied on gitar's P30D thread. Could you have another look when you get a chance?

@gitar-bot

gitar-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Deriving missing certification expiries and replacing stale inline values changes API read semantics, which could affect consumers relying on certification validity.

Adds read-side derivation of missing certification expiry from appliedDate plus validityPeriod, keeps stale inline certification copies out of bulk reads, and makes the profiler skip and report unparseable tables. Changes requested: the new P30D fallback for a null or unparseable validityPeriod on read, which writes still reject, is not recorded in the ADR Decision section and should be added before merge.

✅ 1 closed
Closed: Quality: Read-side P30D fallback for a bad validityPeriod is not in the ADR

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:8007-8019 📄 docs/decisions/2026-11-20-certification-reads-derive-a-missing-expiry-from-the-validity-period.md:22-27
derivedExpiry sets a new default: when validityPeriod is null or does not parse as an ISO-8601 Period (for example PT720H), a read logs a WARN and derives expiry with P30D, while stamping on writes still throws. The description states this rule ("An unparseable or null validity period falls back to P30D with a WARN on read, while writes still throw"), but the new ADR's Decision only says "a missing expiry reads as appliedDate + the current validityPeriod". Nothing in the tree records the fallback or the read/write asymmetry. The repository squash-merges, so this rule would be lost.

Suggested fix: add a sentence to the Decision section, for example: "If validityPeriod is null or not an ISO-8601 Period, a read derives the expiry with P30D and logs a warning, while a write still rejects the setting."

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@yan-3005 yan-3005 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified at fffdd1e (MySQL + Elasticsearch): CertificationWithoutExpiryIT 18/0 failures, TableResourceIT 152/0. List path adds one batched certification query per page; addDataModel conflict resolution keeps main's storePendingGlossaryTerms. LGTM.

@yan-3005

Copy link
Copy Markdown
Contributor

@stout-yeoman Please re approve

@yan-3005
yan-3005 enabled auto-merge (squash) November 24, 2026 06:53
@yan-3005
yan-3005 merged commit 5b5cb59 into open-metadata:main Nov 24, 2026
57 of 59 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.1 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.1 opened as #38562. Claude resolved a cherry-pick conflict to build it. It merges itself once the checks pass, so read the diff now if this change is a sensitive one.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.0 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

yan-3005 added a commit that referenced this pull request Nov 24, 2026
…iler skips unparseable tables (#38257) (#38562)

* Fixes #38002: serve certification with both dates on every read

A certification is read from any tag_usage row under the configured
classification, but only rows written through validateAndStampCertification
carry an expiry. Tags on create, dbt dataModel tags, a classification switch
and the 1.12.5 migration leave it out, so typed clients (the Python
AssetCertification requires expiryDate) reject the entity.

- The read builder derives a missing expiry as appliedDate + the configured
  validityPeriod (the stamping arithmetic, now shared through expiryFor); a
  missing appliedAt reads as the epoch. The batch list path uses the same
  builder instead of its inline copy.
- Bulk reads load certification whenever tags or certification is requested,
  as setFieldsInternal does, and clear it otherwise, so a stale inline copy in
  the entity row is never served (the profiler lists with fields=tags).
- addDataModel and the CSV change-event write go through serializeForStorage,
  so they stop storing certification inline.
- A Redis read-bundle entry whose certification lacks a date is treated as not
  loaded and rebuilds itself.

ADR:2026-11-20-certification-reads-derive-a-missing-expiry-from-the-validity-period

* Fixes #38002: profiler skips and reports a table it cannot parse

One table the client cannot parse (a certification served without the
expiryDate its model requires, by a server without the fix) failed the whole
list page, and the profiler dropped every table from that page to the end of
the database.

list_entities and list_all_entities take an optional on_skip hook, called for
each element skip_on_failure drops. The profiler lists tables with
skip_on_failure=True and records each skipped table in status.failed with its
FQN, so the run summary still counts it.

(cherry picked from commit 5b5cb59)

Co-authored-by: deepinsight coder <[email protected]>
Co-authored-by: Ram Narayan Balaji <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.0.7] Certification without expiryDate is accepted by the server but breaks the Python client (Table validation) — profiler and dbt ingestion fail

3 participants