feat(report): add relationships tab and functionality to manage repor… (#7053) - #18339
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18339 +/- ##
==========================================
- Coverage 36.37% 28.32% -8.06%
==========================================
Files 3467 3468 +1
Lines 140945 141610 +665
Branches 38052 38366 +314
==========================================
- Hits 51274 40113 -11161
- Misses 89671 101497 +11826
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Critical removal and task-scoping issues, plus E2E reliability issues, remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a Report Relationships tab with scoped listing, filtering, pagination, and bulk removal using existing queries and DataTable.
Changes:
- Adds Report relationships routing and UI.
- Adds report-scoped relationship removal.
- Adds backend, unit, and E2E coverage.
Review findings remain around endpoint detachment, bulk-task scoping, E2E task polling, and cleanup reliability.
File summaries
| File | Reviewed changes |
|---|---|
opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/container-test.ts |
Tests relationship membership and removal. |
opencti-platform/opencti-graphql/tests/01-unit/database/filtering-utils-test.ts |
Tests relationship filter conversion. |
opencti-platform/opencti-front/tests_e2e/report/reportRelationships.spec.ts |
Adds Report relationship E2E scenarios. |
opencti-platform/opencti-front/tests_e2e/model/SDOTabs.pageModel.ts |
Adds Relationships tab navigation. |
opencti-platform/opencti-front/tests_e2e/dataForTesting/report.data.ts |
Supports report object references. |
opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectTabsBox.tsx |
Registers the Relationships tab. |
opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectTabsBox.test.tsx |
Tests tab configuration. |
opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectMain.tsx |
Adds the Relationships route. |
opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectMain.test.tsx |
Tests route configuration. |
opencti-platform/opencti-front/src/private/components/analyses/reports/Root.tsx |
Mounts the Report relationships component. |
opencti-platform/opencti-front/src/private/components/analyses/reports/ReportStixCoreRelationships.tsx |
Implements the scoped relationship table and removal actions. |
opencti-platform/opencti-front/src/private/components/analyses/reports/ReportStixCoreRelationships.test.ts |
Tests report filter construction. |
Review details
Suppressed comments (2)
opencti-platform/opencti-front/tests_e2e/report/reportRelationships.spec.ts:121
- This polls for any visible
Completelabel, not the task created by this test. An older completed task can satisfy the condition while the remove task is still pending, so the subsequent relationship assertion races; poll for the created task or for the relationship to disappear instead.
return page.getByText('Complete').first().isVisible();
opencti-platform/opencti-front/tests_e2e/report/reportRelationships.spec.ts:67
- The report is deleted only on the success path above. If a UI assertion fails before line 55, this
finallyblock removes the relationship but leaves the generated report behind, polluting subsequent E2E runs. Make report cleanup unconditional while avoiding a duplicate-delete failure.
await deleteRelationship(request, relationshipInput);
- Files reviewed: 12/12 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| userFilters: FilterGroup | undefined, | ||
| ): FilterGroup => ({ | ||
| mode: 'and', | ||
| filters: [{ key: 'objects', values: [reportId], operator: 'eq', mode: 'or' }], |
| lineFragment={stixCoreRelationshipsFragment} | ||
| preloadedPaginationProps={preloadedPaginationProps} | ||
| exportContext={{ entity_id: reportId, entity_type: 'stix-core-relationship' }} | ||
| container={{ id: reportId }} |
Proposed changes
StixCoreRelationshipsquery, fragments, and the sharedDataTablecomponent — no backend, schema, or database change was needed.Related issues
How to test this PR
Backend unit and frontend unit tests were run and pass. Backend integration and both e2e tests are written but were not executed this session (require a running platform and worker).
Checklist
Further comments
StixCoreRelationshipsquery and columns rather than clone them, unlike a few similar list screens already in the codebase; extracting a shareddataColumnshelper could remove that remaining duplication in a follow-up.