Skip to content

Landing page oss#27979

Open
karanh37 wants to merge 3 commits intomainfrom
landing-page-oss
Open

Landing page oss#27979
karanh37 wants to merge 3 commits intomainfrom
landing-page-oss

Conversation

@karanh37
Copy link
Copy Markdown
Contributor

@karanh37 karanh37 commented May 8, 2026

Describe your changes:

Fixes #

This PR updates the Data Marketplace UI to filter which announcements are shown, by allowing AnnouncementsWidgetV2 to accept an explicit list of EntityTypes and using that list to filter results from the announcements API.

Type of change:

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

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

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.
  • 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.

Summary by Gitar

  • Component updates:
    • Added type property to AnnouncementsWidgetV2 to allow filtering by entity type.
    • Updated AnnouncementsWidgetV2 logic to filter active announcements based on the provided entity types.
  • UI Integration:
    • Updated DataMarketplacePage to pass DOMAIN and DATA_PRODUCT types to the AnnouncementsWidgetV2 component.

This will update automatically on new commits.

Copilot AI review requested due to automatic review settings May 8, 2026 06:24
@karanh37 karanh37 requested a review from a team as a code owner May 8, 2026 06:24
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the Data Marketplace UI to filter which announcements are shown, by allowing AnnouncementsWidgetV2 to accept an explicit list of EntityTypes and using that list to filter results from the announcements API.

Changes:

  • Pass an explicit entity-type filter (DOMAIN, DATA_PRODUCT) from DataMarketplacePage into AnnouncementsWidgetV2.
  • Add a new optional prop to AnnouncementsWidgetV2 and apply it to announcement filtering logic.

Reviewed changes

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

File Description
openmetadata-ui/src/main/resources/ui/src/pages/DataMarketplacePage/DataMarketplacePage.component.tsx Passes an entity-type filter into AnnouncementsWidgetV2 for the Data Marketplace page.
openmetadata-ui/src/main/resources/ui/src/components/DataMarketplace/AnnouncementsWidgetV2/AnnouncementsWidgetV2.component.tsx Adds a new prop to control filtering and applies it when fetching active announcements.
Comments suppressed due to low confidence (1)

openmetadata-ui/src/main/resources/ui/src/components/DataMarketplace/AnnouncementsWidgetV2/AnnouncementsWidgetV2.component.tsx:33

  • There is an import statement after a non-import declaration (type AnnouncementsWidgetV2Props ...). In ES modules/TypeScript, all imports must come before other statements; this will fail to compile/lint. Move the AnnouncementsWidgetV2Props type below the import block (or convert the later import into a type-only import earlier).
type AnnouncementsWidgetV2Props = WidgetCommonProps & {
  type?: EntityType[];
};
import {
  getEntityFQN,
  getEntityType,
  prepareFeedLink,
} from '../../../utils/FeedUtils';

Comment on lines +145 to +148
<AnnouncementsWidgetV2
type={[EntityType.DOMAIN, EntityType.DATA_PRODUCT]}
widgetKey="announcements"
/>
Comment on lines +145 to +148
<AnnouncementsWidgetV2
type={[EntityType.DOMAIN, EntityType.DATA_PRODUCT]}
widgetKey="announcements"
/>
@karanh37
Copy link
Copy Markdown
Contributor Author

karanh37 commented May 8, 2026

@gitar-bot address issues

Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 8, 2026

@gitar-bot address issues

Both issues have been addressed:

  1. Infinite re-fetch loop — Extracted [EntityType.DOMAIN, EntityType.DATA_PRODUCT] into a module-level constant ANNOUNCEMENT_TYPES in DataMarketplacePage.component.tsx. This prevents a new array reference from being created on every render, which was causing useCallback/useEffect to fire in a loop.

  2. Type alias between imports — Moved the AnnouncementsWidgetV2Props type alias to after all import statements in AnnouncementsWidgetV2.component.tsx.

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 8, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Stabilizes the AnnouncementsWidgetV2 component by resolving an infinite re-fetch loop caused by inline array props and correcting import ordering. No issues found.

✅ 2 resolved
Performance: Inline array prop causes infinite re-fetch loop

📄 openmetadata-ui/src/main/resources/ui/src/pages/DataMarketplacePage/DataMarketplacePage.component.tsx:146 📄 openmetadata-ui/src/main/resources/ui/src/components/DataMarketplace/AnnouncementsWidgetV2/AnnouncementsWidgetV2.component.tsx:99 📄 openmetadata-ui/src/main/resources/ui/src/components/DataMarketplace/AnnouncementsWidgetV2/AnnouncementsWidgetV2.component.tsx:101-103
The type prop is passed as an inline array literal [EntityType.DOMAIN, EntityType.DATA_PRODUCT] at the call site (DataMarketplacePage line 146). Since a new array reference is created on every render, the useCallback dependency type (line 99) changes on every render, which triggers the useEffect (line 101-103) to call fetchAnnouncements repeatedly, causing an infinite loop of API calls.

Fix: Either memoize the array at the call site, or stabilize the dependency inside the component (e.g., serialize the array for the dependency check).

Quality: Type alias declared between import statements

📄 openmetadata-ui/src/main/resources/ui/src/components/DataMarketplace/AnnouncementsWidgetV2/AnnouncementsWidgetV2.component.tsx:26-28
The AnnouncementsWidgetV2Props type alias (lines 26-28) is declared between two import blocks, which breaks import grouping conventions and may confuse linters/import organizers. Move it after all imports.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.47% (63115/101028) 42.87% (34123/79586) 45.84% (10067/21958)

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

🔴 Playwright Results — 2 failure(s), 10 flaky

✅ 4016 passed · ❌ 2 failed · 🟡 10 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 752 0 3 8
🔴 Shard 3 753 2 4 7
🟡 Shard 4 789 0 1 18
✅ Shard 5 687 0 0 41
🟡 Shard 6 736 0 2 8

Genuine Failures (failed on all attempts)

Features/Tasks/TaskNavigation.spec.ts › clicking task notification while on entity task tab refreshes the task list (shard 3)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: locator('.notification-box').locator('li.ant-list-item.notification-dropdown-list-btn').first()
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for locator('.notification-box').locator('li.ant-list-item.notification-dropdown-list-btn').first()�[22m

Features/Tasks/TaskNavigation.spec.ts › two sessions: admin on Columns tab creates task, assignee sees refresh on notification click (shard 3)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: locator('.notification-box').locator('li.ant-list-item.notification-dropdown-list-btn').first()
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for locator('.notification-box').locator('li.ant-list-item.notification-dropdown-list-btn').first()�[22m

🟡 10 flaky test(s) (passed on retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Create new Bundle Suite with bulk selected test cases (shard 2, 2 retries)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Workflows/WorkflowOssRestrictions.spec.ts › event-type-select is disabled in OSS (shard 3, 1 retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Should display custom properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Users.spec.ts › Create and Delete user (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

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.

3 participants