NETOBSERV-2056 manage field types & formats from config#681
NETOBSERV-2056 manage field types & formats from config#681jpinsonneau merged 3 commits intonetobserv:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #681 +/- ##
==========================================
+ Coverage 56.83% 59.22% +2.39%
==========================================
Files 197 159 -38
Lines 10154 6919 -3235
Branches 1192 1192
==========================================
- Hits 5771 4098 -1673
+ Misses 4015 2620 -1395
+ Partials 368 201 -167
Flags with carried forward coverage won't be shown. Click here to find out more. |
8761eee to
3d66d39
Compare
|
/retest |
config/sample-config.yaml
Outdated
| - 2: Inner (with the same source and destination node) | ||
| - name: IfDirections | ||
| type: number | ||
| type: number array |
There was a problem hiding this comment.
in another PR ( https://github.com/netobserv/network-observability-operator/pull/999/files#diff-1fc45b6b65862012ab2d4a19e8f92ce31c1801f0ed7c464c13ac3f0dc5a3b756R1268 - which you can review btw ;-) ), I'm doing the same kind of thing, except I use a new field name to avoid breaking something in the console. So, I guess it means I can rollback that part.
Just, I used the brackets convention to describe an array, like number[] ; wdyt, I'd say it's sufficiently known convention so we can use it?
There was a problem hiding this comment.
I can change the array keyword to [] indeed 👌
There was a problem hiding this comment.
an advantage of [] is that it takes less space here https://docs.openshift.com/container-platform/4.17/observability/network_observability/json-flows-format-reference.html
On my screen, the table isn't displayed full-width (also because of the TOC column) - IMO it could be better to keep it small
web/src/utils/fields.ts
Outdated
| @@ -1,8 +1,11 @@ | |||
| export type FieldType = 'string' | 'number'; | |||
| export type FieldType = 'string' | 'string array' | 'number' | 'number array'; | |||
There was a problem hiding this comment.
isn't it going to break something in the forceType function? This was the concern I had in netobserv/network-observability-operator#999 and the reason why I introduced docType instead ...
There was a problem hiding this comment.
(actually, reading the code again, maybe it was because I used object[] for net events that I had to introduce docType)
There was a problem hiding this comment.
forceType is skipping arrays so it should be good for now:
network-observability-console-plugin/web/src/utils/column-parser.ts
Lines 86 to 91 in 8fb9a44
We may improve it if needed. We could force arrays too 🤔
|
I will update the mocks in a followup since I need a cluster with fresh data |
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@jpinsonneau: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
Merging this as the field test is now passing. |

Description
Add array type and format to field configs.
Dependencies
netobserv/network-observability-operator#999
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.