fix: update get_messages_additional method to correctly filter number…#8
Open
adrianlasota wants to merge 1 commit into
Open
fix: update get_messages_additional method to correctly filter number…#8adrianlasota wants to merge 1 commit into
adrianlasota wants to merge 1 commit into
Conversation
|
We don't publish DEVs .whl. |
There was a problem hiding this comment.
Pull request overview
This PR updates Dmesg.get_messages_additional() to adjust how the dmesg shell pipeline is constructed (moving tail earlier), modernizes type annotations, and adds a unit test to verify the constructed command when service_name and lines are provided.
Changes:
- Refactors
get_messages_additional()command construction and tightens its type annotations. - Adds a unit test asserting the exact command issued for
service_name+lines. - Minor formatting cleanup in
mfd_dmesg/constants.py.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
mfd_dmesg/base.py |
Refactors get_messages_additional() typing and changes pipeline ordering to apply tail before greps. |
tests/unit/test_mfd_dmesg/test_base.py |
Adds a unit test to validate the executed shell command for get_messages_additional(). |
mfd_dmesg/constants.py |
Adjusts import formatting (whitespace). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dd6bb90 to
107ccd5
Compare
… of lines Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
107ccd5 to
dafbdb6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
get_messages_additionalmethod inmfd_dmesg/base.pyto improve type annotations, command construction logic, and test coverage. The changes enhance code clarity, ensure correct command execution, and add a dedicated test for command construction.Type annotation improvements:
service_name,expected_return_codes, andadditional_grepsparameters inget_messages_additionalto use more precise and modern Python type annotations, improving code readability and static analysis.Command construction and logic changes:
get_messages_additionalso thattail -n {lines}is applied before filtering withgrep, ensuring the correct subset of log lines is processed. The redundant finaltailwas removed. [1] [2]Testing enhancements:
test_get_messages_additional_command_checkintests/unit/test_mfd_dmesg/test_base.pyto verify that the correct shell command is executed when filtering by service name and line count, increasing confidence in the command construction logic.