fix(widget): Display internal objects representative in Audits Distribution List (#15773)#16750
Open
Archidoit wants to merge 8 commits into
Open
fix(widget): Display internal objects representative in Audits Distribution List (#15773)#16750Archidoit wants to merge 8 commits into
Archidoit wants to merge 8 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses audits “list distribution” widgets showing internal objects as Unknown by introducing a consistent representative.main for InternalObject entities, and updating the audits distribution query to use it so UI labels resolve properly.
Changes:
- Add
representative: Representative!to theInternalObjectGraphQL interface and to many concrete internal object types (backend + frontend schema sync). - Implement an
InternalObject.representativeresolver backed by a new internal-object representative extractor. - Update audits distribution list query and expand/adjust integration tests to validate
representative.main.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/savedFilter-test.ts | Extends saved filter query assertions to validate representative.main. |
| opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/group-test.ts | Extends groups query assertions to validate representative.main. |
| opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/audit-test.ts | Refactors audit queries and adds auditsDistribution test coverage for representative.main. |
| opencti-platform/opencti-graphql/src/resolvers/stixObjectOrStixRelationshipOrCreator.js | Removes an unnecessary eslint-disable comment (no functional change). |
| opencti-platform/opencti-graphql/src/resolvers/internalObject.js | Adds InternalObject.representative resolver using the new extraction helper. |
| opencti-platform/opencti-graphql/src/database/entity-representative.js | Adds internal-object representative extraction (extractInternalObjectRepresentative). |
| opencti-platform/opencti-graphql/src/modules/xtm/hub/news-feed/news-feed.graphql | Adds representative field to NewsFeedItem. |
| opencti-platform/opencti-graphql/src/modules/workspace/workspace.graphql | Adds representative field to Workspace. |
| opencti-platform/opencti-graphql/src/modules/theme/theme.graphql | Adds representative field to Theme. |
| opencti-platform/opencti-graphql/src/modules/task/task-template/task-template.graphql | Adds representative field to TaskTemplate. |
| opencti-platform/opencti-graphql/src/modules/support/support.graphql | Adds representative field to SupportPackage. |
| opencti-platform/opencti-graphql/src/modules/savedFilter/savedFilter.graphql | Adds representative field to SavedFilter. |
| opencti-platform/opencti-graphql/src/modules/publicDashboard/publicDashboard.graphql | Adds representative field to PublicDashboard. |
| opencti-platform/opencti-graphql/src/modules/playbook/playbook.graphql | Adds representative field to Playbook. |
| opencti-platform/opencti-graphql/src/modules/pir/pir.graphql | Adds representative field to Pir. |
| opencti-platform/opencti-graphql/src/modules/notifier/notifier.graphql | Adds representative field to Notifier. |
| opencti-platform/opencti-graphql/src/modules/notification/notification.graphql | Adds representative field to Trigger and Notification. |
| opencti-platform/opencti-graphql/src/modules/managerConfiguration/managerConfiguration.graphql | Adds representative field to ManagerConfiguration. |
| opencti-platform/opencti-graphql/src/modules/internal/jsonMapper/jsonMapper.graphql | Adds representative field to JsonMapper. |
| opencti-platform/opencti-graphql/src/modules/internal/csvMapper/csvMapper.graphql | Adds representative field to CsvMapper. |
| opencti-platform/opencti-graphql/src/modules/ingestion/ingestion-taxii.graphql | Adds representative field to IngestionTaxii. |
| opencti-platform/opencti-graphql/src/modules/ingestion/ingestion-taxii-collection.graphql | Adds representative field to IngestionTaxiiCollection. |
| opencti-platform/opencti-graphql/src/modules/ingestion/ingestion-rss.graphql | Adds representative field to IngestionRss. |
| opencti-platform/opencti-graphql/src/modules/ingestion/ingestion-json.graphql | Adds representative field to IngestionJson. |
| opencti-platform/opencti-graphql/src/modules/ingestion/ingestion-csv.graphql | Adds representative field to IngestionCsv. |
| opencti-platform/opencti-graphql/src/modules/form/form.graphql | Adds representative field to Form. |
| opencti-platform/opencti-graphql/src/modules/fintelTemplate/fintelTemplate.graphql | Adds representative field to FintelTemplate. |
| opencti-platform/opencti-graphql/src/modules/fintelDesign/fintelDesign.graphql | Adds representative field to FintelDesign. |
| opencti-platform/opencti-graphql/src/modules/exclusionList/exclusionList.graphql | Adds representative field to ExclusionList. |
| opencti-platform/opencti-graphql/src/modules/entitySetting/entitySetting.graphql | Adds representative field to EntitySetting. |
| opencti-platform/opencti-graphql/src/modules/emailTemplate/emailTemplate.graphql | Adds representative field to EmailTemplate. |
| opencti-platform/opencti-graphql/src/modules/draftWorkspace/draftWorkspace.graphql | Adds representative field to DraftWorkspace. |
| opencti-platform/opencti-graphql/src/modules/disseminationList/disseminationList.graphql | Adds representative field to DisseminationList. |
| opencti-platform/opencti-graphql/src/modules/deleteOperation/deleteOperation.graphql | Adds representative field to DeleteOperation. |
| opencti-platform/opencti-graphql/src/modules/decayRule/exclusions/decayExclusionRule.graphql | Adds representative field to DecayExclusionRule. |
| opencti-platform/opencti-graphql/src/modules/decayRule/decayRule.graphql | Adds representative field to DecayRule. |
| opencti-platform/opencti-graphql/src/modules/customView/customView.graphql | Adds representative field to CustomView. |
| opencti-platform/opencti-graphql/src/modules/catalog/catalog.graphql | Adds representative field to Catalog. |
| opencti-platform/opencti-graphql/src/modules/case/case-template/case-template.graphql | Adds representative field to CaseTemplate. |
| opencti-platform/opencti-graphql/src/modules/authenticationProvider/authenticationProvider.graphql | Adds representative field to AuthenticationProvider. |
| opencti-platform/opencti-graphql/config/schema/opencti.graphql | Adds representative to InternalObject interface/types and updates the union to include Vocabulary. |
| opencti-platform/opencti-graphql/src/generated/graphql.ts | Regenerates backend TypeScript GraphQL types to include representative across internal objects. |
| opencti-platform/opencti-front/src/schema/relay.schema.graphql | Syncs frontend Relay schema with backend (InternalObject.representative, union update). |
| opencti-platform/opencti-front/src/private/components/common/audits/AuditsDistributionList.tsx | Updates auditsDistribution query to fetch representative.main for InternalObject entities (removing special-casing for Group). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16750 +/- ##
==========================================
+ Coverage 24.09% 24.15% +0.06%
==========================================
Files 3271 3271
Lines 173270 173416 +146
Branches 42957 43029 +72
==========================================
+ Hits 41743 41890 +147
+ Misses 131527 131526 -1
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Related issues
fixes #15773