Skip to content

Conversation

jotak
Copy link
Member

@jotak jotak commented Oct 7, 2025

Description

There was an abusive use of the autocompletion mechanism in filters.
It's primarily used to get a list of filter options out of a search value.
But it was also used, during page loading, to transform a filter textual
value (read from URL) into a normalized filter option. This is bad,
because triggers unnecessary API calls on page load.

The change consists in splitting concerns between autocompletion and
text mapping to normalized filter option.

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Oct 7, 2025

@jotak: This pull request references NETOBSERV-2441 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

In response to this:

Description

There was an abusive use of the autocompletion mechanism in filters.
It's primarily used to get a list of filter options out of a search value.
But it was also used, during page loading, to transform a filter textual
value (read from URL) into a normalized filter option. This is bad,
because triggers unnecessary API calls on page load.

The change consists in splitting concerns between autocompletion and
text mapping to normalized filter option.

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

openshift-ci bot commented Oct 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jpinsonneau for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@memodi
Copy link
Member

memodi commented Oct 7, 2025

@jotak IIUC, regression testing is sufficient on this one, let me know.

Copy link
Contributor

@jpinsonneau jpinsonneau Oct 8, 2025

Choose a reason for hiding this comment

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

That's related to #1049, we should keep it away from this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, I took that commit to speed up my build times locally but didn't intend to push

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

@jotak
Copy link
Member Author

jotak commented Oct 8, 2025

@memodi you can also verify (if you want) that the page freezing doesn't occur anymore.

For info, I have a second PR on the operator, that is related though not dependent: netobserv/network-observability-operator#2085
The netpol is the root cause for seeing long delays here, but it made other issues more visible, that I'm addressing here

There was an abusive use of the autocompletion mechanism in filters.
It's primarily used to get a list of filter options out of a search value.
But it was also used, during page loading, to transform a filter textual
value (read from URL) into a normalized filter option. This is bad,
because triggers unnecessary API calls on page load.

The change consists in splitting concerns between autocompletion and
text mapping to normalized filter option.
Copy link

openshift-ci bot commented Oct 8, 2025

@jotak: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/plugin-cypress 923d8c1 link true /test plugin-cypress

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jotak jotak added the needs-review Tells that the PR needs a review label Oct 10, 2025
@jotak jotak requested a review from jpinsonneau October 10, 2025 07:19
Copy link
Contributor

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

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

Code looks good (not tested)

Copy link

codecov bot commented Oct 12, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.19%. Comparing base (418cd67) to head (923d8c1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
web/src/utils/filter-options.ts 57.35% 29 Missing ⚠️
web/src/utils/filter-definitions.ts 77.77% 6 Missing ⚠️
...components/toolbar/filters/autocomplete-filter.tsx 0.00% 3 Missing ⚠️
web/src/components/toolbar/filters/text-filter.tsx 33.33% 1 Missing and 1 partial ⚠️
web/src/components/drawer/record/record-panel.tsx 0.00% 1 Missing ⚠️
web/src/model/filters.ts 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1060      +/-   ##
==========================================
- Coverage   53.20%   53.19%   -0.02%     
==========================================
  Files         205      205              
  Lines       11115    11142      +27     
  Branches     1295     1291       -4     
==========================================
+ Hits         5914     5927      +13     
- Misses       4689     4705      +16     
+ Partials      512      510       -2     
Flag Coverage Δ
uitests 55.94% <60.00%> (-0.03%) ⬇️
unittests 47.12% <ø> (ø)

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

Files with missing lines Coverage Δ
web/src/components/drawer/record/record-panel.tsx 51.47% <0.00%> (ø)
web/src/model/filters.ts 77.19% <66.66%> (+3.42%) ⬆️
web/src/components/toolbar/filters/text-filter.tsx 70.45% <33.33%> (ø)
...components/toolbar/filters/autocomplete-filter.tsx 62.10% <0.00%> (ø)
web/src/utils/filter-definitions.ts 74.86% <77.77%> (+0.70%) ⬆️
web/src/utils/filter-options.ts 43.16% <57.35%> (+2.13%) ⬆️

... and 2 files with indirect coverage changes

🚀 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.

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

Labels

jira/valid-reference lgtm needs-review Tells that the PR needs a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants