Skip to content

Fixes #35580: Show AI Automations on every service type and fix drive asset reads and writes - #35582

Merged
Shreyansh100704 merged 7 commits into
mainfrom
feat/ai-automation-all-entity-types
Oct 16, 2026
Merged

Shreyansh100704 merged 7 commits into
mainfrom
feat/ai-automation-all-entity-types

Conversation

@Shreyansh100704

@Shreyansh100704 Shreyansh100704 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #35580

Four fixes that let AI Automations work on every service type and on drive assets. Companion to open-metadata/openmetadata-collate#7528, which extends AI Automations and AutoPilot to 19 asset types; the two PRs can merge in either order.

  1. UI: the Agents tab shows AI Automations on every service type. The classic service page and its Agents tab showed the Collate AI widget and sub-tab only for database services. AutoPilot now creates AI Automations for every service type, so the gate is removed (ServiceDetailsPage.tsx, Ingestion.component.tsx). The page's list call now also sends the service's type: service names are unique only within a type, and the Collate list endpoint rejects a name two types share without it. A server that predates serviceType ignores the parameter.
  2. Drive: a spreadsheet inside a folder resolves its drive service. Such a spreadsheet is CONTAINed by both the service and the folder. SpreadsheetRepository.setFields looked the service up without naming its type, so it returned whichever row the database gave first, often the folder. WorksheetRepository.prepare then rejected every worksheet write with 400 "Spreadsheet ... does not belong to service ...". The lookup now names driveService, as the bulk path and the directory and file repositories already do.
  3. Drive: reading one folder no longer 404s on a soft-deleted child. The single-entity read resolved each child with a lookup that throws for a soft-deleted entity, so GET /drives/directories/{id}?fields=children failed once any file in the folder was deleted. It now reuses the list path's child fetch, which skips them; the old per-child lookup is removed.
  4. Drive: ViewBasic can read a file's columns. FileResource mapped no view operation to columns, so reading them needed ViewAll, while a worksheet's and a table's columns need ViewBasic. File columns arrived with the SFTP connector (SFTP Connector for Drive Service #25304) without the mapping.

Type of change:

  • Bug fix

High-level design:

N/A, small change.

Tests:

Use cases covered

  • A database, dashboard, messaging, pipeline or drive service lists its AI Automations on its Agents tab.
  • Eight spreadsheets, each inside its own folder: each reports the drive service on GET, and a worksheet under each is created and patched.
  • A folder with one live and one soft-deleted file: GET with children,numberOfFiles,totalSize returns the live file only.

Unit tests

  • Jest: ServiceDetailsPage.test.tsx and the Ingestion folder, updated for the removed gate and the service type, 176 passed. ui-checkstyle:changed: clean.
  • FileResourceViewOperationsTest (new): columns maps to ViewBasic and sampleData stays ViewSampleData. It failed before the fix with columns unmapped.
  • DirectoryRepository and SpreadsheetRepository have no unit test: both changes are in the single-entity read path, which needs the database relationships, so their tests are the two new ITs below, each seen failing before its fix.

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/ for the changed behavior.
  • Files added/updated: SpreadsheetResourceIT (test_spreadsheetInDirectory_resolvesDriveServiceAndAcceptsWorksheetWrites), DirectoryResourceIT (test_getWithChildren_skipsSoftDeletedChild). Both failed before the fix: the spreadsheet reported the folder's id as its service, and the folder GET returned 404 "file instance for ... not found".
  • Run locally after the fix: SpreadsheetResourceIT and DirectoryResourceIT in full, 443 tests, 0 failures. WorksheetResourceIT and FileResourceIT in full: 1 failure, test_listWorksheetsBySpreadsheet, which passes alone; it expects its worksheets in the first 100 of all worksheets and fails once the class has created more.

Local Java test run: PASSED

  • Commit: d0ac488a521a (base origin/main)
  • Finished: 2026-10-15 20:00 UTC · 8.4 min
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (1 class) 1 1 0 0 1.8 passed
integration mysql-elasticsearch · parallel 16 2336 0 211 6.6 passed

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Not run: the OSS Playwright specs need an OpenMetadata server, and the local stack runs Collate. The changed pages were exercised in the companion Collate PR's Playwright run and in the manual checks below.

Manual testing performed

  1. Local Collate stack built from both branches, admin user.
  2. Triggered AutoPilot on Kafka, dbt Cloud and PowerBI services.
  3. Classic mode, Agents tab, Collate AI sub-tab, for the Kafka, dbt Cloud and PowerBI services: each listed its two AutoPilot agents, the list call carried serviceType, no error. Same check for a database service and a dashboard service that share a name: each loaded its own list.
  4. Drive, against the rebuilt server: six spreadsheets, each in its own folder, all reported driveService and accepted a worksheet PATCH (200). A folder with one live and one soft-deleted file returned 200 with only the live file, numberOfFiles 1. All test assets hard-deleted afterwards.

UI screen recording:

oss-pr-recording.webm

Recorded against the local Collate stack built with this branch at aa8811efc23 (the later merge of main changes none of the code shown), classic mode, admin: the Agents tab, Collate AI sub-tab, of the PowerBI, Kafka and dbt Cloud services, each listing its AutoPilot agents. The cards show "No status" because the classic page never passes run history to the widget, on main as well.

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.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Decision check: no new decision; the service lookup follows the pattern its sibling repositories already use.
  • I have added a test that covers the exact scenario we are fixing.

@Shreyansh100704
Shreyansh100704 requested review from TeddyCr and a balanced review from Copilot October 15, 2026 20:33

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

github-actions Bot commented Oct 15, 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 the safe to test Add this label to run secure Github workflows on PRs label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 46 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), 46 warning(s) across 2 changed file(s).

Count Rule
45 react-hooks/exhaustive-deps
1 openmetadata-imports/review-sequential-api-calls
All findings
Location Rule Message
🟡 src/components/Settings/Services/Ingestion/Ingestion.component.tsx:74:5 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'serviceCategory'. Either exclude it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:378:8 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'location.search'. Either exclude it or remove the dependency array. Outer scope values like 'location.search'
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:407:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'serviceCategory'. Either exclude it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:433:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:445:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'setFilters'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:469:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'getEntityPermissionByFqn'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:488:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:528:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'handlePageChange', 'navigate', and 'setFilters'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:556:40 openmetadata-imports/review-sequential-api-calls Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:640:5 react-hooks/exhaustive-deps React Hook useCallback has an unnecessary dependency: 'ingestionPaging'. Either exclude it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:755:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:769:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:788:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:829:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:843:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:859:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:875:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:889:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:904:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:926:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handleFilesPagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:951:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handleSpreadsheetsPagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1015:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1058:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'navigate' and 'setFilters'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1080:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'followers', 'serviceDetails', and 't'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1105:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'serviceDetails' and 't'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1277:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1390:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1447:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'handleShowDeleted' and 'showDeleted'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1457:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1484:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1491:5 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'serviceCategory'. Either exclude it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1520:8 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1548:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'getOtherDetails'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1603:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchDashboardsDataModel', 'fileSearchValue', and 'spreadSheetSearchValue'. Either include them or remove the de
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1668:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchServiceDetails'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1674:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchServicePermission' and 'isOpenMetadataService'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1688:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'currentIngestionPage', 'getAllIngestionWorkflows', 'ingestionPagingCursor?.pageSize', 'isOpenMetadataService', a
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1700:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'collateAgentPagingCursor?.pageSize' and 'fetchCollateAgentsList'. Either include them or remove the dependency a
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1704:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchWorkflowInstanceStates'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1731:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'fetchCollateAgentsList'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1770:5 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'ingestionPaging'. Either exclude it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:1863:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:2046:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'pagingInfo', 'setFilters', and 't'. Either include them or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:2096:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'permissions'. Either include it or remove the dependency array.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:2096:25 react-hooks/exhaustive-deps React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.
🟡 src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:2101:6 react-hooks/exhaustive-deps React Hook useCallback has an unnecessary dependency: 'serviceDetails.fullyQualifiedName'. Either exclude it or remove the dependency array.

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

make ui-checkstyle-changed

Copilot AI balanced review requested due to automatic review settings October 15, 2026 20:47

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.

@gitar-bot

gitar-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🔴 High risk · Mapping file columns to ViewBasic broadens authorization, so users with basic access could see metadata previously requiring ViewAll.

Extends AI Automations to every service type on the classic Agents tab, sends serviceType with the list call, and fixes drive reads and writes: spreadsheets in folders now resolve their drive service, folder reads skip soft-deleted children, and ViewBasic can read file columns. Resolved the missing decision record for the new serviceType parameter and the module-wide database mock in the non-database test. No issues found.

✅ 2 closed
✅ Quality: New serviceType param on /ai/automations has no decision record

📄 openmetadata-ui/src/main/resources/ui/src/rest/applicationAPI.ts:212-226 📄 openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx:593-596
The list call now sends serviceType (and the type comes from getEntityTypeFromServiceCategory, so the value is an entity type such as dashboardService). The Collate /ai/automations endpoint has to accept the same parameter name and value format, which makes this a REST contract between two repositories. Per the decision-records rule this needs a record, and nothing under docs/decisions/ covers it. The PR description says the rule only in prose: "service names are unique only within a type, and the Collate list endpoint rejects a name two types share without it. A server that predates serviceType ignores the parameter." The record would say: A service-scoped /ai/automations list request names the service by FQN plus its serviceType, given as the service's entity type (e.g. databaseService, dashboardService), because service names are unique only per type. Servers that do not know the parameter ignore it.

✅ Quality: Non-database test asserts 'database' via a module-wide mock

📄 openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.test.tsx:1758-1772
getEntityTypeFromServiceCategory is mocked for the whole module to always return 'database' (ServiceDetailsPage.test.tsx:549). Because of that, the new test 'should fetch agents for non-database services too' renders a MESSAGING_SERVICES page and still expects getAiAutomationsByService('test-service', 'database'). The test would still pass if the page ignored serviceCategory or hardcoded the type, so it never checks the behaviour this PR adds: sending the right type for a non-database service. In this test, mock the helper to return messagingService (or use the real implementation) and assert that value.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 78%
77.94% (127638/163750) 64.61% (80730/124948) 65.84% (26993/40996)

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

} else {
directory.withChildren(null);
}
fetchAndSetStatistics(List.of(directory), fields);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i take it this method was already defined and we're just using it here right

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Shreyansh100704
Shreyansh100704 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 1ec0ab7 Oct 16, 2026
92 of 94 checks passed
@Shreyansh100704
Shreyansh100704 deleted the feat/ai-automation-all-entity-types branch October 16, 2026 13:25
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI Automations hidden on non-database services, and drive asset reads and writes fail

4 participants