CHEF-15721: Add Ruby 3.4 support and prepare for habitat bundling#560
CHEF-15721: Add Ruby 3.4 support and prepare for habitat bundling#560
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds Ruby 3.4 support to knife-azure and addresses test failures related to license checking functionality. The changes prepare the plugin for bundling with the knife habitat package.
Key Changes
- Added Ruby 3.4 CI/CD pipeline steps for both Linux and Windows platforms
- Enhanced test mocking to handle license validation and file operations more robustly
- Relaxed test expectations from exact counts to minimum thresholds to accommodate Ruby 3.4 behavior
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.expeditor/verify.pipeline.yml |
Added Ruby 3.4 build configurations for Linux (Debian Bookworm) and Windows Server 2022 |
spec/spec_helper.rb |
Implemented comprehensive mocking for license checking and file operations to prevent test failures |
spec/unit/bootstrap_azurerm_spec.rb |
Updated test expectations to use at_least matchers and added check_eula_license mocking |
spec/unit/azurerm_server_create_spec.rb |
Enhanced file mocking with regex patterns and Chef extension method stubbing |
- Add Ruby 3.4 testing to CI pipeline (.expeditor/verify.pipeline.yml) - Update spec helper to handle licensing compatibility - Verify all 222 tests pass on Ruby 3.4.2 - Fix minor test compatibility issues for Ruby 3.4 - Prepare knife-azure for integration with knife habitat package Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
- Add mandatory compliance reminders at the top with 🚨 warnings - Include step-by-step post-PR checklist to prevent missed requirements - Add DCO signoff verification steps - Emphasize immediate Jira field updates for AI governance - Add final compliance verification to execution protocol - Make ai-assisted label requirement more prominent - Add quick reference checklist for all critical requirements This addresses issues identified during CHEF-15721 implementation where critical compliance steps were initially missed. Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
- Remove accidental pp statements from azurerm_server_create_spec.rb - Addresses Copilot review feedback about debug code in tests - All 147 tests continue to pass successfully Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
- Convert single quotes to double quotes in ENV assignments - Addresses remaining Copilot style review feedback - All 36 files now pass Chefstyle inspection with no offenses Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
spec/spec_helper.rb:1
- This mock in spec_helper.rb is overridden by the more specific mocks in azurerm_server_create_spec.rb lines 72-75. The global mock on line 72 of spec_helper will never be reached because line 71 calls
and_call_original, then line 72 immediately overwrites it. Consider removing this redundant mock or clarifying the intended precedence.
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
Signed-off-by: Ashique Saidalavi <Ashique.saidalavi@progress.com>
|
|
|
||
| def common_arm_rescue_block(error) | ||
| if error.class == MsRestAzure::AzureOperationError && error.body | ||
| if (error.is_a?(MsRestAzure2::AzureOperationError) || error.is_a?(MsRestAzure2::AzureOperationError)) && error.body |
There was a problem hiding this comment.
The conditional check is redundant - both sides of the OR operator check for the same class MsRestAzure2::AzureOperationError. The second check should likely verify a different exception type (possibly the original MsRestAzure::AzureOperationError for backward compatibility) or this should be simplified to a single check.
| if (error.is_a?(MsRestAzure2::AzureOperationError) || error.is_a?(MsRestAzure2::AzureOperationError)) && error.body | |
| if (error.is_a?(MsRestAzure2::AzureOperationError) || error.is_a?(MsRestAzure::AzureOperationError)) && error.body |
| ✅ Jira Field: [Verify customfield_11170 = 'Yes'] | ||
|
|
||
| 📋 All compliance requirements satisfied? [Yes/No] | ||
| If No, identify and fix missing items before completing." |
There was a problem hiding this comment.
[nitpick] Corrected capitalization: 'If No' should be 'If no' for consistency with standard sentence formatting.
| If No, identify and fix missing items before completing." | |
| If no, identify and fix missing items before completing." |




This PR implements Ruby 3.4 support for knife-azure and prepares it for integration with the knife habitat package, completing the first part of CHEF-15721 requirements.