Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe hook now fetches database-backed entity data with ChangesNode lookup refactor
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant useFetchEntityInfo
participant apiClient
participant entityInformationEndpoints
useFetchEntityInfo->>useFetchEntityInfo: validate nodeType and check databaseId
alt databaseId present
useFetchEntityInfo->>apiClient: getNodeByID(Number(databaseId), { signal })
apiClient-->>useFetchEntityInfo: node_id, kinds, properties
else nodeType validated
useFetchEntityInfo->>entityInformationEndpoints: fetch validatedKind
entityInformationEndpoints-->>useFetchEntityInfo: data.data.props
else neither available
useFetchEntityInfo-->>useFetchEntityInfo: return empty kinds/properties
end
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/javascript/bh-shared-ui/src/hooks/useFetchEntityInfo/useFetchEntityInfo.test.tsx`:
- Around line 40-46: The `useFetchEntityInfo.test.tsx` setup is double-mocking
`apiClient.getNodeByID`, so `entityNodeByIdRequest` never intercepts anything
and the MSW handler is unused. Update the test to either unmock `apiClient` for
the case that should exercise `/api/v2/nodes/:id`, or remove
`entityNodeByIdRequest` if the test should stay fully mocked; keep the existing
`useFetchEntityInfo` and `getNodeByID` test names aligned with the chosen
approach.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0a4529df-5918-4c34-9ee5-1f598ba43f69
📒 Files selected for processing (4)
packages/javascript/bh-shared-ui/src/components/EntityInfo/EntityInfoContent.test.tsxpackages/javascript/bh-shared-ui/src/hooks/useFetchEntityInfo/useFetchEntityInfo.test.tsxpackages/javascript/bh-shared-ui/src/hooks/useFetchEntityInfo/useFetchEntityInfo.tsxpackages/javascript/bh-shared-ui/src/utils/entityInfoDisplay.ts
💤 Files with no reviewable changes (1)
- packages/javascript/bh-shared-ui/src/utils/entityInfoDisplay.ts
| if (validatedKind) { | ||
| ({ signal }) => { | ||
| if (databaseId) { | ||
| return apiClient.getNodeByID(Number(databaseId), { signal }).then((res) => { |
There was a problem hiding this comment.
Is it redundant to perform an additional validations on databaseId to ensure a valid ID before reaching backend?
There was a problem hiding this comment.
That's a good question. The type of databaseId is defined as string | undefined so the property may or may not be available depending on the context in which one is trying to load entity information. This may have changed since this code was written originally so I'll double check but that is why the validation is happening.
Description
The useFetchEntityInfo hook is updated to use the getNodByID endpoint to retrieve entity information instead of the cypher search endpoint.
Motivation and Context
Resolves BED-8742
This refactor will enable OG entity info support by routing through an endpoint that will return info section information derived from extension managed schemas.
How Has This Been Tested?
Unit tests have been updated and the change was verified locally.
Screenshots (optional):
Types of changes
Checklist:
Summary by CodeRabbit