Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .expeditor/run_windows_tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env powershell
#
# This script runs a passed in command, but first sets up the bundler caching on the repo
# for Windows environments with network resilience

# Set error handling
$ErrorActionPreference = "Stop"

# Set UTF-8 encoding for consistency
$env:LANG = "en_US.UTF-8"
$env:LC_ALL = "en_US.UTF-8"

Write-Host "--- Setting up bundle configuration for Windows"

# Configure bundler for local caching and network resilience
bundle config --local path vendor/bundle
bundle config set --local without docs debug
bundle config set --local retry 5
bundle config set --local timeout 30
bundle config set --local jobs 3

Write-Host "--- bundle install with network resilience"

# Retry bundle install with exponential backoff for network issues
$maxAttempts = 3
$attempt = 1
$success = $false

while ($attempt -le $maxAttempts -and -not $success) {
try {
Write-Host "Bundle install attempt $attempt of $maxAttempts"
bundle install --retry=5
$success = $true
Write-Host "Bundle install successful on attempt $attempt"
}
catch {
Write-Host "Bundle install failed on attempt $attempt`: $($_.Exception.Message)"
if ($attempt -lt $maxAttempts) {
$waitTime = [math]::Pow(2, $attempt) * 5 # Exponential backoff: 10s, 20s
Write-Host "Waiting $waitTime seconds before retry..."
Start-Sleep -Seconds $waitTime
}
$attempt++
}
}

if (-not $success) {
Write-Host "Bundle install failed after $maxAttempts attempts"
exit 1
}

Write-Host "+++ bundle exec task"

# Execute the passed command
$command = $args -join " "
if ($command) {
Invoke-Expression "bundle exec $command"
} else {
Write-Host "No command specified"
exit 1
}
30 changes: 25 additions & 5 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,36 @@ steps:
expeditor:
executor:
docker:
image: ruby:3.1-buster
image: ruby:3.1

- label: run-specs-ruby-3.4
command:
- .expeditor/run_linux_tests.sh rake
expeditor:
executor:
docker:
image: ruby:3.4-bookworm

- label: run-specs-windows
command:
- bundle config --local path vendor/bundle
- bundle config set --local without docs debug
- bundle install --jobs=7 --retry=3
- bundle exec rake spec
- powershell -ExecutionPolicy Bypass -File .expeditor/run_windows_tests.ps1 rake spec
expeditor:
executor:
docker:
host_os: windows
image: rubydistros/windows-2019:3.1
retry:
automatic:
limit: 2

- label: run-specs-windows-ruby-3.4
command:
- powershell -ExecutionPolicy Bypass -File .expeditor/run_windows_tests.ps1 rake spec
expeditor:
executor:
docker:
host_os: windows
image: rubydistros/windows-2019:3.4
retry:
automatic:
limit: 2
89 changes: 89 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@ This document provides comprehensive guidance for GitHub Copilot when working wi

## ⚡ Quick Start for GitHub Copilot

### 🚨 CRITICAL MANDATORY REQUIREMENTS - NEVER SKIP THESE
**⚠️ FAILURE TO FOLLOW THESE WILL CAUSE BUILD FAILURES AND COMPLIANCE VIOLATIONS ⚠️**

#### 🔴 1. DCO SIGNOFF - EVERY SINGLE COMMIT
```bash
# MANDATORY: Use --signoff for EVERY commit
git commit --signoff -m "Your commit message"
# Builds WILL FAIL without DCO signoff
```

#### 🔴 2. AI COMPLIANCE - IMMEDIATE AFTER PR CREATION
```bash
# MANDATORY: Update Jira field IMMEDIATELY after PR creation
# Use atlassian-mcp tools to update customfield_11170 = "Yes"
# This is REQUIRED for Progress AI governance
```

#### 🔴 3. AI-ASSISTED LABEL - NON-NEGOTIABLE
```bash
# MANDATORY: All PRs MUST have ai-assisted label
gh pr create --label "ai-assisted"
# If label doesn't exist, create it first:
gh label create "ai-assisted" --description "Work completed with AI assistance following Progress AI policies" --color "9A4DFF"
```

#### 🔴 4. TEST COVERAGE >80% - BUILD REQUIREMENT
```bash
# MANDATORY: All code changes must achieve >80% test coverage
bundle exec rake spec # Must pass with >80% coverage
```

### 🎯 CRITICAL SUCCESS FACTORS
1. **>80% Test Coverage** - NON-NEGOTIABLE for all code changes
2. **AI Compliance** - ALL PRs MUST include `ai-assisted` label and Jira field updates
Expand Down Expand Up @@ -438,6 +469,42 @@ EOF
)" --label "Type: Enhancement" --label "Platform: Azure" --label "ai-assisted"
```

### 🚨 MANDATORY POST-PR CHECKLIST - DO NOT SKIP!
**⚠️ COMPLETE THESE STEPS IMMEDIATELY AFTER PR CREATION ⚠️**

#### ✅ **Step 1: Verify DCO Signoff**
```bash
# Check if commit has DCO signoff
git log --format=fuller -1
# Look for: "Signed-off-by: Your Name <your.email@example.com>"
# If missing, fix with: git commit --amend --signoff --no-edit
```

#### ✅ **Step 2: Verify ai-assisted Label**
```bash
# If label doesn't exist, create it:
gh label create "ai-assisted" --description "Work completed with AI assistance following Progress AI policies" --color "9A4DFF"
# Verify PR has the label applied
```

#### ✅ **Step 3: Update Jira Field (MANDATORY)**
```bash
# IMMEDIATELY update customfield_11170 to "Yes"
# Use atlassian-mcp tools with correct format:
# {"customfield_11170": {"value": "Yes"}}
```

#### ✅ **Step 4: Final Verification**
```bash
# Verify all compliance requirements met:
# - DCO signoff present ✅
# - ai-assisted label applied ✅
# - Jira field updated ✅
# - >80% test coverage ✅
```

**🚫 DO NOT PROCEED WITHOUT COMPLETING ALL 4 STEPS ABOVE!**

### PR Description Template
Use this HTML-formatted template for all PRs:

Expand Down Expand Up @@ -735,6 +802,15 @@ gh pr create --label "Type: Bug" --label "Aspect: Security" --label "Priority: C

## Prompt-Based Execution Protocol

### 🚨 MANDATORY COMPLIANCE REMINDERS FOR EVERY TASK

**Before starting ANY task, ALWAYS remind yourself of these NON-NEGOTIABLE requirements:**

1. **🔴 DCO Signoff**: EVERY commit needs `git commit --signoff`
2. **🔴 Test Coverage**: ALL code changes need >80% test coverage
3. **🔴 AI Labels**: ALL PRs need `ai-assisted` label
4. **🔴 Jira Field**: IMMEDIATELY update `customfield_11170` = "Yes" after PR creation

### Execution Flow

All tasks must follow this interactive pattern:
Expand Down Expand Up @@ -820,6 +896,19 @@ Currently working on: Repository structure analysis
❓ Do you want me to continue with the implementation planning?"
```

#### 6. Final Compliance Verification
At the end of ANY implementation, ALWAYS verify:
```
"🎯 FINAL COMPLIANCE CHECK:
✅ DCO Signoff: [Check if all commits are signed]
✅ Test Coverage: [Verify >80% coverage achieved]
✅ AI Labels: [Confirm ai-assisted label applied]
✅ Jira Field: [Verify customfield_11170 = 'Yes']

📋 All compliance requirements satisfied? [Yes/No]
If No, identify and fix missing items before completing."
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Corrected capitalization: 'If No' should be 'If no' for consistency with standard sentence formatting.

Suggested change
If No, identify and fix missing items before completing."
If no, identify and fix missing items before completing."

Copilot uses AI. Check for mistakes.
```

---

## Repository-Specific Guidelines
Expand Down
9 changes: 5 additions & 4 deletions knife-azure.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Gem::Specification.new do |s|

s.add_dependency "knife", ">= 18.0"
s.add_dependency "nokogiri", ">= 1.5.5"
s.add_dependency "azure_mgmt_resources", "~> 0.17", ">= 0.17.2"
s.add_dependency "azure_mgmt_compute", "~> 0.18", ">= 0.18.3"
s.add_dependency "azure_mgmt_storage", "~> 0.20", ">= 0.20.0"
s.add_dependency "azure_mgmt_network", "~> 0.18", ">= 0.18.2"
s.add_dependency "azure_mgmt_compute2", "~> 1.0"
s.add_dependency "azure_mgmt_storage2", "~> 1.0"
s.add_dependency "azure_mgmt_network2", "~> 1.1"
s.add_dependency "azure_mgmt_resources2", "~> 1.1"
s.add_dependency "listen", "~> 3.1"
s.add_dependency "ipaddress"
s.add_dependency "ffi"
s.add_dependency "rb-readline"
Comment thread
ashiqueps marked this conversation as resolved.
s.add_dependency "abbrev"
end
31 changes: 15 additions & 16 deletions lib/azure/resource_management/ARM_deployment_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,13 @@ def create_deployment_template(params)
"sshKeyPath" => "[concat('/home/',parameters('adminUserName'),'/.ssh/authorized_keys')]",
},
"resources" => [
{
"type" => "Microsoft.Storage/storageAccounts",
"name" => "[variables('storageAccountName')]",
"apiVersion" => "[variables('apiVersion')]",
"location" => "[resourceGroup().location]",
"properties" => {
"accountType" => "[variables('storageAccountType')]",
},
},

# Storage account not needed for managed disks.
# NOTE: Existing deployments that were created with a storage account will continue to function as before.
# This template now uses managed disks, so new VMs will not create a separate storage account.
# If you have existing VMs using storage accounts and wish to migrate to managed disks, refer to Azure's migration documentation:
# https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks
# No changes are made to existing resources; this only affects new deployments.
{
"apiVersion" => "[variables('apiVersion')]",
"type" => "Microsoft.Network/publicIPAddresses",
Expand Down Expand Up @@ -391,7 +389,9 @@ def create_deployment_template(params)
},
},
{
Comment thread
ashiqueps marked this conversation as resolved.
"apiVersion" => "[variables('apiVersion')]",
# NOTE: The API version '2017-03-30' is required for managed disk support in Microsoft.Compute/virtualMachines.
# Do not change to [variables('apiVersion')]; newer versions may not be compatible with this template.
"apiVersion" => "2017-03-30",
"type" => "Microsoft.Compute/virtualMachines",
"name" => vmName,
"location" => "[resourceGroup().location]",
Expand All @@ -400,7 +400,6 @@ def create_deployment_template(params)
"count" => "[parameters('numberOfInstances')]",
},
"dependsOn" => [
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
depVm2,
],
"properties" => {
Expand Down Expand Up @@ -431,11 +430,11 @@ def create_deployment_template(params)
},
"osDisk" => {
"name" => "[variables('OSDiskName')]",
"vhd" => {
"uri" => uri,
},
"caching" => "ReadWrite",
"createOption" => "FromImage",
"managedDisk" => {
"storageAccountType" => "Standard_LRS",
},
},
},
"networkProfile" => {
Expand All @@ -447,8 +446,8 @@ def create_deployment_template(params)
},
"diagnosticsProfile" => {
"bootDiagnostics" => {
Comment thread
ashiqueps marked this conversation as resolved.
"enabled" => "true",
"storageUri" => "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net')]",
# Boot diagnostics is disabled because it requires a storage account, which was removed.
"enabled" => "false",
Comment thread
ashiqueps marked this conversation as resolved.
},
},
},
Expand Down
Loading