configuration-anomaly-detection icon indicating copy to clipboard operation
configuration-anomaly-detection copied to clipboard

Simplify the configuration loading

Open petrkotas opened this issue 8 months ago • 8 comments

The code simplifies the ocm config loading. It also moves the env variables right to the start, so it is obvious when they are used.

JIRA: https://issues.redhat.com/browse/SREP-71

petrkotas avatar May 07 '25 14:05 petrkotas

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: petrkotas Once this PR has been reviewed and has the lgtm label, please assign nikokolas3270 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

openshift-ci[bot] avatar May 07 '25 14:05 openshift-ci[bot]

Codecov Report

Attention: Patch coverage is 0.44248% with 225 lines in your changes missing coverage. Please review.

Project coverage is 30.48%. Comparing base (0445703) to head (36bc03c).

Files with missing lines Patch % Lines
cadctl/config/config.go 0.00% 91 Missing :warning:
cadctl/cmd/investigate/investigate.go 0.00% 57 Missing :warning:
pkg/ocm/ocm_config.go 0.00% 24 Missing :warning:
pkg/ocm/ocm.go 0.00% 17 Missing :warning:
pkg/metrics/metrics.go 0.00% 10 Missing :warning:
pkg/k8s/client.go 0.00% 6 Missing :warning:
cadctl/main.go 0.00% 4 Missing :warning:
pkg/logging/logging.go 20.00% 4 Missing :warning:
cadctl/cmd/root.go 0.00% 3 Missing :warning:
...rrorbudgetburn/clustermonitoringerrorbudgetburn.go 0.00% 3 Missing :warning:
... and 6 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #437      +/-   ##
==========================================
- Coverage   32.08%   30.48%   -1.60%     
==========================================
  Files          35       36       +1     
  Lines        2425     2529     +104     
==========================================
- Hits          778      771       -7     
- Misses       1587     1699     +112     
+ Partials       60       59       -1     
Files with missing lines Coverage Δ
...tigations/apierrorbudgetburn/apierrorbudgetburn.go 0.00% <0.00%> (ø)
...tions/insightsoperatordown/insightsoperatordown.go 8.45% <0.00%> (ø)
...e/machinehealthcheckunterminatedshortcircuitsre.go 50.29% <0.00%> (ø)
...cfailureover4hr/upgradeconfigsyncfailureover4hr.go 20.28% <0.00%> (ø)
pkg/managedcloud/managedcloud.go 0.00% <0.00%> (ø)
pkg/pagerduty/pagerduty.go 63.33% <0.00%> (+1.03%) :arrow_up:
cadctl/cmd/root.go 0.00% <0.00%> (ø)
...rrorbudgetburn/clustermonitoringerrorbudgetburn.go 10.86% <0.00%> (-0.50%) :arrow_down:
cadctl/main.go 0.00% <0.00%> (ø)
pkg/logging/logging.go 57.89% <20.00%> (-9.55%) :arrow_down:
... and 6 more
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar May 07 '25 14:05 codecov-commenter

/retest

petrkotas avatar May 13 '25 13:05 petrkotas

Looks good and generally makes sense to me. We have a couple more env variables flying around, but with this change it will be easy to integrate them later on or when needed.

Good stuff!

RaphaelBut avatar May 14 '25 12:05 RaphaelBut

/retest

petrkotas avatar May 20 '25 09:05 petrkotas

/retest

petrkotas avatar May 20 '25 09:05 petrkotas

@petrkotas: all tests passed!

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.

openshift-ci[bot] avatar May 21 '25 04:05 openshift-ci[bot]

The latest review is mostly style/chore type changes. The one major issue I see is that the metrics are likely broken by moving the pushgateway push() to the start of the investigation run.

typeid avatar May 26 '25 07:05 typeid