Skip to content

Conversation

rane-rajasi
Copy link
Contributor

@rane-rajasi rane-rajasi commented Mar 27, 2025

We have a force disable logic for machine default auto updates in Auto Patching. i.e. we disable all machine default auto updates if the VM is onboarded to Auto Patching.

This PR ensures that we reset to machine default auto updates when patch mode is reset to ImageDefault

Changes included
[x] Resetting to machine default for Aptitude Package Manager
[x] Resetting to machine default for Tdnf Package Manager
[x] Resetting to machine default for Yum Package Manager
[x] Resetting to machine default for Zypper Package Manager

In VM Tests
[x] Aptitude Package Manager: Tested on: Ubuntu 20.04
     - 1.core.log

[x] Tdnf Package Manager: Tested on Az Linux 2
     - 7.core.log

[x] Yum Package Manager: Tested on: RHEL 8.2
     - 4.core.log & 3.core.log

[x] Zypper Package Manager: Tested on: SUSE 12
     - 3.core.log

Pending
[x] log and preserve masked state and not disable machine default auto updates if the underlying config is masked (will be addressed in a separate PR)

@rane-rajasi rane-rajasi requested review from a team, najams, michellemcdaniel, Copilot, kjohn-msft, nikhim-um and feng-j678 and removed request for a team, najams, michellemcdaniel, nikhim-um and feng-j678 March 27, 2025 14:03
Copy link
Contributor

@Copilot Copilot AI left a 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 restores the configuration of machine default auto updates when patch mode is reset to ImageDefault, ensuring that the appropriate backup settings are reapplied for supported package managers. Key changes include:

  • Restoring machine default auto updates for both Yum and Aptitude package managers.
  • Adding new tests to verify the revert functionality under various service configurations.
  • Introducing a stub for the Zypper package manager’s revert functionality.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/core/tests/library/LegacyEnvLayerExtensions.py Adds conditional handling for reverting to ImageDefault for Yum.
src/core/tests/Test_YumPackageManager.py Introduces tests for reverting auto OS update settings for Yum services.
src/core/tests/Test_ConfigurePatchingProcessor.py Adds test setup to validate ImageDefault patch mode configuration.
src/core/tests/Test_AptitudePackageManager.py Adds tests for reverting auto OS update configuration under Aptitude.
src/core/src/package_managers/ZypperPackageManager.py Adds an unimplemented stub for reverting auto OS update configuration.
src/core/src/package_managers/YumPackageManager.py Implements revert functionality for Yum, DNF, and PackageKit services.
src/core/src/package_managers/PackageManager.py Introduces an abstract stub for revert functionality.
src/core/src/package_managers/AptitudePackageManager.py Implements revert functionality for Aptitude package manager.
src/core/src/core_logic/ConfigurePatchingProcessor.py Updates patch mode handling to include the ImageDefault branch.

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 96.21053% with 18 lines in your changes missing coverage. Please review.

Project coverage is 93.73%. Comparing base (d18a9ce) to head (badaa03).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...rc/core/src/package_managers/TdnfPackageManager.py 88.00% 6 Missing ⚠️
src/core/src/package_managers/YumPackageManager.py 89.65% 6 Missing ⚠️
...ore/src/package_managers/AptitudePackageManager.py 93.18% 3 Missing ⚠️
.../core/src/package_managers/ZypperPackageManager.py 93.75% 2 Missing ⚠️
src/core/src/package_managers/PackageManager.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #301      +/-   ##
==========================================
+ Coverage   93.53%   93.73%   +0.19%     
==========================================
  Files         103      103              
  Lines       17458    17881     +423     
==========================================
+ Hits        16330    16760     +430     
+ Misses       1128     1121       -7     
Flag Coverage Δ
python27 93.72% <96.21%> (+0.19%) ⬆️
python312 93.73% <96.21%> (+0.19%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kjohn-msft kjohn-msft added the bug Something isn't working label Mar 27, 2025
@kjohn-msft kjohn-msft changed the title Restore patch mode config on Image Default Bugfix: Restore patch mode config on Image Default Mar 27, 2025
@kjohn-msft
Copy link
Collaborator

Ping on status of this PR.

feng-j678
feng-j678 previously approved these changes Apr 3, 2025
Copy link
Collaborator

@kjohn-msft kjohn-msft left a comment

Choose a reason for hiding this comment

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

Comments inline

kjohn-msft
kjohn-msft previously approved these changes May 2, 2025
Copy link
Collaborator

@kjohn-msft kjohn-msft left a comment

Choose a reason for hiding this comment

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

Minor comment on unexercised code.

@kjohn-msft kjohn-msft added the OE PR is considered near complete due to OE sign-off. label May 2, 2025
@feng-j678 feng-j678 enabled auto-merge (squash) May 6, 2025 18:47
@feng-j678 feng-j678 merged commit cfdca4c into master May 6, 2025
8 checks passed
@feng-j678 feng-j678 deleted the rarane/repairitem/restorepatchmode branch May 6, 2025 18:47
@feng-j678 feng-j678 mentioned this pull request May 9, 2025
feng-j678 added a commit that referenced this pull request May 9, 2025
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)
@feng-j678 feng-j678 mentioned this pull request May 12, 2025
kjohn-msft pushed a commit that referenced this pull request May 12, 2025
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OE PR is considered near complete due to OE sign-off.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants