|
| 1 | +Quarterly Baseline Update Instructions |
| 2 | + |
| 3 | +Purpose |
| 4 | + |
| 5 | +A concise guide to add a new quarterly baseline (e.g. `Azure.GA_2026_03`, `Azure.Preview_2026_03`, `Azure.CAF_2026_03`) and mark the previous quarter's baselines as obsolete. |
| 6 | + |
| 7 | +Quarterly baselines are released every three months (March, June, September, December) for each year. |
| 8 | +Baseline names follow the pattern `Azure.GA_yyyy_mm` and `Azure.Preview_yyyy_mm`. |
| 9 | + |
| 10 | +Steps |
| 11 | + |
| 12 | +1. Branch |
| 13 | +- Create a feature branch: `git checkout -b <your-user>/quarterly-baseline-yyyy-mm` |
| 14 | + |
| 15 | +2. Determine the new baseline period |
| 16 | +- The new period follows the pattern `yyyy_mm` (e.g. `2026_03` for March 2026). |
| 17 | +- The previous baseline (to mark obsolete) is the one that was previously `Latest` (no `obsolete` annotation). |
| 18 | + |
| 19 | +3. Determine the current module version |
| 20 | +- Look at recent changelog entries in `docs/changelog.md` for the current `v1.x.x` release version. |
| 21 | +- The new baselines use `moduleVersion: v1.x.x` set to the upcoming release version. |
| 22 | +- To find the next version: check the current version in the most recently released baseline and increment appropriately. |
| 23 | + |
| 24 | +4. Check for the current AKS minimum version |
| 25 | +- Look at `src/PSRule.Rules.Azure/rules/Config.Rule.yaml` for `AZURE_AKS_CLUSTER_MINIMUM_VERSION`. |
| 26 | +- Use this value in the new baselines. |
| 27 | + |
| 28 | +5. Update `src/PSRule.Rules.Azure/rules/Baseline.Rule.yaml` |
| 29 | +- Mark the previous latest GA and Preview baselines as obsolete by adding `obsolete: true` to their `annotations` block. |
| 30 | + Example — change: |
| 31 | + ```yaml |
| 32 | + annotations: |
| 33 | + export: true |
| 34 | + moduleVersion: v1.47.0 |
| 35 | + ``` |
| 36 | + to: |
| 37 | + ```yaml |
| 38 | + annotations: |
| 39 | + export: true |
| 40 | + moduleVersion: v1.47.0 |
| 41 | + obsolete: true |
| 42 | + ``` |
| 43 | +- Append two new baseline entries at the end of the file (GA and Preview) following the existing pattern. |
| 44 | + Each new baseline includes all prior ruleSets plus the new `yyyy_mm` entry. |
| 45 | + |
| 46 | + Example for `Azure.GA_2026_03`: |
| 47 | + ```yaml |
| 48 | + --- |
| 49 | + # Synopsis: Include rules released March 2026 or prior for Azure GA features. |
| 50 | + apiVersion: github.com/microsoft/PSRule/v1 |
| 51 | + kind: Baseline |
| 52 | + metadata: |
| 53 | + name: Azure.GA_2026_03 |
| 54 | + annotations: |
| 55 | + export: true |
| 56 | + moduleVersion: v1.48.0 |
| 57 | + spec: |
| 58 | + configuration: |
| 59 | + # Configure minimum AKS cluster version |
| 60 | + AZURE_AKS_CLUSTER_MINIMUM_VERSION: '1.33.7' |
| 61 | + rule: |
| 62 | + tag: |
| 63 | + release: GA |
| 64 | + ruleSet: |
| 65 | + - '2020_06' |
| 66 | + # ... all prior ruleSets ... |
| 67 | + - '2025_12' |
| 68 | + - '2026_03' |
| 69 | + ``` |
| 70 | + |
| 71 | + Example for `Azure.Preview_2026_03` (same but `release: preview`): |
| 72 | + ```yaml |
| 73 | + --- |
| 74 | + # Synopsis: Include rules released March 2026 or prior for Azure preview only features. |
| 75 | + apiVersion: github.com/microsoft/PSRule/v1 |
| 76 | + kind: Baseline |
| 77 | + metadata: |
| 78 | + name: Azure.Preview_2026_03 |
| 79 | + annotations: |
| 80 | + export: true |
| 81 | + moduleVersion: v1.48.0 |
| 82 | + spec: |
| 83 | + configuration: |
| 84 | + # Configure minimum AKS cluster version |
| 85 | + AZURE_AKS_CLUSTER_MINIMUM_VERSION: '1.33.7' |
| 86 | + rule: |
| 87 | + tag: |
| 88 | + release: preview |
| 89 | + ruleSet: |
| 90 | + - '2020_06' |
| 91 | + # ... all prior ruleSets ... |
| 92 | + - '2025_12' |
| 93 | + - '2026_03' |
| 94 | + ``` |
| 95 | + |
| 96 | +6. Update `src/PSRule.Rules.Azure/rules/CAF.Rule.yaml` |
| 97 | +- Append a new `Azure.CAF_yyyy_mm` baseline at the end of the file. |
| 98 | +- Copy the configuration from the most recent `Azure.CAF_*` baseline and add the new `yyyy_mm` ruleSet. |
| 99 | +- Update `moduleVersion` to the new version. |
| 100 | + |
| 101 | + Example for `Azure.CAF_2026_03`: |
| 102 | + ```yaml |
| 103 | + --- |
| 104 | + # Synopsis: Includes rules related to Azure CAF based on a March 2026 snapshot. |
| 105 | + apiVersion: github.com/microsoft/PSRule/v1 |
| 106 | + kind: Baseline |
| 107 | + metadata: |
| 108 | + name: Azure.CAF_2026_03 |
| 109 | + annotations: |
| 110 | + taxonomy: Azure.CAF |
| 111 | + export: true |
| 112 | + moduleVersion: v1.48.0 |
| 113 | + experimental: true |
| 114 | + spec: |
| 115 | + rule: |
| 116 | + tag: |
| 117 | + release: GA |
| 118 | + ruleSet: |
| 119 | + - '2020_06' |
| 120 | + # ... all prior ruleSets ... |
| 121 | + - '2025_12' |
| 122 | + - '2026_03' |
| 123 | + labels: |
| 124 | + Azure.CAF: '*' |
| 125 | + configuration: |
| 126 | + # Same configuration as the previous CAF baseline |
| 127 | + AZURE_VNET_NAME_FORMAT: '^vnet-' |
| 128 | + # etc. |
| 129 | + ``` |
| 130 | + |
| 131 | +7. Update unit tests |
| 132 | +- Edit `tests/PSRule.Rules.Azure.Tests/Azure.Baseline.Tests.ps1`. |
| 133 | +- Add two new `It` blocks at the end of the `Context 'Rule'` section for `Azure.GA_yyyy_mm` and `Azure.Preview_yyyy_mm`. |
| 134 | +- To determine the correct rule count, build the module and run: |
| 135 | + ```powershell |
| 136 | + Import-Module ./out/modules/PSRule.Rules.Azure -Force |
| 137 | + $ga = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.GA_2026_03' -WarningAction Ignore) |
| 138 | + ($ga | Where-Object { $_.Tag.release -in 'GA' }).Length |
| 139 | + $preview = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2026_03' -WarningAction Ignore) |
| 140 | + ($preview | Where-Object { $_.Tag.release -in 'preview' }).Length |
| 141 | + ``` |
| 142 | +- Use the output counts in the test assertions. |
| 143 | + |
| 144 | + Example: |
| 145 | + ```powershell |
| 146 | + It 'With Azure.GA_2026_03' { |
| 147 | + $result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.GA_2026_03' -WarningAction Ignore); |
| 148 | + $filteredResult = @($result | Where-Object { $_.Tag.release -in 'GA'}); |
| 149 | + $filteredResult | Should -Not -BeNullOrEmpty; |
| 150 | + $filteredResult.Length | Should -Be 517; |
| 151 | + } |
| 152 | +
|
| 153 | + It 'With Azure.Preview_2026_03' { |
| 154 | + $result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2026_03' -WarningAction Ignore); |
| 155 | + $filteredResult = @($result | Where-Object { $_.Tag.release -in 'preview'}); |
| 156 | + $filteredResult | Should -Not -BeNullOrEmpty; |
| 157 | + $filteredResult.Length | Should -Be 8; |
| 158 | + } |
| 159 | + ``` |
| 160 | + |
| 161 | +8. Build and verify |
| 162 | +- Build the module: |
| 163 | + ```powershell |
| 164 | + Invoke-Build BuildModule -File pipeline.build.ps1 -Configuration Debug -Build '0.0.1' |
| 165 | + ``` |
| 166 | +- Run the baseline tests: |
| 167 | + ```powershell |
| 168 | + Import-Module ./out/modules/PSRule.Rules.Azure -Force |
| 169 | + Invoke-Pester tests/PSRule.Rules.Azure.Tests/Azure.Baseline.Tests.ps1 -Tag Baseline |
| 170 | + ``` |
| 171 | +- All tests should pass. |
| 172 | + |
| 173 | +9. Changelog & PR |
| 174 | +- Add a changelog entry in `docs/changelog.md` under the `## Unreleased` section. |
| 175 | + |
| 176 | + Example: |
| 177 | + ``` |
| 178 | + - New features: |
| 179 | + - Added March 2026 baselines `Azure.GA_2026_03`, `Azure.Preview_2026_03`, and `Azure.CAF_2026_03` by @BernieWhite. |
| 180 | + [#nnnn](https://github.com/Azure/PSRule.Rules.Azure/issues/nnnn) |
| 181 | + - Includes rules released before or during March 2026. |
| 182 | + - Marked `Azure.GA_2025_12` and `Azure.Preview_2025_12` baselines as obsolete. |
| 183 | + ``` |
| 184 | +
|
| 185 | +Notes & Tips |
| 186 | +
|
| 187 | +- Do NOT update auto-generated baseline documentation files in `docs/en/baselines/` — these are regenerated automatically. |
| 188 | +- The `docs/en/baselines/index.md` and individual baseline `.md` files have `generated: true` in their front matter. |
| 189 | +- The rule count for a new quarterly baseline is the same as the previous one if no new rules with the new `ruleSet` tag have been added yet. |
| 190 | +- After adding new rules tagged with the new `ruleSet` (e.g. `2026_03`), the baseline test counts must be updated accordingly. |
0 commit comments