Skip to content

feat(report): add relationships tab and functionality to manage repor… (#7053) - #18339

Open
Terry PASQUET (tpasquet) wants to merge 1 commit into
masterfrom
7053-featux-display-relationships-in-a-reportcontainer-as-a-list-not-only-in-the-graph
Open

Terry PASQUET (tpasquet) wants to merge 1 commit into
masterfrom
7053-featux-display-relationships-in-a-reportcontainer-as-a-list-not-only-in-the-graph

Conversation

@tpasquet

Copy link
Copy Markdown

Proposed changes

  • Add a "Relationships" tab to Report, listing the STIX core relationships referenced by the report in a searchable, filterable, sortable, paginated table, instead of only via the Knowledge graph.
  • Reuse the existing StixCoreRelationships query, fragments, and the shared DataTable component — no backend, schema, or database change was needed.
  • Add bulk selection with a "Remove from the container" action, which detaches a relationship from the report without deleting it globally; the regular "Delete" action remains available separately.

Related issues

How to test this PR

  1. Open a Report that already has relationships attached and click the new Relationships tab.
  2. Confirm only relationships referenced by that report appear, and that search/filters keep that scope.
  3. Select one or more rows, click Remove from the container, confirm, and wait for the background task to complete under Data > Processing tasks.
  4. Confirm the relationship disappears from this report's tab but still exists globally (visible elsewhere).

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

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant use cases (coverage and e2e)
  • I added/updated the relevant documentation (either on GitHub or on Notion)
  • Where necessary, I refactored code to improve the overall quality

Further comments

  • Chose to reuse the existing StixCoreRelationships query and columns rather than clone them, unlike a few similar list screens already in the codebase; extracting a shared dataColumns helper could remove that remaining duplication in a follow-up.
  • The bulk "Remove from the container" action was validated up to its confirmation dialog only, to avoid mutating shared dev data; full completion relies on the (unexecuted) e2e test.

Copilot AI lite review requested due to automatic review settings September 17, 2026 15:30
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.75000% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.32%. Comparing base (d94daa3) to head (8cfc108).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
...s/analyses/reports/ReportStixCoreRelationships.tsx 13.33% 26 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (d94daa3) and HEAD (8cfc108). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (d94daa3) HEAD (8cfc108)
opencti-graphql 6 4
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     
Flag Coverage Δ
opencti-client-python 49.85% <ø> (ø)
opencti-front 13.12% <18.75%> (+0.44%) ⬆️
opencti-graphql 47.87% <ø> (-23.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tpasquet Terry PASQUET (tpasquet) added feature Type: new feature or capability (feat:). filigran team Item from the Filigran team. labels Sep 17, 2026
@Filigran-Automation Filigran Automation (Filigran-Automation) changed the title feat(report): add relationships tab and functionality to manage repor… feat(report): add relationships tab and functionality to manage repor… (#7053) Sep 17, 2026
@Filigran-Automation Filigran Automation (Filigran-Automation) removed the feature Type: new feature or capability (feat:). label Sep 17, 2026

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.

🟡 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 Complete label, 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 finally block 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 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ux): display relationships in a Report/container as a list, not only in the graph

3 participants