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 (53)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (44)
📝 WalkthroughWalkthroughThe PR adds explicit graph-edge IDs, introduces node and relationship detail queries, updates Explore components to consume the new response shapes, and centralizes source-kind, tag-label, and application-name utilities. ChangesGraph response contracts
Shared detail hooks and providers
Explore integration
Edge information rendering
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Explore
participant useGraphItem
participant API
participant InformationPanel
Explore->>useGraphItem: resolve selected item ID
useGraphItem->>API: fetch node or relationship details
API-->>InformationPanel: return detail response
InformationPanel->>API: fetch source and target node details
API-->>InformationPanel: return node responses
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
a2164a4 to
94153c1
Compare
6c10d2e to
b0c929a
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
cmd/api/src/api/v2/cypherquery_test.go (1)
147-147: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert a non-zero relationship ID.
All fixtures leave edge IDs at their zero value, so these tests would pass even if relationship ID propagation were broken. Use a populated edge ID in at least one visible and hidden-edge case.
Also applies to: 473-473, 540-540, 623-623, 696-696
🤖 Prompt for 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. In `@cmd/api/src/api/v2/cypherquery_test.go` at line 147, Update the edge fixtures in the cypher query tests, including the visible cases and the hidden-edge cases at the referenced repeated locations, to use a non-zero relationship ID. Keep the assertions and other fixture fields unchanged so the tests verify relationship ID propagation rather than accepting the zero value.
🤖 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/views/Explore/ContextMenu/CopyMenuItem.tsx`:
- Around line 62-64: The handleCopyCypher function includes an extra closing
brace in the generated Cypher label pattern. Remove the stray `}` from the
template so copied queries use valid MATCH syntax such as MATCH (n:User).
In
`@packages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeInfoContent.tsx`:
- Around line 36-42: Update the EdgeInfoContent rendering flow around
sourceNodeQuery and targetNodeQuery to handle either query’s error state before
rendering node details. Return the established error or fallback UI when either
fetch fails, while preserving the existing loading guard and successful
rendering path.
---
Nitpick comments:
In `@cmd/api/src/api/v2/cypherquery_test.go`:
- Line 147: Update the edge fixtures in the cypher query tests, including the
visible cases and the hidden-edge cases at the referenced repeated locations, to
use a non-zero relationship ID. Keep the assertions and other fixture fields
unchanged so the tests verify relationship ID propagation rather than accepting
the zero value.
🪄 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: 3029b706-002a-4f86-a9fd-6f8e49b3ddcd
📒 Files selected for processing (53)
cmd/api/src/api/bloodhoundgraph/bloodhoundgraph.gocmd/api/src/api/bloodhoundgraph/conversions.gocmd/api/src/api/v2/cypherquery_test.gocmd/api/src/model/unified_graph.gocmd/ui/src/components/SigmaChart/GraphEdgeEvents.tsxcmd/ui/src/views/Explore/ContextMenu/AssetGroupMenuItem.test.tsxcmd/ui/src/views/Explore/ContextMenu/AssetGroupMenuItem.tsxcmd/ui/src/views/Explore/ContextMenu/ContextMenu.test.tsxcmd/ui/src/views/Explore/ContextMenu/ContextMenu.tsxcmd/ui/src/views/Explore/GraphView.test.tsxcmd/ui/src/views/Explore/GraphView.tsxcmd/ui/src/views/Explore/utils.test.tscmd/ui/src/views/Explore/utils.tspackages/javascript/bh-shared-ui/src/components/ExploreTable/ExploreTable.test.tsxpackages/javascript/bh-shared-ui/src/components/GraphDataCheckboxes/GraphDataCheckboxes.tsxpackages/javascript/bh-shared-ui/src/components/HelpTexts/shared/ACLInheritance.tsxpackages/javascript/bh-shared-ui/src/components/PageWithTitle.test.tsxpackages/javascript/bh-shared-ui/src/components/PageWithTitle.tsxpackages/javascript/bh-shared-ui/src/components/index.tspackages/javascript/bh-shared-ui/src/constants.tspackages/javascript/bh-shared-ui/src/hooks/index.tspackages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useAssetGroupTags.tsxpackages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useTagGlyphs.tspackages/javascript/bh-shared-ui/src/hooks/useExploreGraph/queries/utils.tspackages/javascript/bh-shared-ui/src/hooks/useExploreSelectedItem.tsxpackages/javascript/bh-shared-ui/src/hooks/useFetchEntityInfo/utils.tspackages/javascript/bh-shared-ui/src/hooks/useGraphItem.tsxpackages/javascript/bh-shared-ui/src/hooks/usePrimaryKind.tspackages/javascript/bh-shared-ui/src/hooks/useSourceKinds.tspackages/javascript/bh-shared-ui/src/mocks/handlers/zoneHandlers.tspackages/javascript/bh-shared-ui/src/providers/AppNameProvider.tsxpackages/javascript/bh-shared-ui/src/providers/index.tspackages/javascript/bh-shared-ui/src/types.tspackages/javascript/bh-shared-ui/src/views/Explore/ContextMenu/AssetGroupMenuItemPrivilegeZonesEnabled.test.tsxpackages/javascript/bh-shared-ui/src/views/Explore/ContextMenu/AssetGroupMenuItemPrivilegeZonesEnabled.tsxpackages/javascript/bh-shared-ui/src/views/Explore/ContextMenu/ContextMenuPrivilegeZonesEnabled.test.tsxpackages/javascript/bh-shared-ui/src/views/Explore/ContextMenu/ContextMenuPrivilegeZonesEnabled.tsxpackages/javascript/bh-shared-ui/src/views/Explore/ContextMenu/CopyMenuItem.test.tsxpackages/javascript/bh-shared-ui/src/views/Explore/ContextMenu/CopyMenuItem.tsxpackages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeInfoContent.test.tsxpackages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeInfoContent.tsxpackages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeInfoHeader.tsxpackages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeInfoPane.tsxpackages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeObjectInformation.test.tsxpackages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeObjectInformation.tsxpackages/javascript/bh-shared-ui/src/views/Explore/ExploreSearch/CypherSearch.test.tsxpackages/javascript/bh-shared-ui/src/views/Explore/GraphItemInformationPanel.tsxpackages/javascript/bh-shared-ui/src/views/Explore/index.tspackages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZones.tsxpackages/javascript/bh-shared-ui/src/views/PrivilegeZones/PrivilegeZonesCypherEditor/PrivilegeZonesCypherEditor.tsxpackages/javascript/js-client-library/src/client.tspackages/javascript/js-client-library/src/responses.tspackages/javascript/js-client-library/src/types.ts
💤 Files with no reviewable changes (1)
- packages/javascript/bh-shared-ui/src/components/index.ts
| const { data: sourceNode, ...sourceNodeQuery } = useGetNodeById(source_node_id); | ||
| const { data: targetNode, ...targetNodeQuery } = useGetNodeById(target_node_id); | ||
|
|
||
| const sourcePrimaryKind = usePrimaryKind(sourceNode?.kinds ?? []); | ||
| const targetPrimaryKind = usePrimaryKind(targetNode?.kinds ?? []); | ||
|
|
||
| if (sourceNodeQuery.isLoading || targetNodeQuery.isLoading) return null; |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
No handling for sourceNodeQuery/targetNodeQuery error state.
Only isLoading is checked before rendering; if either node fetch errors, sourceNode/targetNode stay undefined and the panel silently renders with blank names instead of an error/fallback state.
🤖 Prompt for 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.
In
`@packages/javascript/bh-shared-ui/src/views/Explore/EdgeInfo/EdgeInfoContent.tsx`
around lines 36 - 42, Update the EdgeInfoContent rendering flow around
sourceNodeQuery and targetNodeQuery to handle either query’s error state before
rendering node details. Return the established error or fallback UI when either
fetch fails, while preserving the existing loading guard and successful
rendering path.
ddlees
left a comment
There was a problem hiding this comment.
I'm just a lowly manager but it LGTM
Description
The main changes involved in this pull request are:
Aside from that there are various refactors in the UI to adapt to the new response shapes for passing, using, and displaying data in various components.
Motivation and Context
Resolves BED-8743
In order to support opengraph entity panels for relationships we need to start using the new get relationship by id endpoint to pull kind info data for a given edge since it will contain content to populate the collapsible sections.
How Has This Been Tested?
Unit tests have been updated to expect the new response shape as well as to call the new endpoint in the test server.
Screenshots (optional):
Types of changes
Checklist:
Summary by CodeRabbit
idvalues end-to-end for more reliable selection, labeling, and click/hover behavior.