Skip to content

Safety net: Explicitly block Azure Linux 4 and RHEL 10 until LPE support is available#344

Merged
kjohn-msft merged 6 commits into
masterfrom
linux4_not_supported_in_region
May 19, 2026
Merged

Safety net: Explicitly block Azure Linux 4 and RHEL 10 until LPE support is available#344
kjohn-msft merged 6 commits into
masterfrom
linux4_not_supported_in_region

Conversation

@yashnap
Copy link
Copy Markdown
Contributor

@yashnap yashnap commented May 12, 2026

  • Detect Azure Linux 4.x and RHEL 10.x distributions and enforce a safety‑net exception until LPE dnf5 support is fully implemented and validated.

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

linux4_error

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

workinglinux3

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
rhel_10_error_logs

Copilot AI review requested due to automatic review settings May 12, 2026 20:13
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.84%. Comparing base (525a32f) to head (f8871ea).

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     
Flag Coverage Δ
python27 93.84% <100.00%> (+0.02%) ⬆️
python312 93.84% <100.00%> (+0.02%) ⬆️

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.

Copy link
Copy Markdown
Contributor

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 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.system but does not restore it afterward, which can affect subsequent tests in the same run. Please back up and restore platform.system (preferably using try/finally alongside 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.

Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py
Comment thread src/core/tests/Test_EnvLayer.py Fixed
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Copy link
Copy Markdown
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.

@rane-rajasi to review deeper with context of comments left.

Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Fixed
Comment thread src/core/src/bootstrap/Constants.py
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py
Copy link
Copy Markdown
Contributor

@rane-rajasi rane-rajasi left a comment

Choose a reason for hiding this comment

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

Make sure to upload latest inVM testing logs since the code has changed from its previous implementation

Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
Comment thread src/core/tests/Test_EnvLayer.py Outdated
@yashnap yashnap force-pushed the linux4_not_supported_in_region branch from ef41e31 to 6e07a3c Compare May 19, 2026 14:02
@yashnap
Copy link
Copy Markdown
Contributor Author

yashnap commented May 19, 2026

Make sure to upload latest inVM testing logs since the code has changed from its previous implementation

@rane-rajasi The outputs attached in description is latest from yesterday after the change.

kjohn-msft
kjohn-msft previously approved these changes May 19, 2026
Copy link
Copy Markdown
Contributor

@rane-rajasi rane-rajasi left a comment

Choose a reason for hiding this comment

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

Only one minor comment

Comment thread src/core/src/bootstrap/EnvLayer.py Outdated
@yashnap yashnap requested a review from kjohn-msft May 19, 2026 21:28
Comment thread src/core/src/bootstrap/EnvLayer.py
@kjohn-msft kjohn-msft merged commit 3e2589b into master May 19, 2026
9 checks passed
@kjohn-msft kjohn-msft deleted the linux4_not_supported_in_region branch May 19, 2026 21:40
yashnap added a commit that referenced this pull request May 20, 2026
Release contains
- Explicitly blocking AzLinux 4 and RHEL10 support until code is fully
ready : [#344]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants