-
Notifications
You must be signed in to change notification settings - Fork 11
Bugfix: Fix sudo check logs and wordings #315
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #315 +/- ##
==========================================
+ Coverage 93.73% 93.77% +0.04%
==========================================
Files 103 103
Lines 17881 17923 +42
==========================================
+ Hits 16760 16808 +48
+ Misses 1121 1115 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the misleading sudo check logging and updates the logic to mark a successful attempt at 1 rather than after a retry. Key changes include:
- Renaming and adjusting logic from check_sudo_status_with_retry to check_sudo_status_with_attempts.
- Updating log messages by adding a [BST] prefix and reflecting attempt numbers correctly.
- Adding new unit tests to handle exceptions during build container and auto-assessment log file reset.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/core/tests/Test_Bootstrapper.py | Updated test cases to use the new attempts-based sudo check logic. |
src/core/src/bootstrap/Constants.py | Renamed constant from MAX_CHECK_SUDO_RETRY_COUNT to MAX_CHECK_SUDO_ATTEMPTS. |
src/core/src/bootstrap/Bootstrapper.py | Updated log messages and function names to reflect the correct attempts logic. |
…into Bugfix/sudo_check_logs pull master changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments inline.
…uxPatchExtension into Bugfix/sudo_check_logs pull remote changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor comments. Overall okay to merge
…into Bugfix/sudo_check_logs pull master changes
8c9f3ad
to
be0add0
Compare
this release includes: [x] [Bugfix: Restore patch mode config on Image Default #301](#301) [x] [Clean-up: Envlayer dead-code clean-up for Environment Recorder and Emulator #304](#304) [x] [Bugfix: Reboot Manager behavior - multiple bugfixes & error rate reduction #310](#310) [x] [Bugfix: Fix sudo check logs and wordings #315](#315) [x] [Bugfix: Mitigation for environments with Python Unbuffered I/O #320](#320)
this release includes: [x] Bugfix: Restore patch mode config on Image Default (#301) [x] Clean-up: Envlayer dead-code clean-up for Environment Recorder and Emulator ( #304) [x] Bugfix: Reboot Manager behavior - multiple bugfixes & error rate reduction (#310) [x] Bugfix: Fix sudo check logs and wordings (#315) [x] Bugfix: Mitigation for environments with Python Unbuffered I/O (#320) [x] Bugfix: Correct reboot management parameters(#322)
[x] current condition is if sudo_status is true and attempts is 1, this will not get logged it's misleading and create confusion that success attempt happens on 2nd attempts and so on


[x] address sudo check is success start tracking successful attempt at 1
- if sudo_status and attempts >= 1
- not altering for attempts in range(1, Constants.MAX_CHECK_SUDO_ATTEMPTS + 1) to for attempts in range(0, Constants.MAX_CHECK_SUDO_ATTEMPTS) because for loop is exclusive. current code is start at 1 ensure we reflect success attempt at 1 then max attempt at 6 instead of success attempt at 0 then max attempt at 5.
[x] reword retry to attempt
[x] add [BST] (boostrapper) prefix to logs indicate the log msg is from boostrapper class
[x] add [BST] (boostrapper) prefix to logs indicate the log msg is from boostrapper class
[x] add ut to handle build_out_container raise exception
prior code change:
post code change:



