Skip to content

Fixes 30711: default data contracts to draft status - #30833

Merged
shrabantipaul-collate merged 90 commits into
open-metadata:mainfrom
PRADDZY:fix/data-contract-default-status
Sep 10, 2026
Merged

Fixes 30711: default data contracts to draft status#30833
shrabantipaul-collate merged 90 commits into
open-metadata:mainfrom
PRADDZY:fix/data-contract-default-status

Conversation

@PRADDZY

@PRADDZY PRADDZY commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #30711

Data contract creation now defaults new contracts to Draft instead of hardcoding Approved. The contract details step also exposes the status field so users can choose Draft, In Review, or Approved before saving.

Type of change:

  • Bug fix

High-level design:

N/A - small bug fix.

Tests:

Use cases covered

  • Creating a data contract without selecting a status sends Draft.
  • Creating a data contract after selecting In Review preserves the selected status.
  • Contract detail form renders the status selector with Draft, In Review, and Approved options.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated:
    • openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.test.tsx
    • openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx
  • Coverage %: Not measured; focused Jest coverage was not run.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not added; covered by focused component tests for this form behavior.

Manual testing performed

  1. corepack yarn test --runInBand src/components/DataContract/AddDataContract/AddDataContract.test.tsx src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx
  2. .\\node_modules\\.bin\\eslint.cmd --no-error-on-unmatched-pattern src/components/DataContract/AddDataContract/AddDataContract.tsx src/components/DataContract/AddDataContract/AddDataContract.test.tsx src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx
  3. .\\node_modules\\.bin\\prettier.cmd --config .\\.prettierrc.yaml --ignore-path .\\.prettierignore src/components/DataContract/AddDataContract/AddDataContract.tsx src/components/DataContract/AddDataContract/AddDataContract.test.tsx src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx --check

UI screen recording / screenshots:

Not attached; the status behavior is covered by focused component tests.

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.
  • No hard-to-understand code paths were added that require extra comments.
  • Not applicable: no JSON Schema changes.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

Greptile Summary

The PR changes new data contracts to default to Draft and exposes the lifecycle status in the contract details form.

  • Uses the selected status when creating a contract, falling back to Draft.
  • Adds Draft, In Review, and Approved options to the details form.
  • Updates component tests for default and explicitly selected statuses.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.tsx Creation now submits the selected entity status and defaults an absent value to Draft.
openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx Adds a translated lifecycle-status selector initialized from the contract or Draft.
openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.test.tsx Updates creation expectations and verifies that an explicitly selected status is submitted.
openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx Verifies the status field configuration and available lifecycle options.

Reviews (2): Last reviewed commit: "fix: localize data contract status optio..." | Re-trigger Greptile

@PRADDZY
PRADDZY requested a review from a team as a code owner August 2, 2026 22:30
Copilot AI lite review requested due to automatic review settings August 2, 2026 22:30
@github-actions

github-actions Bot commented Aug 2, 2026

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.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI 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.

Pull request overview

This PR fixes the Data Contract creation flow in the UI so newly created contracts default to Draft (instead of being hardcoded to Approved) and exposes a Status selector in the contract details step, aligning the UI with the entityStatus governance workflow.

Changes:

  • Default createContract payload entityStatus to Draft unless the user explicitly selects a different status.
  • Add an entityStatus select field to the Contract Details form tab (Draft / In Review / Approved).
  • Update and extend component tests to cover the defaulting behavior and preserving a user-selected status.

Reviewed changes

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

File Description
openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx Adds a Status selector to the contract details form and defaults it to Draft.
openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx Extends tests to assert the Status field is rendered and wired via generated form fields.
openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.tsx Removes hardcoded Approved status and defaults entityStatus to Draft when creating a contract.
openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.test.tsx Updates createContract expectations and adds a test ensuring a selected status is preserved.

Copilot AI review requested due to automatic review settings August 28, 2026 16:50

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@TeddyCr TeddyCr added the safe to test Add this label to run secure Github workflows on PRs label Aug 28, 2026
@TeddyCr
TeddyCr enabled auto-merge August 28, 2026 16:51
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 70%
70.5% (95308/135182) 55.03% (56386/102460) 56.4% (18825/33375)

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Hi @PRADDZY UI check style is failing can you please take a look?

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Hi @PRADDZY UI check style is failing can you please take a look?

Let me know once you are done with this @PRADDZY

PRADDZY and others added 3 commits August 31, 2026 13:21
auto-merge was automatically disabled August 31, 2026 08:16

Head branch was pushed to by a user without write access

@PRADDZY
PRADDZY force-pushed the fix/data-contract-default-status branch from df024b2 to 09bb37e Compare August 31, 2026 08:16
Copilot AI review requested due to automatic review settings August 31, 2026 08:16

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@PRADDZY

PRADDZY commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

@ShaileshParmar11 Pushed the UI checkstyle/status-label updates; checks are rerunning.

@github-actions github-actions Bot removed the safe to test Add this label to run secure Github workflows on PRs label Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@ShaileshParmar11 ShaileshParmar11 added the safe to test Add this label to run secure Github workflows on PRs label Sep 1, 2026
…opdown

getByRole('option') doesn't resolve against Ant Design's dropdown portal in CI,
causing a 5-minute hang until the test timeout kills the browser. Mirror the
established pattern for SLA selects: add popupClassName='contract-status-dropdown'
to the status Select in ContractDetailFormTab so the dropdown popup is scopeable,
then use .contract-status-dropdown [title="Approved"] in the E2E helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 8, 2026 05:37

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-09T02:47:53Z)

Blocked the queue: playwright-summary

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Data contracts now default to Draft status on creation, with the contract details form exposing the lifecycle status selector to allow users to choose Draft, In Review, or Approved before saving. Component tests verify both the default Draft behavior and explicit status selection. No issues found.

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

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 4 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 4 warning(s) across 2 changed file(s).

Count Rule
4 react-hooks/exhaustive-deps
All findings
Location Rule Message
🟡 src/components/DataContract/AddDataContract/AddDataContract.tsx:303:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'onSave' and 't'. Either include them or remove the dependency array. If 'onSave' changes too often, find the p
🟡 src/components/DataContract/AddDataContract/AddDataContract.tsx:518:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/components/DataContract/AddDataContract/AddDataContract.tsx:561:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.tsx:142:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'form'. Either include it or remove the dependency array.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data Contracts created via the UI are always set to Approved, bypassing Draft/review workflow