Skip to content

Conversation

jotak
Copy link
Member

@jotak jotak commented Dec 11, 2024

Upgrading linter showed some potential actual bugs during cleanup / exit, where deferred functions aren't called when something like log.Fatal or os.Exit is called, so I had to move things around to fix that (basically: having functions returning errors in case of doing something Fatal, and dealing with fatality in caller)

@jotak jotak requested a review from jpinsonneau December 11, 2024 10:09
Copy link

openshift-ci bot commented Dec 11, 2024

[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 ask for approval from jotak. For more information see the Kubernetes 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

Replace all big switches with some (hopefully) simpler mechanism that
loops forward/backward by inc/decrementing an index in a more structured
definition
@jotak
Copy link
Member Author

jotak commented Dec 11, 2024

(second commit was sort of related to the linter upgrade, since I had to refactor all those big if/else chains for display loops into switches, I'm thinking it can be refactored even further)

@jotak jotak changed the title Upgrade linter Upgrade linter + refactor display loops Dec 11, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 34.25926% with 71 lines in your changes missing coverage. Please review.

Project coverage is 26.20%. Comparing base (01f00d0) to head (27b52da).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
cmd/flow_capture.go 4.44% 42 Missing and 1 partial ⚠️
cmd/packet_capture.go 0.00% 18 Missing ⚠️
cmd/flow_db.go 40.00% 6 Missing ⚠️
e2e/cluster/kind.go 0.00% 3 Missing ⚠️
cmd/root.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
+ Coverage   26.00%   26.20%   +0.19%     
==========================================
  Files           8        9       +1     
  Lines        1315     1225      -90     
==========================================
- Hits          342      321      -21     
+ Misses        952      888      -64     
+ Partials       21       16       -5     
Flag Coverage Δ
unittests 26.20% <34.25%> (+0.19%) ⬆️

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

Files with missing lines Coverage Δ
cmd/display_loop.go 100.00% <100.00%> (ø)
cmd/root.go 43.13% <0.00%> (-3.16%) ⬇️
e2e/cluster/kind.go 0.00% <0.00%> (ø)
cmd/flow_db.go 51.35% <40.00%> (+1.35%) ⬆️
cmd/packet_capture.go 0.00% <0.00%> (ø)
cmd/flow_capture.go 30.14% <4.44%> (-3.61%) ⬇️

@jotak
Copy link
Member Author

jotak commented Dec 11, 2024

oh I forgot @jpinsonneau you did a similar thing in #105 for looping through display modes :(
my bad, I'll remove that

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

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.

@jotak jotak closed this Dec 17, 2024
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