Skip to content

Commit cd77db3

Browse files
authored
Merge pull request #72 from NeilBird/users/nebird/development
v0.8.3: Step.3 apply-updates schedule-coverage advisor accuracy fixes
2 parents 7882475 + adc4a20 commit cd77db3

28 files changed

Lines changed: 260 additions & 107 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Thumbs.db
2828
# Agent scratch files (never commit)
2929
_tmp_*
3030

31+
# Local-only test/utility scripts (never commit)
32+
AzLocal.UpdateManagement/Test-Pipelines.ps1
33+
3134
# Agent-generated planning / review docs (kept locally, never committed)
3235
# Per-module consolidation folder (preferred location for all review artefacts):
3336
AzLocal.UpdateManagement/Module-reviews/

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.0_authentication-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ variables:
5959
# log if the YAML appears stale - prompting you to refresh via
6060
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
6161
- name: GENERATED_AGAINST_MODULE_VERSION
62-
value: '0.8.2'
62+
value: '0.8.3'
6363
# Resolution order for the module version pin (leave all unset to install the latest,
6464
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
6565
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.1_inventory-clusters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ variables:
4242
# log if the YAML appears stale - prompting you to refresh via
4343
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
4444
- name: GENERATED_AGAINST_MODULE_VERSION
45-
value: '0.8.2'
45+
value: '0.8.3'
4646
# Resolution order for the module version pin (leave all unset to install the latest,
4747
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
4848
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.2_manage-updatering-tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ variables:
4545
# log if the YAML appears stale - prompting you to refresh via
4646
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
4747
- name: GENERATED_AGAINST_MODULE_VERSION
48-
value: '0.8.2'
48+
value: '0.8.3'
4949
# Resolution order for the module version pin (leave all unset to install the latest,
5050
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
5151
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.3_apply-updates-schedule-audit.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ schedules:
4343

4444
parameters:
4545
- name: pipelinePath
46-
displayName: 'Path (file or folder) to Step.6_apply-updates.yml to audit, repo-relative. Leave empty to audit ONLY the schedulePath (schedule file). Default `.azure-pipelines` matches the standard Azure DevOps consumer layout; for repos that keep Step.6_apply-updates.yml at the repo root pass `.`'
46+
displayName: 'Path (file or folder) to Step.6_apply-updates.yml to audit, repo-relative. REQUIRED so the Recommend view can diff its proposed crons against what is already present in Step.6 and only emit a snippet for the truly missing entries. Default `.azure-pipelines` matches the standard Azure DevOps consumer layout; for repos that keep Step.6_apply-updates.yml at the repo root pass `.`'
4747
type: string
4848
default: '.azure-pipelines'
4949

@@ -81,7 +81,7 @@ parameters:
8181
default: false
8282

8383
variables:
84-
GENERATED_AGAINST_MODULE_VERSION: '0.8.2'
84+
GENERATED_AGAINST_MODULE_VERSION: '0.8.3'
8585
REQUIRED_MODULE_VERSION: '${{ parameters.moduleVersion }}'
8686
reportsPath: '$(Build.ArtifactStagingDirectory)/reports'
8787

@@ -178,18 +178,17 @@ stages:
178178
Write-Host "##[endgroup]"
179179
}
180180
181-
# pipelinePath is OPTIONAL when schedulePath is set. The audit
182-
# cmdlet requires at least one of -PipelineYamlPath / -SchedulePath; if
183-
# both are blank, fall through to the original pipeline-yaml-only check
184-
# to keep the original error message.
181+
# v0.8.3: pipelinePath is REQUIRED so Recommend can diff its
182+
# proposed crons against what's already in Step.6 and only emit a
183+
# snippet for the truly missing entries. schedulePath stays optional
184+
# (it drives the ring-file two-way diff). ADO parameters: blocks have
185+
# no 'required:' keyword, so validate at runtime instead.
185186
$havePipeline = -not [string]::IsNullOrWhiteSpace($pipelinePath)
186187
$haveSchedule = -not [string]::IsNullOrWhiteSpace($schedulePath) -and (Test-Path -LiteralPath $schedulePath)
187-
if ($haveSchedule -and -not $havePipeline) {
188-
Write-Host "PipelineYamlPath is empty - auditing schedule file only ('$schedulePath')"
189-
$pipelinePath = $null
190-
$havePipeline = $false
188+
if (-not $havePipeline) {
189+
throw "pipelinePath parameter is required. Set it to the folder containing Step.6_apply-updates.yml (default '.azure-pipelines' matches the standard consumer layout). The Recommend view diffs its proposed crons against this file - leaving it empty would make every recommendation a false positive."
191190
}
192-
elseif ($havePipeline -and -not (Test-Path -LiteralPath $pipelinePath)) {
191+
if (-not (Test-Path -LiteralPath $pipelinePath)) {
193192
$candidates = @('.azure-pipelines', 'pipelines', '.github/workflows', '.') | Where-Object { Test-Path -LiteralPath $_ }
194193
$hint = if ($candidates) { "Common locations that DO exist in this repo: $($candidates -join ', '). Re-queue the pipeline and override the 'pipelinePath' parameter." } else { "No common pipeline folders (.azure-pipelines, pipelines, .github/workflows, repo root) were found - commit your Step.6_apply-updates.yml first, or set 'pipelinePath' to wherever you keep it." }
195194
throw "PipelineYamlPath '$pipelinePath' does not exist on the agent. $hint"
@@ -229,7 +228,17 @@ stages:
229228
if (-not $auditResult) { $auditResult = @() }
230229
231230
Test-AzLocalApplyUpdatesScheduleCoverage -View Matrix -LeadTimeMinutes $leadTime -ExportPath $matrixCsv | Out-Null
232-
Test-AzLocalApplyUpdatesScheduleCoverage -View Recommend -LeadTimeMinutes $leadTime -RecommendFiresPerWindow $firesPerWin -Platform AzureDevOps -ExportPath $recoMd | Out-Null
231+
# v0.8.3: pass -PipelineYamlPath so Recommend diff-prunes crons
232+
# already present in Step.6 and only emits the truly missing ones.
233+
$recoArgs = @{
234+
View = 'Recommend'
235+
LeadTimeMinutes = $leadTime
236+
RecommendFiresPerWindow = $firesPerWin
237+
Platform = 'AzureDevOps'
238+
ExportPath = $recoMd
239+
}
240+
if ($havePipeline) { $recoArgs.PipelineYamlPath = $pipelinePath }
241+
Test-AzLocalApplyUpdatesScheduleCoverage @recoArgs | Out-Null
233242
234243
$covered = @($auditResult | Where-Object Status -eq 'Covered')
235244
$uncovered = @($auditResult | Where-Object Status -eq 'Uncovered')
@@ -456,7 +465,7 @@ stages:
456465
$md += "`n*This schedule is on schema v1. Schema v2 adds ``allowedUpdateVersions`` for fleet-wide + per-ring update allow-lists (e.g. enforce a 'minimum updates' policy on Prod). Migrate the file with:*`n"
457466
$md += "`n``````powershell`n"
458467
$md += "Update-AzLocalApplyUpdatesScheduleConfig -Path '$schedulePath' -SchemaMigrate`n"
459-
$md += "``````n"
468+
$md += "```````n"
460469
} else {
461470
$topAllow = @($sched.AllowedUpdateVersions)
462471
$topIsLatest = ($topAllow.Count -eq 1 -and $topAllow[0] -eq 'Latest')
@@ -501,14 +510,14 @@ stages:
501510
502511
if ($rowsMissingOverride.Count -gt 0) {
503512
$md += "`n*$($rowsMissingOverride.Count) row(s) inherit the top-level allow-list. This is fine when you want each ring to install the latest Ready update as soon as it is available.*`n"
504-
$md += "`n### How to fix - edit ``$schedulePath```n"
505-
$md += "`n*Only needed if you want to PIN a ring to a specific update (e.g. keep Prod on the latest feature drop only - YY04 / YY10 - and skip cumulative updates between feature drops).* Add ``allowedUpdateVersions:`` to the row that covers the ring you want to pin. Use ``Get-AzLocalAvailableUpdates`` (or the Azure portal -> Azure Local -> Updates) to find valid update names / version strings.`n"
513+
$md += "`n### Optional - pin a ring to a specific update in ``$schedulePath```n"
514+
$md += "`n*Only needed if you want to PIN a ring to a specific update (e.g. keep Prod on the latest feature drop only - YY04 / YY10 - and skip cumulative updates between feature drops). This is NOT a fix for the cron-coverage or ring-diff sections above - those have their own 'Action required' blocks.* Add ``allowedUpdateVersions:`` to the row that covers the ring you want to pin. Use ``Get-AzLocalAvailableUpdates`` (or the Azure portal -> Azure Local -> Updates) to find valid update names / version strings.`n"
506515
$md += "`n``````yaml`n"
507516
$md += "- weeksInCycle: '*'`n"
508517
$md += " daysOfWeek: 'Tue,Wed,Thu'`n"
509518
$md += " rings: 'Prod'`n"
510519
$md += " allowedUpdateVersions: 'Solution12.2604.1003.1005;Solution12.2610.1003.XX'`n"
511-
$md += "``````n"
520+
$md += "```````n"
512521
} else {
513522
$md += "`n*Every schedule row has an explicit ``allowedUpdateVersions:`` override - no inheritance from the top-level default.*`n"
514523
}

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.4_fleet-connectivity-status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ variables:
102102
# the version actually installed and to the latest on PSGallery, and emits a warning
103103
# log if the YAML appears stale - prompting you to refresh via
104104
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
105-
GENERATED_AGAINST_MODULE_VERSION: '0.8.2'
105+
GENERATED_AGAINST_MODULE_VERSION: '0.8.3'
106106
# Resolution order for the module version pin (leave all unset to install the latest,
107107
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
108108
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.5_assess-update-readiness.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ variables:
6363
# the version actually installed and to the latest on PSGallery, and emits a warning
6464
# log if the YAML appears stale - prompting you to refresh via
6565
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
66-
GENERATED_AGAINST_MODULE_VERSION: '0.8.2'
66+
GENERATED_AGAINST_MODULE_VERSION: '0.8.3'
6767
# Resolution order for the module version pin (leave all unset to install the latest,
6868
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
6969
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.6_apply-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ variables:
9898
# log if the YAML appears stale - prompting you to refresh via
9999
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
100100
- name: GENERATED_AGAINST_MODULE_VERSION
101-
value: '0.8.2'
101+
value: '0.8.3'
102102
# Resolution order for the module version pin (leave all unset to install the latest,
103103
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
104104
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.7_monitor-updates.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ parameters:
8383
default: ''
8484

8585
variables:
86-
GENERATED_AGAINST_MODULE_VERSION: '0.8.2'
86+
GENERATED_AGAINST_MODULE_VERSION: '0.8.3'
8787
REQUIRED_MODULE_VERSION: '${{ parameters.moduleVersion }}'
8888
reportsPath: '$(Build.ArtifactStagingDirectory)/reports'
8989

AzLocal.UpdateManagement/Automation-Pipeline-Examples/azure-devops/Step.8_fleet-update-status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ variables:
9292
# the version actually installed and to the latest on PSGallery, and emits a warning
9393
# log if the YAML appears stale - prompting you to refresh via
9494
# Copy-AzLocalPipelineExample -Update. See Automation-Pipeline-Examples/README.md section 5.
95-
GENERATED_AGAINST_MODULE_VERSION: '0.8.2'
95+
GENERATED_AGAINST_MODULE_VERSION: '0.8.3'
9696
# Resolution order for the module version pin (leave all unset to install the latest,
9797
# which is the default "fix-forward" behaviour): queue-time parameter > pipeline variable
9898
# 'REQUIRED_MODULE_VERSION' overridden at queue time > empty (latest).

0 commit comments

Comments
 (0)