Safety net: Explicitly block Azure Linux 4 and RHEL 10 until LPE support is available#344
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #344 +/- ##
==========================================
+ Coverage 93.82% 93.84% +0.02%
==========================================
Files 105 105
Lines 18172 18218 +46
==========================================
+ Hits 17049 17096 +47
+ Misses 1123 1122 -1
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.
Pull request overview
This PR adds a safety-net to prevent Linux Patch Extension from running on Azure Linux 4.x and RHEL 10.x until dnf5 support is implemented/validated, by detecting those OS versions during package manager detection and raising an explicit exception. It also adds unit tests for these new unsupported-OS behaviors.
Changes:
- Add Azure Linux 4 and RHEL 10 blocking logic to
EnvLayer.get_package_manager(). - Update Azure Linux version-check docstring wording (
3 or beyond). - Add new unit tests/mocks covering Azure Linux 4 and RHEL 10 unsupported cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/core/src/bootstrap/EnvLayer.py |
Adds OS version detection and hard-block exceptions for Azure Linux 4+ and RHEL 10+. |
src/core/tests/Test_EnvLayer.py |
Adds mocks and unit tests asserting exceptions for Azure Linux 4 and RHEL 10. |
Comments suppressed due to low confidence (1)
src/core/tests/Test_EnvLayer.py:189
- This test patches
platform.systembut does not restore it afterward, which can affect subsequent tests in the same run. Please back up and restoreplatform.system(preferably usingtry/finallyalongside the other restorations).
platform.system = self.mock_platform_system
self.envlayer.platform.linux_distribution = self.mock_linux_distribution
distro.os_release_attr = self.mock_distro_os_release_attr_return_rhel_10
distro.id = self.mock_distro_id_return_rhel
with self.assertRaises(Exception) as context:
self.envlayer.get_package_manager()
self.assertEqual(str(context.exception), "RHEL 10 is not yet supported in your region. Please review aka.ms/LinuxPatchExtension for more information.")
# restore
distro.id = self.backup_distro_id
distro.os_release_attr = self.backup_distro_os_release_attr
self.envlayer.platform.linux_distribution = self.backup_linux_distribution
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kjohn-msft
left a comment
There was a problem hiding this comment.
@rane-rajasi to review deeper with context of comments left.
rane-rajasi
left a comment
There was a problem hiding this comment.
Make sure to upload latest inVM testing logs since the code has changed from its previous implementation
ef41e31 to
6e07a3c
Compare
@rane-rajasi The outputs attached in description is latest from yesterday after the change. |
rane-rajasi
left a comment
There was a problem hiding this comment.
Only one minor comment
Release contains - Explicitly blocking AzLinux 4 and RHEL10 support until code is fully ready : [#344]
Linux4 VM ARM ID : /subscriptions/6acc8a91-e2b0-4041-a069-c2932ab42fd9/resourceGroups/rg-yashna-linux4-test-wus2/providers/Microsoft.Compute/virtualMachines/vm-yashna-linux4
LogFolder : /tmp/linux-patch/linux4_2/log
Linux 3 ARM ID : /subscriptions/6acc8a91-e2b0-4041-a069-c2932ab42fd9/resourceGroups/rg-linux3-tdnf/providers/Microsoft.Compute/virtualMachines/vm-linux3-tdnf-yashna
LogFolder: /tmp/linux-patch/linux4_2/log
Red Hat Arm ID : /subscriptions/6acc8a91-e2b0-4041-a069-c2932ab42fd9/resourceGroups/rg-rhel_10_yashna/providers/Microsoft.Compute/virtualMachines/vm-rhel-10-yashna
LogFolder : /tmp/linux-patch/linux4_1/log
