Fixes 30711: default data contracts to draft status - #30833
Fixes 30711: default data contracts to draft status#30833shrabantipaul-collate merged 90 commits into
Conversation
❌ PR checklist incompleteThis 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
There was a problem hiding this comment.
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
createContractpayloadentityStatustoDraftunless the user explicitly selects a different status. - Add an
entityStatusselect 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. |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi @PRADDZY UI check style is failing can you please take a look? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Head branch was pushed to by a user without write access
df024b2 to
09bb37e
Compare
|
@ShaileshParmar11 Pushed the UI checkstyle/status-label updates; checks are rerunning. |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…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>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🚦 Removed from the merge queue —
|
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedData 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. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
| 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
|



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:
High-level design:
N/A - small bug fix.
Tests:
Use cases covered
Unit tests
openmetadata-ui/src/main/resources/ui/src/components/DataContract/AddDataContract/AddDataContract.test.tsxopenmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsxBackend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
corepack yarn test --runInBand src/components/DataContract/AddDataContract/AddDataContract.test.tsx src/components/DataContract/ContractDetailFormTab/ContractDetailFormTab.test.tsx.\\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.\\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 --checkUI screen recording / screenshots:
Not attached; the status behavior is covered by focused component tests.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Greptile Summary
The PR changes new data contracts to default to Draft and exposes the lifecycle status in the contract details form.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: localize data contract status optio..." | Re-trigger Greptile