Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-1580 Reuse frontend config #105

Merged
merged 5 commits into from
Dec 13, 2024
Merged

Conversation

jpinsonneau
Copy link
Contributor

@jpinsonneau jpinsonneau commented Oct 17, 2024

Description

  • Added a script to pull frontend config from operator repo
  • Parse Columns to get Names, Sizes and Field names
  • Filter display & enrichment options from associated features
  • Shorten long text using a dictionnary

FYI columns naming changed since hardcoded values were not matching current configuration.

Dependencies

Based on #92
Operator config update: netobserv/network-observability-operator#819
Console plugin config update: netobserv/network-observability-console-plugin#621

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

Copy link

openshift-ci bot commented Oct 17, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 52.71318% with 61 lines in your changes missing coverage. Please review.

Project coverage is 22.66%. Comparing base (d4a9f3e) to head (9798f6b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/flow_capture.go 44.06% 32 Missing and 1 partial ⚠️
cmd/map_format.go 79.59% 10 Missing ⚠️
cmd/packet_capture.go 0.00% 10 Missing ⚠️
cmd/root.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   24.24%   22.66%   -1.58%     
==========================================
  Files           9       10       +1     
  Lines        1415     1337      -78     
==========================================
- Hits          343      303      -40     
+ Misses       1051     1015      -36     
+ Partials       21       19       -2     
Flag Coverage Δ
unittests 22.66% <52.71%> (-1.58%) ⬇️

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

Files with missing lines Coverage Δ
cmd/config.go 100.00% <100.00%> (ø)
cmd/root.go 25.00% <0.00%> (-1.81%) ⬇️
cmd/map_format.go 23.12% <79.59%> (-1.19%) ⬇️
cmd/packet_capture.go 0.00% <0.00%> (ø)
cmd/flow_capture.go 30.34% <44.06%> (-2.67%) ⬇️

@@ -397,6 +345,30 @@ func updateTable() {
}
}

func cycleOption(selection []string, exclusiveOptions []string, options []string, incr int) []string {
Copy link
Member

Choose a reason for hiding this comment

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

could you create a unit test for this one? I find it hard to understand, so some examples-by-test would help :-)

Copy link
Member

@jotak jotak Nov 4, 2024

Choose a reason for hiding this comment

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

also maybe a comment such as (if I understand correctly):

Cycles through options, with exclusive options first, then non-exclusive options, and last the full list of non-exclusive options all at once.

Copy link
Member

Choose a reason for hiding this comment

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

@jpinsonneau did you see my comments here ?

I forgot you were doing this and ended up something similar here https://github.com/netobserv/network-observability-cli/pull/137/files#diff-a86c8e951a1155a451b2d254dfecbb2d151455820c7954bc9795a96c8379b2a5R16-R24 , which I'll remove this you were here first :-)
But I have the feeling it can be simplified when using more structured data... at the end of the day, cycling is just incrementing or decrementing an index that could be persisted in memory rather than having to re-compute it by lookups and matching

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created https://issues.redhat.com/browse/NETOBSERV-2016 to address that in a followup 😉
Thanks !

Copy link
Member

@jotak jotak left a comment

Choose a reason for hiding this comment

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

mostly lgtm just a small comment

@jpinsonneau jpinsonneau mentioned this pull request Nov 20, 2024
10 tasks
@jpinsonneau
Copy link
Contributor Author

Config changes + rebase broke the UI:
5c942ef

@jotak
Copy link
Member

jotak commented Dec 13, 2024

/lgtm
to unblock the queue

But I feel like this would be simpler ? I'll double-check based on this PR later, if that would still work with it, maybe it won't

Copy link
Member

@jotak jotak left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

openshift-ci bot commented Dec 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

The pull request process is described 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

@jpinsonneau jpinsonneau merged commit a3ae803 into netobserv:main Dec 13, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants