Skip to content

Fixes #34540: Support a shared lifecycle stage on entities and let active workflows own it - #34541

Merged
pmbrull merged 14 commits into
mainfrom
agent/lets-look-at-what-life-cycle-3
Oct 5, 2026
Merged

pmbrull merged 14 commits into
mainfrom
agent/lets-look-at-what-life-cycle-3

Conversation

@harshach

@harshach harshach commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #34540

Lifecycle workflow playbooks move assets between lifecycle stages, so OpenMetadata needs to know which stage each entity is in and keep that stage under an active governance workflow's control. This makes the stage an entity-level concept in EntityRepository instead of a per-repository one:

  • Starting stage. A new entity starts in its type's stage, the same as on main: Unprocessed unless the type derives one. Glossary terms and metrics start Draft when they have reviewers and Approved when they don't, ontology axioms start Draft, and system relationship types and memories start Approved.
  • The stage survives upserts. A PUT, bulk upsert or CSV import whose request carries no stage keeps the entity's stage instead of resetting it.
  • Workflow-owned stages. While a deployed, unsuspended governance workflow sets an entity type's stage, only that workflow (acting as the governance bot) can change it. A direct change gets a 403 naming the workflow, and a create that asks for an owned stage starts in the type's own stage. The trigger filter decides which entities a workflow owns; suspending the workflow releases them.
  • Per-type lifecycles. All types share one stage vocabulary (type/status.json), but a type can declare its own lifecycle: the stages it uses, including stages only it has, and the moves between them. Types that declare none keep the general lifecycle (any move between today's stages), so nothing changes for them, Metric included.
  • Discovery. GET /v1/metadata/types/lifecycleStages lists the stages and, per entity type, the stages it uses, the moves between them, and the workflows that own its stage.
  • Memories move from their own status (Draft/Active/Archived) onto entityStatus, with a 2.1.0 migration for stored memories and their version history (Active becomes Approved). They are the first type to declare their own lifecycle: Draft, Approved and Archived.
  • The approval-task closing, in-review delete and reviewer rules that seven repositories each duplicated are shared, with per-type flags keeping each rule on the entity types that had it.
  • createOntologyAxiom.entityStatus is no longer required. DataProduct lifecycleStage stays as it is.

Type of change:

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

High-level design:

Approach. Every entity type whose schema declares entityStatus shares the existing EntityStatus enum; there are no per-type stage lists, so playbooks work the same way on every type. EntityRepository owns the rules:

  • defaultEntityStatus, plus an initialEntityStatus(entity) override for the reviewer-dependent types, gives the starting stage. The schema default was removed from type/status.json and its siblings so the server decides the stage, not each generated client model.

  • EntityUpdater.updateEntityStatus keeps the stored stage when a request omits it, validates a change (workflow lock, then the reviewer rule, then the per-type validateEntityStatusTransition hook) and records it. The reviewer rule guards direct edits and imports only: a workflow's own write skips it, because its approval task already decided who may approve (reviewers, owners or named candidates). A consolidated update re-diffs from the start of the user's session and doesn't re-validate a stage change an earlier version made, such as a workflow approving on the user's behalf.

  • EntityStatusWorkflows answers which active workflows own a type's stage, or a given entity's. A workflow owns the stage when it is deployed, not suspended, triggered by the type, and has a node that sets status/entityStatus. The answer sits in a bounded Caffeine cache (1 entry, 30 s) that workflow create, update, delete, suspend and resume invalidate. The trigger filter is evaluated per entity through TriggerEntityFilter, extracted from FilterEntityImpl so both share it.

  • Workflow writes are recognized by updatedBy or impersonatedBy being the governance bot. RollbackEntityImpl and SetGlossaryTermStatusImpl now patch impersonating the governance bot, like SetEntityAttributeImpl. The page, ontology axiom, relationship type, context memory and AI asset schemas gain impersonatedBy, so a workflow's own Set Action on them is not rejected by the stage it owns.

  • Batched CSV import updates apply the same stage rules as a PATCH: a row without a stage keeps the stored one, and a stage change must be a lifecycle move no active workflow owns and, out of review, be made by a reviewer (reviewers are loaded first, inherited ones included); otherwise the row fails with the reason. A blank glossary term status keeps the term's stage instead of resetting it to Draft.

  • A stored workflow definition this server cannot read (for example a node type from another version) is skipped when resolving stage ownership, instead of failing every stage change.

  • Per-type lifecycles. EntityLifecycle maps each stage a type uses to the stages it can move to; a repository declares it with entityLifecycle = new EntityLifecycle(Map.of(...)). The default, EntityLifecycle.GENERAL, allows any move between the seven stages that exist today. A stage added to the vocabulary later is outside it, so only types that declare that stage can use it. A declaration that moves to a stage it doesn't list fails when the repository is built. EntityRepository rejects, with 400, a create in a stage outside the type's lifecycle and any stage change the lifecycle has no move for, before the workflow lock. The check applies to direct edits, imports and workflows alike.

  • Per-type flags:

    Flag Set on
    defaultEntityStatus Unprocessed by default; OntologyAxiom Draft; ContextMemory Approved (system relationship types start Approved through initialEntityStatus)
    workflowsOwnEntityStatus = false AI assets, whose stage the registration sync drives
    onlyReviewersDeleteInReview DataProduct, Metric, DataContract, Tag, TestCase
    approvalTaskReviewsEntityStatus DataContract, DataProduct, GlossaryTerm, Page, Metric, Tag, TestCase
    entityLifecycle (own lifecycle) ContextMemory: Draft → Approved/Archived, Approved → Archived, Archived → Approved

Alternatives considered.

  • Per-type stage lists: rejected in favor of the shared enum.
  • Backfilling existing entities into the new starting stages: rejected; only new entities are affected.
  • Applying task closing and the in-review delete rule to every type: rejected. On other types an approval task can review any change, such as a tag, so a stage change must not cancel it.

Migration and compatibility.

  • The 2.1.0 postDataMigrationSQLScript.sql for MySQL and Postgres moves context_memory.status to entityStatus (Draft and Archived kept, everything else Approved). It does the same for memory version history in entity_extension. The statements are idempotent, and ContextMemoryStatusMigrationIT runs them twice on both databases.

  • Other entities keep their stored stages, so nothing else needs migrating.

  • Breaking:

    • The memory status field is removed from the entity and the create request; use entityStatus.
    • With the default GlossaryTermApprovalWorkflow and MetricApprovalWorkflow active, a direct PATCH of a glossary term's or metric's stage now returns 403. Use the approval task, or suspend the workflow.
    • Generated clients no longer send a default entityStatus; the server assigns the starting stage.
  • Overlap with Fixes #34394: Add memory lifecycle and status filtering #34395, which builds a memory lifecycle (Superseded/Invalidated) on the memory status field this removes. It can move onto entityStatus without a second field:

    1. Add Superseded and Invalidated to type/status.json.
    2. Extend ContextMemoryRepository.LIFECYCLE with those stages and their moves; Active maps to Approved.
    3. Keep statusReason, supersededBy and disputes on the memory schema, and check them in ContextMemoryRepository.prepare, e.g. Superseded requires supersededBy.

    Other types won't see the new stages, and /lifecycleStages and BaseEntityIT pick up the declared lifecycle automatically.

Tests:

Use cases covered

  • A new entity of each type starts in its type's stage. A requested stage is honored unless an active workflow owns it.
  • A PUT, bulk upsert or CSV import without a stage keeps the current stage.
  • PATCH moves an entity through every stage.
  • While an active workflow owns the stage, a direct change is rejected with 403. It is allowed again once the workflow is suspended, and entities the workflow's trigger filter excludes stay editable.
  • A reviewer editing an entity right after the workflow approved it on their behalf isn't treated as a stage change.
  • Approving a data product closes its open approval task. A custom workflow's stage change on another entity type leaves that type's unrelated approval tasks open.
  • Memories create, list and change stage on entityStatus, and the 2.1.0 migration converts stored memories on MySQL and Postgres.
  • Every entity type rejects (400) a stage change its lifecycle has no move for, and a create in a stage it doesn't use; types without their own lifecycle can still move between any general stages.

Unit tests

  • I added unit tests for the new/changed logic.

  • Files added/updated:

    • New: EntityRepositoryEntityStatusTest, EntityLifecycleTest, GlossaryTermRepositoryInitialStageTest, EntityStatusWorkflowsTest, TriggerEntityFilterTest.
    • Updated: FilterEntityImplTest, MetricRepositoryTest, ContextMemoryStatusTransitionTest (now on the declared memory lifecycle), RollbackEntityImplTest, KnowledgePageMapperTest, and the memory mapper, index and extractor tests.
    • UI: MemoryDerivedOntology.utils.test.ts, CreateMemoryModal.test.tsx.
  • Coverage (JaCoCo, unit tests only, 258 tests):

    Code Lines Branches
    Stage code in the repositories (EntityRepository, EntityUpdater, GlossaryTermRepository, MetricRepository) plus EntityLifecycle 92% (114/124) 91% (80/88)
    EntityLifecycle 100% 100%
    TriggerEntityFilter 95%
    EntityStatusWorkflows 85%

    EntityRepository takes a StageOwnership (the active workflows by default), so unit tests can put an entity under an owning workflow. The remaining lines are approval-task closing through TaskRepository (the ITs check the task outcome both ways) and branches for types with no lifecycle stage.

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/ for new/changed API endpoints.

  • Files added/updated:

    • New: EntityStatusWorkflowOwnershipIT, ContextMemoryStatusMigrationIT, and the helpers ApiAssertions, GovernanceWorkflowActions, WorkflowInstances.
    • BaseEntityIT: seven stage tests run for every entity IT, including one that a move outside the type's lifecycle is rejected; 20 types without a lifecycle opt out.
    • Updated: ContextMemoryIT, DataProductResourceIT, GlossaryTermResourceIT, GlossaryResourceIT, DatabaseSchemaResourceIT, MetricResourceIT, KnowledgeCenterIT, AIApplicationResourceIT, McpServerResourceIT, OntologyAxiomResourceIT, ClassificationResourceIT.
  • Results on the latest commit:

    Stack Classes Tests Failures
    MySQL + Elasticsearch, parallel lane 26 (those above plus Domain, DataContract, LLMModel, RelationshipType, the glossary-term approval ITs, User, Team, TestSuite, TestCase, Task, Table, Tag) 4,827 0
    MySQL + Elasticsearch, global-state lane WorkflowDefinitionResourceIT 59 0
    Postgres + OpenSearch ContextMemoryStatusMigrationIT, ContextMemoryIT, EntityStatusWorkflowOwnershipIT, OntologyAxiomResourceIT 225 0

    The new lifecycle test runs for ContextMemoryIT, the only type with its own lifecycle so far, and is skipped where every move between the general stages is allowed.

Ingestion integration tests

  • tests/integration/amundsen/test_metadata.py now expects the server-assigned Unprocessed stage on created services.

Playwright (UI) tests

  • No UI behavior change: the UI changes are regenerated TypeScript types and the memory status → entityStatus rename in MemoryDerivedOntology.utils.ts.
  • GlossaryStatusFilterLargeDataset and GlossaryStatusFilterNestedTerms exclude their glossary from GlossaryTermApprovalWorkflow while seeding term stages (new helpers in playwright/utils/glossary.ts), since a direct stage change on a workflow-owned term is now rejected; setTermStatus asserts the response.

Manual testing performed

No manual UI testing. The behavior was verified with the integration suites above against MySQL + Elasticsearch and Postgres + OpenSearch. The UI type check (tsc --noEmit) reports no new errors compared with the same check on main.

UI screen recording / screenshots:

Not applicable. There is no visible 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: I updated the migration scripts or explained why it is not needed. Memories are migrated; other entities keep their stored stages.

  • For UI changes: I attached a screen recording and/or screenshots above. Not applicable: no visible UI change.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • I have added the tag Backward-Incompatible-Change.

…tive workflows own it

Every entity type whose schema declares entityStatus now gets its lifecycle
stage rules from EntityRepository instead of a schema default, so they live in
one place:

- A new entity starts in its type's stage: Draft for domains, data products,
  glossaries, articles, ontology axioms, data contracts and AI assets;
  Approved for assets that come from the data infrastructure. Metrics and
  glossary terms start Draft only when they have reviewers.
- A PUT, bulk upsert or CSV import whose request carries no stage keeps the
  stage the entity is in instead of resetting it.
- While a deployed, unsuspended governance workflow sets an entity type's
  stage, only that workflow (acting as the governance bot) may change it.
  A direct change is rejected with 403, and a create that asks for a stage the
  workflow owns starts in the type's own stage. The workflow's trigger filter
  decides which entities it owns; suspending it releases them.
- GET /v1/metadata/types/lifecycleStages lists the stages and, per entity
  type, the workflows that own its stage.
- Context memories move from their own Draft/Active/Archived status onto
  entityStatus. The 2.1.0 migration converts stored memories and their
  version history (Active becomes Approved).
- The approval-task closing, in-review delete and reviewer rules that seven
  repositories each duplicated are shared now, with per-type flags keeping
  each rule on the entity types that had it.
- A consolidated update no longer re-validates a stage change that an earlier
  version made, such as a workflow approving on the user's behalf.
- createOntologyAxiom no longer requires entityStatus, and DataProduct
  lifecycleStage is deprecated in favor of entityStatus.

BaseEntityIT checks the stage rules for every entity type; types without a
lifecycle (users, teams, test suites, ...) opt out.
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 74%
74.71% (112445/150507) 60.24% (69070/114646) 61.54% (22931/37256)

yan-3005 and others added 2 commits October 2, 2026 16:49
- Keep main's starting stages: entities start Unprocessed unless their type
  derives one (glossary terms and metrics from reviewers, ontology axioms Draft,
  system relationship types and memories Approved); keep DataProduct
  lifecycleStage instead of deprecating it.
- Record governance-bot impersonation on page, ontologyAxiom, relationshipType,
  contextMemory and AI asset schemas, so a workflow's own Set Action is not
  rejected by the stage lock it holds.
- Apply the stage rules to batched CSV import updates (workflow lock, lifecycle
  moves, keep stored stage when the row has none) and keep a blank glossary
  status instead of resetting it to Draft.
- Skip workflow definitions this server cannot read when resolving stage
  ownership instead of failing every stage change.
- Restore the in-review delete flag on Tag and TestCase.
- Seed glossary status-filter Playwright specs with their glossary excluded
  from the approval workflow, and update ITs for main's starting stages.
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 828 → 828
- 0 added, 0 removed, 2 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/topic.ts

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

- A workflow's approval task already decides who may approve (reviewers,
  owners or named candidates), so its write no longer fails the reviewer rule
  when an owner or candidate approves; direct edits and imports keep the rule.
- Load reviewers, inherited ones included, before checking an import row that
  moves an entity out of review, since import rows are matched from stored JSON
  that holds no relationship fields.
- ClassificationResourceIT expects a new classification to start Unprocessed
  again, as on main.
- The metric CSV-update Playwright test leaves the status cell blank: the
  fixture metric is In Review under MetricApprovalWorkflow, so a CSV row cannot
  move its stage, and a blank status keeps it.
harshach and others added 2 commits October 2, 2026 14:36
An import row is matched from stored JSON, which holds no reviewers, so the
reviewer rule only works on import because applyEntityStatusRulesForImport
reloads them. The test imports a classification CSV as admin that approves two
tags in review: the one another user reviews fails with "is not a reviewer"
and stays In Review, and the one admin reviews becomes Approved. Without the
reload, the non-reviewer's row goes through.
Exclude marked glossary fixtures from automatic approval during test
bootstrap. Status and search tests can update stages through the API
without waiting for the shared workflow event queue.
System.setProperty("IT_BASE_URL", "http://localhost:" + APP.getLocalPort() + "/api");

SharedEntities.initialize(SdkClients.adminClient());
excludeGlossaryStatusFixturesFromApproval();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Edge Case: Status-fixture exclusion is skipped in external (JPW) mode

The four GlossaryTermResourceIT status tests now set term stages with a direct PATCH. They only pass because excludeGlossaryStatusFixturesFromApproval() adds an exclusion filter to GlossaryTermApprovalWorkflow. That call runs inside launcherSessionOpened, after the early return taken when JPW_MODE=external or skip.embedded.bootstrap=true. Against an external server the workflow still owns these terms, so each PATCH gets the new 403 ("stage owned by workflow") and the tests fail. To fix this, apply the exclusion whenever the suite starts, including the external path (for example, run it lazily and idempotently from GlossaryTestFactory.createForStatusTests). Alternatively, skip these tests when the exclusion isn't in place.

Was this helpful? React with 👍 / 👎

Keep status assignment before persistence while avoiding overlapping
creation hooks with #34025 in the merge queue.
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-05T07:30:22Z)

The entry left the queue before it was built, so no checks ran against it.

@gitar-bot

gitar-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 2 closed / 3 findings

🔴 High risk · Workflow-owned lifecycle stages alter authorization, with a memory status migration.

Adds shared lifecycle stage ownership to entities, with active workflows controlling stage transitions and per-type lifecycle declarations. Per-type flags preserve approval-task closing and reviewer rules on the types that had them, and memories migrate from status to entityStatus. Consider applying the glossary status-fixture exclusion in external bootstrap mode to prevent 403 errors when the workflow owns term stages in those tests.

💡 Edge Case: Status-fixture exclusion is skipped in external (JPW) mode

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java:180-185 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java:245 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java:256-270 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:1594-1606 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:1614-1624 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:2971-2985 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:3058-3072

The four GlossaryTermResourceIT status tests now set term stages with a direct PATCH. They only pass because excludeGlossaryStatusFixturesFromApproval() adds an exclusion filter to GlossaryTermApprovalWorkflow. That call runs inside launcherSessionOpened, after the early return taken when JPW_MODE=external or skip.embedded.bootstrap=true. Against an external server the workflow still owns these terms, so each PATCH gets the new 403 ("stage owned by workflow") and the tests fail. To fix this, apply the exclusion whenever the suite starts, including the external path (for example, run it lazily and idempotently from GlossaryTestFactory.createForStatusTests). Alternatively, skip these tests when the exclusion isn't in place.

✅ 2 closed
✅ Bug: Tag and TestCase lose the reviewer-only delete rule while in review

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TagRepository.java:94 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java:168 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:568-569 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:1528-1532 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:4815
Before this PR, TagRepository and TestCaseRepository each overrode preDelete to call checkUpdatedByReviewer when the entity was IN_REVIEW. That meant only a reviewer could delete a tag or test case under review. This PR deletes both overrides and moves the rule into EntityRepository.checkInReviewEntityDeletedByReviewer, which only runs when onlyReviewersDeleteInReview is true. That flag is set only on DataProduct, Metric and DataContract. So any user with delete permission can now delete an in-review tag or test case, even though the PR says the shared rules keep "each rule on the entity types that had it". Fix: set onlyReviewersDeleteInReview = true in the TagRepository and TestCaseRepository constructors, and add those types to the IT/unit coverage for the in-review delete rule.

✅ Bug: CSV import reviewer check never runs: original has no reviewers

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:1495-1509 📄 openmetadata-service/src/main/java/org/openmetadata/csv/EntityCsv.java:1129 📄 openmetadata-service/src/main/java/org/openmetadata/csv/EntityCsv.java:1224
applyEntityStatusRulesForImport gets original from findMatchForImport, which calls findByName and builds the entity from stored JSON only. storageJsonNode removes reviewers (FIELDS_STORED_AS_RELATIONSHIPS), and GlossaryTermRepository's override reads the raw JSON too. So when validateEntityStatusChange calls checkUpdatedByReviewer(original, ...), original.getReviewers() is always null and the check returns early. A CSV row that moves an entity from In Review to Approved or Rejected therefore succeeds for any importer, even when the entity has reviewers or a non-owning workflow is active. The PUT/PATCH path blocks the same move with 403. Fix: before validating, load the reviewers into original. For glossary terms that includes inherited reviewers (for example setFieldsInternal with the reviewers field, or getReviewers(original)).

🤖 Prompt for agents
Code Review: Adds shared lifecycle stage ownership to entities, with active workflows controlling stage transitions and per-type lifecycle declarations. Per-type flags preserve approval-task closing and reviewer rules on the types that had them, and memories migrate from `status` to `entityStatus`. Consider applying the glossary status-fixture exclusion in external bootstrap mode to prevent 403 errors when the workflow owns term stages in those tests.

1. 💡 Edge Case: Status-fixture exclusion is skipped in external (JPW) mode
   Files: openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java:180-185, openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java:245, openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java:256-270, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:1594-1606, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:1614-1624, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:2971-2985, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/GlossaryTermResourceIT.java:3058-3072

   The four GlossaryTermResourceIT status tests now set term stages with a direct PATCH. They only pass because `excludeGlossaryStatusFixturesFromApproval()` adds an exclusion filter to `GlossaryTermApprovalWorkflow`. That call runs inside `launcherSessionOpened`, after the early return taken when `JPW_MODE=external` or `skip.embedded.bootstrap=true`. Against an external server the workflow still owns these terms, so each PATCH gets the new 403 ("stage owned by workflow") and the tests fail. To fix this, apply the exclusion whenever the suite starts, including the external path (for example, run it lazily and idempotently from `GlossaryTestFactory.createForStatusTests`). Alternatively, skip these tests when the exclusion isn't in place.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backward-Incompatible-Change 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.

Support a shared lifecycle stage on entities and let active workflows own it

4 participants