Skip to content

feat(azure): summary counts for database encryption, AKS autoscaling and node OS patching - #380

Open
bruceweygandt wants to merge 4 commits into
mainfrom
feat/azure-config-summary-counts
Open

bruceweygandt wants to merge 4 commits into
mainfrom
feat/azure-config-summary-counts

Conversation

@bruceweygandt

@bruceweygandt bruceweygandt commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds summary counts to three existing Azure fetchers so Validators can judge three Solution Capabilities that had no count to read. Every addition is additive; existing fields keep their meanings.

Fetcher Version New summary fields Supports
azure_postgresql_configuration 0.2.1 → 0.3.0 customer_managed_key_servers, data_encryption_unknown_servers Database Encryption
azure_mysql_configuration 0.2.1 → 0.3.0 customer_managed_key_servers, data_encryption_unknown_servers Database Encryption
azure_aks_cluster_configuration 0.5.0 → 0.6.0 autoscaling_agent_pools, node_os_auto_upgrade_clusters, node_os_upgrade_channel_unknown_clusters Automatic Capacity Scaling, Automated Patch Deployment

Minor version bumps, following the 0.4.0 → 0.5.0 precedent for additive AKS output.

How each is read

  • Database: each flexible server's data_encryption.type (AzureKeyVault or SystemManaged). A server for which Azure returns no type counts in data_encryption_unknown_servers, never as platform-managed.
  • AKS autoscaling: node pools with enable_auto_scaling true.
  • AKS patching: clusters whose node_os_upgrade_channel is SecurityPatch or NodeImage, which patch node images on their own. This is separate from the existing auto_upgrade_clusters, which is about Kubernetes version upgrades. A missing channel is counted apart, never as automatic.
  • The AKS counts are null with the others when the cluster list can't be read, since summarize(None) derives its keys from summarize([]).

Testing

  • tests/test_azure_config_summary_counts.py (5 tests) runs in the core test job without the Azure SDKs: the fetchers read models through model_attr, so plain attribute objects stand in for SDK models and the projection code still runs. It covers the key source, the unknown counts, the AKS counts and the null-when-unread rule.
  • tests/test_azure_sdk_surface.py gains six REQUIRED_MODEL_FIELDS rows, run by the azure-sdk job, so an SDK that renamed one of these fields fails CI instead of reading every server as unknown. PostgreSQL's data_encryption is pinned on ServerProperties, where the TypeSpec SDK declares it before flattening it onto Server.
  • Every new field is documented; the existing summary-documentation tests for these fetchers pass.
  • test_contracts.py, test_category_requires.py and all Azure and Entra tests pass (6,357). No new dependencies.
  • The AKS counts were recomputed from a real staging artifact's results with the new summarize: 1 cluster with node OS channel NodeImage and 3 of 4 node pools autoscaling.

@Controgon Controgon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change is small and additive. The azurekeyvault comparison is safe because model_attr unwraps the SDK enums, and unknown values are counted separately. CI is green. I have a few comments. None of them blocks the merge.

1. One SDK surface row fails on the oldest SDK version that the pin allows

tests/test_azure_sdk_surface.py (the ServerProperties row), requirements.txt:82

Problem. The new row checks azure.mgmt.postgresqlflexibleservers.models.ServerProperties. That class exists in version 3.0.0, which CI installs. It does not exist in 2.0.0, which >=2.0.0,<4 also allows.

Why this is a problem. On a 2.0.0 environment, the test fails with AttributeError, but the fetcher works: in 2.0.0, Server maps data_encryption to properties.dataEncryption. The failure is not real.

Fix. Raise the floor to >=3.0.0, or let the row accept Server.data_encryption when ServerProperties is not present.

2. Wording for the Unmanaged node OS channel

fetchers/azure/aks_cluster_configuration/fetcher.yaml (node_os_auto_upgrade_clusters)

The count is correct for node images. But on Ubuntu nodes, Unmanaged still installs OS security updates every night, without an automatic reboot. A reader may think that Unmanaged clusters get no patches. Please consider a count for each channel, or change the text to "replace node images automatically".

3. Smaller items

  • autoscaling_agent_pools. A cluster that uses node auto-provisioning scales without the cluster autoscaler on its pools, so it counts as 0. Please mention this in the field description.
  • KSIs. The KSI-SVC-SIN comments on the PostgreSQL and MySQL fetchers still mention transport only. Other Azure fetchers use KSI-SVC-SIN for customer-managed key encryption. The autoscaling count has no KSI. Please update the comments or the list.
  • Follow-up, not for this PR. When the server list cannot be read, the PostgreSQL and MySQL summaries show 0 instead of null. This was already the case on main. Now data_encryption_unknown_servers: 0 can look like "no unknown servers". A follow-up could make these summaries null, as the AKS summary already is.

…unt Unmanaged node OS apart, clarify autoscaling and KSIs
@bruceweygandt

Copy link
Copy Markdown
Contributor Author

Thanks. All items are addressed in the latest commit.

1. SDK surface row on postgresqlflexibleservers 2.0.0. Confirmed: 2.0.0 has no ServerProperties and declares data_encryption on Server. Rather than raise the floor, the row now names ServerProperties|Server: a small _import_first helper checks the first model the installed SDK declares. Checked against both 2.0.0 (Server) and 3.0.0 (ServerProperties); data_encryption is found in each.

2. Unmanaged wording. Good catch. node_os_auto_upgrade_clusters now says SecurityPatch or NodeImage "replace or patch node images automatically" and that an enabled channel does not show updates were applied. A new node_os_unmanaged_clusters counts Unmanaged clusters apart, with a description saying the node OS may still install its own updates (nightly security updates on Ubuntu, no automatic reboot), so they read neither as automatic nor as unpatched. Tested.

3. Smaller items

  • Node auto-provisioning: the autoscaling_agent_pools description now says a cluster that scales with node auto-provisioning does not count.
  • KSIs: the KSI-SVC-SIN comments on the PostgreSQL and MySQL fetchers now include customer-managed key encryption at rest, and the AKS list adds KSI-CNA-OFA for the autoscaler count.
  • Null summaries for unread server lists: agreed it should be a follow-up, since it predates this PR. I'll open it separately.

Tests: the affected suites pass (965 passed, including the contract tests). Ruff is clean on the changed files.

@Controgon Controgon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve. Everything from the first review is handled.

Fixed

    1. SDK surface row: fixed. ServerProperties|Server passes on 2.0.0 as well as 3.0.0. I ran it on a 2.0.0 environment, where it failed before.
    1. Unmanaged wording: fixed. The node_os_auto_upgrade_clusters line now says what it counts. The new node_os_unmanaged_clusters keeps Unmanaged out of both "automatic" and "unpatched", and it is tested, including null when the cluster list can't be read.
  • Node auto-provisioning in the autoscaling_agent_pools line, the KSI-SVC-SIN comments, and KSI-CNA-OFA for the autoscaler count: fixed.
  • Null summaries when the server list can't be read: these were already on main before this PR, and a separate follow-up is the right place for them.

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.

2 participants