Skip to content

[frontend/backend] 'Only equal to' new filter operator (#5220)#14543

Open
Archidoit wants to merge 21 commits intomasterfrom
issue/5220_onlyEqualsTo
Open

[frontend/backend] 'Only equal to' new filter operator (#5220)#14543
Archidoit wants to merge 21 commits intomasterfrom
issue/5220_onlyEqualsTo

Conversation

@Archidoit
Copy link
Member

@Archidoit Archidoit commented Feb 20, 2026

Proposed changes

Add 2 new filter operators: 'only_eq_to' and 'not_only_eq_to'

  • Frontend: add the new operators for filters that can have several values
  • Backend implementation: handling the new operators for stix filtering and dynamic filtering
  • Backend tests
  • Documentation

Related issues

#5220

Screenshot

image

@Archidoit Archidoit self-assigned this Feb 20, 2026
@Archidoit Archidoit added the filigran team use to identify PR from the Filigran team label Feb 20, 2026
@Archidoit Archidoit marked this pull request as draft February 20, 2026 15:10
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.40%. Comparing base (58e8edf) to head (e88b417).
⚠️ Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
...m/opencti-front/src/utils/filters/filtersUtils.tsx 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14543      +/-   ##
==========================================
+ Coverage   32.36%   32.40%   +0.04%     
==========================================
  Files        3096     3096              
  Lines      210889   211185     +296     
  Branches    38195    38364     +169     
==========================================
+ Hits        68255    68437     +182     
- Misses     142634   142748     +114     
Flag Coverage Δ
opencti-client-python 45.50% <ø> (ø)
opencti-front 2.83% <0.00%> (+<0.01%) ⬆️
opencti-graphql 67.79% <100.00%> (+0.05%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@Archidoit Archidoit force-pushed the issue/5220_onlyEqualsTo branch from 57e1235 to c1d4b6c Compare February 23, 2026 10:15
@xfournet xfournet changed the base branch from release/current to master February 24, 2026 09:11
@Archidoit Archidoit force-pushed the issue/5220_onlyEqualsTo branch from 5d0cdb6 to 527c3e9 Compare February 24, 2026 12:14
@Archidoit Archidoit marked this pull request as ready for review February 24, 2026 15:35
@Archidoit Archidoit force-pushed the issue/5220_onlyEqualsTo branch from 527c3e9 to 164fc33 Compare February 24, 2026 15:41
@Archidoit Archidoit force-pushed the issue/5220_onlyEqualsTo branch from f9384d7 to 72d4d20 Compare February 25, 2026 09:00
@Archidoit Archidoit marked this pull request as draft February 25, 2026 13:56
@Archidoit Archidoit force-pushed the issue/5220_onlyEqualsTo branch from ffe253b to 018859c Compare February 25, 2026 16:52
@Archidoit Archidoit marked this pull request as ready for review February 25, 2026 16:53
expect(entityTypeMap.get('RetentionRule')).toBe(entitiesCounter.RetentionRule);
expect(data.edges.length).toEqual(entitiesCounterTotal);
const filterBaseTypes = R.uniq(R.map((e) => e.node.base_type, data.edges));
const filterBaseTypes = R.uniq(data.edges.map((e) => e.node.base_type));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be equivalent if we want to remove r.uniq

const filterBaseTypes = [...new Set(data.edges.map((e) => e.node.base_type))];

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed... it's a bit heavy and less clear, that's why I didn't replace uniq, but I can also remove uniq if you think it's better

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability-wise I think both are similar so I would go with removing the ramda dep here and below . Either way, whatever the choice consider updating the notion page (:, https://www.notion.so/filigran/How-to-remove-Ramda-a0a7ddfbf1b2400c883173b16d2c9fac

Copy link
Contributor

@alice-debra alice-debra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toby has pointed out a spelling error; it should be either 'only equals' or 'only equal to'.

@Archidoit
Copy link
Member Author

Archidoit commented Feb 26, 2026

Toby has pointed out a spelling error; it should be either 'only equals' or 'only equal to'.

@alice-debra which one do you prefer ? Maybe 'only equals' is shorter

@Archidoit Archidoit marked this pull request as draft February 26, 2026 16:39
@Archidoit Archidoit changed the title [frontend/backend] 'Only equals to' new filter operator (#5220) [frontend/backend] 'Only equals' new filter operator (#5220) Feb 26, 2026
@alice-debra
Copy link
Contributor

Toby has pointed out a spelling error; it should be either 'only equals' or 'only equal to'.

@alice-debra which one do you prefer ? Maybe 'only equals' is shorter

"only equal to" checked with @tobybutler405 :)

@Archidoit Archidoit changed the title [frontend/backend] 'Only equals' new filter operator (#5220) [frontend/backend] 'Only equal to' new filter operator (#5220) Feb 27, 2026
@Archidoit Archidoit marked this pull request as ready for review February 27, 2026 10:19
Copy link
Member

@fellowseb fellowseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice !

expect(entityTypeMap.get('RetentionRule')).toBe(entitiesCounter.RetentionRule);
expect(data.edges.length).toEqual(entitiesCounterTotal);
const filterBaseTypes = R.uniq(R.map((e) => e.node.base_type, data.edges));
const filterBaseTypes = R.uniq(data.edges.map((e) => e.node.base_type));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability-wise I think both are similar so I would go with removing the ramda dep here and below . Either way, whatever the choice consider updating the notion page (:, https://www.notion.so/filigran/How-to-remove-Ramda-a0a7ddfbf1b2400c883173b16d2c9fac

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants