Skip to content

MINOR - SQL Studio config at team level#26269

Merged
pmbrull merged 24 commits intomainfrom
team-connection-qr
Mar 26, 2026
Merged

MINOR - SQL Studio config at team level#26269
pmbrull merged 24 commits intomainfrom
team-connection-qr

Conversation

@pmbrull
Copy link
Copy Markdown
Collaborator

@pmbrull pmbrull commented Mar 5, 2026

Describe your changes:

Base of https://github.com/open-metadata/openmetadata-collate/pull/3110

I worked on ... because ...

Type of change:

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

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • 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.

Summary by Gitar

  • Schema & TypeScript updates:
    • Added credentialSourceType enum field to QueryRunnerRequest and TestServiceConnectionRequest to track credential source (user vs team level)
  • Team details UI enhancements:
    • Integrated extension registry to support plugin-contributed tabs in TeamDetailsV1 component
    • Added TEAM_DETAILS_TABS extension point for custom team detail tabs
  • User selection improvements:
    • Added includeBot flag to UserSelectableList to optionally include bot users in selections
    • Added bot user indicator (icon) in user lists and team user tabs
  • API & utility updates:
    • Extended formatUsersResponse to include isBot field; updated PluginEntityDetailsContext with teamId property

This will update automatically on new commits.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
65% (58089/89365) 44.78% (30715/68576) 47.78% (9197/19245)

Remove isBot filter from UserSelectableList so bot users can be added
to teams. Add bot-profile icon next to username in user table columns
to visually distinguish bot users from regular users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 extends OpenMetadata’s UI + schema to support (a) tracking the credential source used by QueryRunner/TestConnection flows (user vs team) and (b) improving Team/User UX via plugin-extensible Team tabs and bot-user visibility/selection.

Changes:

  • Added credentialSourceType to QueryRunner/TestConnection request types (schema + generated TS).
  • Enabled plugin-contributed tabs on the Team Details page via a new TEAM_DETAILS_TABS extension point and teamId context.
  • Added optional bot inclusion in user selectors and bot indicators in user lists/team user management UI.

Reviewed changes

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

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/Users.util.tsx Adds bot indicator in user table cell renderer.
openmetadata-ui/src/main/resources/ui/src/utils/ExtensionPointTypes.ts Adds TEAM_DETAILS_TABS extension point and teamId to plugin context.
openmetadata-ui/src/main/resources/ui/src/utils/APIUtils.ts Extends formatted search user objects with isBot.
openmetadata-ui/src/main/resources/ui/src/generated/entity/automations/workflow.ts Adds generated credentialSourceType and enum for test-connection request.
openmetadata-ui/src/main/resources/ui/src/generated/entity/automations/queryRunnerRequest.ts Adds generated credentialSourceType and enum for query runner request.
openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.interface.ts Adds includeBot prop to allow bot inclusion.
openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx Implements bot inclusion in fetch + bot indicator rendering.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/UserTab/UserTab.component.tsx Enables bot inclusion when adding users to a team.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx Integrates extension registry to render plugin-contributed team tabs.
openmetadata-spec/src/main/resources/json/schema/entity/automations/queryRunnerRequest.json Adds credentialSourceType to the schema.
ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py Logs when PATCH to automation workflow returns None.

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/Users.util.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 24, 2026

OpenMetadata Service New-Code Coverage

✅ No changed production Java files under openmetadata-service/src/main/java. Coverage gate skipped.

Shrabanti Paul and others added 2 commits March 25, 2026 18:23
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.

pmbrull and others added 2 commits March 25, 2026 17:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Copilot reviewed 11 out of 13 changed files in this pull request and generated 5 comments.

Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/team.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/team.ts
…to param order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/Users.util.tsx
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.

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.

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.

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.

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.

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.

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Mar 26, 2026

Code Review 👍 Approved with suggestions 5 resolved / 6 findings

Adds SQL Studio configuration at the team level with ingestion support, resolving bot filter isolation and state management issues across multiple components. Consider verifying that TabsLabel properly handles undefined count values in the pluginTabs prop.

💡 Quality: pluginTabs count prop may be undefined — verify TabsLabel handles it

📄 openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:1169

In TeamDetailsV1.tsx at line 1169, tab.count is passed to <TabsLabel count={tab.count} />. The TabContribution interface defines count as optional. If TabsLabel renders the count badge unconditionally (e.g., displays "0" or "undefined"), this could produce a visual artifact. This is minor since TabsLabel likely handles undefined, but worth verifying.

✅ 5 resolved
Bug: Bot filter removed from shared UserSelectableList component

📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:51 📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:76
The isBot: false filter was removed from both the search query path (line 55, getTermQuery) and the fallback getUsers path (line 79) in UserSelectableList. This component is a shared user picker used across the application — not just for team member listings.

It is used in:

  • Team member management (UserTab.component.tsx) — showing bots here is the stated goal ✅
  • Domain expert assignment (DomainExpertWidget.tsx) — bots can now be assigned as domain experts ❌
  • Persona member assignment (PersonaDetailsPage.tsx) — bots can now be added to personas ❌
  • Generic USER_MULTI_SELECT form field (formUtils.tsx) — bots will appear in any form using this field type ❌

If the intent is only to show bots in team member listings (per the commit message "show bot users in team member listing with bot icon"), the bot filter should be removed only in the team-specific context rather than in this shared component. Consider adding an optional includeBot prop to UserSelectableList and only enabling it where needed.

Bug: Re-raising exception changes contract for callers

📄 ingestion/src/metadata/ingestion/ometa/mixins/patch_mixin.py:624
Adding raise at line 624 in patch_automation_workflow_response changes the method's contract from fire-and-forget to throwing. The callers in _test_connection_steps_automation_workflow iterate over test steps and call this method for each step. A transient PATCH failure will now abort all remaining test steps and trigger the WorkflowStatus.Failed fallback path, which was not the previous behavior.

If the intent is to make status-patch failures visible, consider re-raising only the RuntimeError (for the resp is None case) rather than re-raising all exceptions, or updating callers to handle partial failures gracefully.

Bug: botTagRenderer useCallback missing t dependency

📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:154
botTagRenderer is wrapped in useCallback(…, []) but references t from useTranslation() inside the callback (line 140: t('label.bot')). If the locale changes at runtime, the tooltip text will be stale. While t is generally stable in i18next, the lint rule react-hooks/exhaustive-deps would flag this and it's best practice to include it.

Edge Case: botUserIds ref never cleared between searches

📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:52 📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:69-75 📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:98-103
botUserIds is a useRef<Set<string>>(new Set()) that accumulates bot user IDs across paginated fetches and search queries, but is never cleared. If a user searches, scrolls through pages, and then searches again, IDs from prior results persist. This means a non-bot user whose ID collides with a previously-fetched bot user (unlikely but theoretically possible with ID reuse) could show the bot icon. More practically, the set grows unboundedly over the component's lifetime. Consider clearing the set when the search text changes.

Bug: Pre-populated botUserIds wiped on first fetch, losing bot indicators

📄 openmetadata-ui/src/main/resources/ui/src/components/common/UserSelectableList/UserSelectableList.component.tsx:60-74
The useEffect at lines 60-69 pre-populates botUserIds from selectedUsers so that already-selected bot users show the bot icon even if they aren't in the first fetched page. However, fetchOptions unconditionally calls botUserIds.current.clear() when !after (line 73), which runs on the initial fetch triggered by SelectableList mounting. This wipes the pre-populated IDs before botTagRenderer ever reads them, defeating the purpose of the useEffect.

Already-selected bot users will not display the bot indicator unless they happen to appear in the first page of fetched results.

🤖 Prompt for agents
Code Review: Adds SQL Studio configuration at the team level with ingestion support, resolving bot filter isolation and state management issues across multiple components. Consider verifying that TabsLabel properly handles undefined count values in the pluginTabs prop.

1. 💡 Quality: pluginTabs count prop may be undefined — verify TabsLabel handles it
   Files: openmetadata-ui/src/main/resources/ui/src/components/Settings/Team/TeamDetails/TeamDetailsV1.tsx:1169

   In TeamDetailsV1.tsx at line 1169, `tab.count` is passed to `<TabsLabel count={tab.count} />`. The `TabContribution` interface defines `count` as optional. If `TabsLabel` renders the count badge unconditionally (e.g., displays "0" or "undefined"), this could produce a visual artifact. This is minor since TabsLabel likely handles undefined, but worth verifying.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

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

Labels

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

6 participants