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-1706: fix error displayed due to max-chunk-age #552

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

jotak
Copy link
Member

@jotak jotak commented Jul 1, 2024

Description

When Loki is disabled, do not try to fetch max-chunk-age. More changes alongside:

  • fetch max-chunk-age as part of the config fetching (ie. just 1 API call instead of 2) -> this simplifies a bit the loading sequence on the frontend
  • Use mapstructure for decoding loki config (refactor getting limits & max-chunk-age in that way)
  • Manage unset max-chunk-age more explicitly (undefined instead of NaN)
  • Add tests

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

When Loki is disabled, do not try to fetch max-chunk-age.
More changes alongside:

- fetch max-chunk-age as part of the config fetching (ie. just 1 API
  call instead of 2)
  -> this simplifies a bit the loading sequence on the frontend
- Use mapstructure for decoding loki config (refactor getting limits &
  max-chunk-age in that way)
- Manage unset max-chunk-age more explicitly (undefined instead of NaN)
- Add tests
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 1, 2024

@jotak: This pull request references NETOBSERV-1706 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.17.0" version, but no target version was set.

In response to this:

Description

When Loki is disabled, do not try to fetch max-chunk-age. More changes alongside:

  • fetch max-chunk-age as part of the config fetching (ie. just 1 API call instead of 2) -> this simplifies a bit the loading sequence on the frontend
  • Use mapstructure for decoding loki config (refactor getting limits & max-chunk-age in that way)
  • Manage unset max-chunk-age more explicitly (undefined instead of NaN)
  • Add tests

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

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 50.90909% with 27 lines in your changes missing coverage. Please review.

Project coverage is 56.21%. Comparing base (520f3ff) to head (37d85e6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #552      +/-   ##
==========================================
- Coverage   56.32%   56.21%   -0.12%     
==========================================
  Files         183      183              
  Lines        9095     9081      -14     
  Branches     1185     1183       -2     
==========================================
- Hits         5123     5105      -18     
+ Misses       3606     3605       -1     
- Partials      366      371       +5     
Flag Coverage Δ
uitests 57.48% <66.66%> (-0.38%) ⬇️
unittests 52.67% <50.00%> (+0.64%) ⬆️

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

Files Coverage Δ
pkg/config/config.go 44.33% <ø> (ø)
pkg/httpclient/httpclienttest/http_client_mock.go 100.00% <100.00%> (ø)
pkg/server/routes.go 70.73% <100.00%> (-0.70%) ⬇️
web/src/components/modals/time-range-modal.tsx 47.70% <ø> (ø)
...components/query-summary/summary-panel-content.tsx 42.74% <ø> (ø)
web/src/components/query-summary/summary-panel.tsx 100.00% <ø> (ø)
web/src/model/config.ts 100.00% <ø> (ø)
web/src/utils/config.ts 81.81% <100.00%> (-3.90%) ⬇️
web/src/components/netflow-traffic.tsx 56.24% <50.00%> (-0.79%) ⬇️
pkg/handler/frontend-config.go 12.50% <0.00%> (-2.89%) ⬇️
... and 1 more

... and 3 files with indirect coverage changes

@jotak
Copy link
Member Author

jotak commented Jul 1, 2024

/approve
agreed with @memodi to verify post-merge

Copy link

openshift-ci bot commented Jul 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jotak

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

@openshift-ci openshift-ci bot added the approved label Jul 1, 2024
@memodi
Copy link
Contributor

memodi commented Jul 1, 2024

/cc @Amoghrd

@openshift-ci openshift-ci bot requested a review from Amoghrd July 1, 2024 14:26
@openshift-merge-bot openshift-merge-bot bot merged commit 1a710ec into netobserv:main Jul 1, 2024
11 checks passed
jotak added a commit to jotak/network-observability-console-plugin that referenced this pull request Jul 15, 2024
When Loki is disabled, do not try to fetch max-chunk-age.
More changes alongside:

- fetch max-chunk-age as part of the config fetching (ie. just 1 API
  call instead of 2)
  -> this simplifies a bit the loading sequence on the frontend
- Use mapstructure for decoding loki config (refactor getting limits &
  max-chunk-age in that way)
- Manage unset max-chunk-age more explicitly (undefined instead of NaN)
- Add tests
jotak added a commit that referenced this pull request Jul 16, 2024
When Loki is disabled, do not try to fetch max-chunk-age.
More changes alongside:

- fetch max-chunk-age as part of the config fetching (ie. just 1 API
  call instead of 2)
  -> this simplifies a bit the loading sequence on the frontend
- Use mapstructure for decoding loki config (refactor getting limits &
  max-chunk-age in that way)
- Manage unset max-chunk-age more explicitly (undefined instead of NaN)
- Add tests
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.

None yet

4 participants