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

Refactor route table ID parsing #566

Merged
merged 3 commits into from
Feb 20, 2023
Merged

Refactor route table ID parsing #566

merged 3 commits into from
Feb 20, 2023

Conversation

tyll
Copy link
Member

@tyll tyll commented Feb 10, 2023

Simplify the parsing of route table IDs to avoid unnecessary exception handling that makes the code harder to understand and triggers CodeQL warnings.

Related to #565

@tyll tyll mentioned this pull request Feb 10, 2023
@tyll tyll force-pushed the tabelid branch 2 times, most recently from 0ee4eeb to fb1ea1f Compare February 10, 2023 11:01
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2023

Codecov Report

Base: 42.95% // Head: 19.87% // Decreases project coverage by -23.09% ⚠️

Coverage data is based on head (70d1e9c) compared to base (77020c2).
Patch coverage: 25.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #566       +/-   ##
===========================================
- Coverage   42.95%   19.87%   -23.09%     
===========================================
  Files          13        5        -8     
  Lines        3043     1238     -1805     
  Branches      354      353        -1     
===========================================
- Hits         1307      246     -1061     
+ Misses       1736      992      -744     
Flag Coverage Δ
sanity 19.87% <25.00%> (+0.20%) ⬆️

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

Impacted Files Coverage Δ
module_utils/network_lsr/argument_validator.py 16.52% <25.00%> (-68.08%) ⬇️
module_utils/network_lsr/ethtool.py 38.70% <0.00%> (-61.30%) ⬇️
module_utils/network_lsr/utils.py 25.55% <0.00%> (-33.71%) ⬇️
module_utils/network_lsr/nm_provider.py 52.63% <0.00%> (-31.58%) ⬇️
library/network_state.py
module_utils/network_lsr/nm/client.py
module_utils/network_lsr/nm/__init__.py
module_utils/network_lsr/nm/error.py
module_utils/network_lsr/nm/provider.py
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tyll
Copy link
Member Author

tyll commented Feb 10, 2023

Proper code coverage requires linux-system-roles/.github#11 and linux-system-roles/tox-lsr#109 to be merged and this repo be updated with the changes.

@tyll tyll force-pushed the tabelid branch 2 times, most recently from 3e9d8b9 to dc53cd9 Compare February 10, 2023 22:27
@richm
Copy link
Contributor

richm commented Feb 10, 2023

Proper code coverage requires linux-system-roles/.github#11

merged - also submitted #569 for the network role

and linux-system-roles/tox-lsr#109 to be merged and this repo be updated with the changes.

merged - released tox-lsr 2.13.2 - submitted #570

I suggest merging #570 first, then I will rebase #569, then once that is merged, you can rebase this PR

@tyll
Copy link
Member Author

tyll commented Feb 11, 2023

Thanks, I merged your PRs and rebased this one.

@tyll tyll force-pushed the tabelid branch 2 times, most recently from 43912f4 to 038fb77 Compare February 11, 2023 06:58
@tyll
Copy link
Member Author

tyll commented Feb 13, 2023

Markdownlint is broken: actionshub/markdownlint#35

Simplify the parsing of route table IDs to avoid unnecessary exception
handling that makes the code harder to understand and triggers CodeQL
warnings. Also re-organize the unit tests and add a missing test for
table IDs higher than 0xFFFF_FFFF to achieve full test coverage.

Signed-off-by: Till Maas <opensource@till.name>
The route tables names are called names, also use "name" in the regex
constant instead of "alias".

Signed-off-by: Till Maas <opensource@till.name>
Signed-off-by: Till Maas <opensource@till.name>
Copy link
Collaborator

@liangwen12year liangwen12year left a comment

Choose a reason for hiding this comment

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

LGTM.

@tyll tyll merged commit 3ab1a10 into linux-system-roles:main Feb 20, 2023
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.

6 participants