Skip to content

Fix latent provider bugs surfaced during the typing work#337

Merged
nuwang merged 2 commits into
mainfrom
fix-provider-typing-followups
Jul 9, 2026
Merged

Fix latent provider bugs surfaced during the typing work#337
nuwang merged 2 commits into
mainfrom
fix-provider-typing-followups

Conversation

@nuwang

@nuwang nuwang commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes the latent provider bugs flagged (but deliberately deferred) during the
typing work in #335 — each was typed-to-conform or stopgapped rather than
truly fixed.

Fixes

AzureVolume.source returned a raw URI string despite being declared
Snapshot | MachineImage | None. It now resolves creation_data.source_uri
to the Snapshot object via snapshots.get() (returning None when there is
no source), matching the AWS/OpenStack implementations. Adds a cross-provider
regression test
: a volume created from a snapshot now asserts that snapshot
is its source (verified reachable on all four providers — AWS/OpenStack/GCP
resolve snapshot sources already, and Azure's source_uri is the snapshot's
resource id).

AzureInstanceService._resolve_launch_options omitted the required
network argument
when merging multiple firewalls for a launch — a
pre-existing bug that would raise TypeError if that path were hit. The merged
firewall is now created on the same network as the firewalls being combined.

parse_url (azure/helpers.py) misused InvalidValueException's param
slot
, passing the template-URL list (stopgapped with str(...)). Both raise
sites now name the offending parameter ('original_url').

GCPRouter.subnets is correct as-is — documented, not changed. A GCP Cloud
Router has no per-subnet attachment (see its attach_subnet/detach_subnet,
which no-op with a warning); it automatically serves every subnet in its VPC
network. So returning the network's subnets is the right mapping, unlike AWS
route tables / OpenStack routers which have explicit subnet associations. Added
a comment explaining this.

Verification

Follow-ups deferred from the add-typing PR (typed to conform / stopgapped,
not truly fixed):

- AzureVolume.source returned the raw source URI string but is declared
  Snapshot | MachineImage | None. Resolve the URI to the Snapshot object
  via snapshots.get(), mirroring the AWS/OpenStack implementations
  (returns None when there is no source). Adds a cross-provider regression
  test: a volume created from a snapshot now reports that snapshot as its
  source.

- AzureInstanceService._resolve_launch_options omitted the required
  `network` argument when merging multiple firewalls into a new one
  (pre-existing bug — the call would have raised TypeError). Create the
  merged firewall on the same network as the firewalls being combined.

- azure/helpers.py parse_url raised InvalidValueException with the template
  list in the `param` slot (misuse of `param: str`, stopgapped with str()).
  Name the offending parameter ('original_url') at both raise sites.

- Documented that GCPRouter.subnets returning the network's subnets is
  correct, not a bug: a GCP Cloud Router has no per-subnet attachment and
  automatically serves every subnet in its VPC network (unlike AWS route
  tables / OpenStack routers).

mypy 2.1 and flake8 clean. The Azure/GCP behaviour changes are validated by
the per-cloud integration suite in CI (not reproducible locally).
@nuwang nuwang had a problem deploying to cloud-integration July 9, 2026 08:04 — with GitHub Actions Failure
@nuwang nuwang had a problem deploying to cloud-integration July 9, 2026 08:04 — with GitHub Actions Failure
@nuwang nuwang temporarily deployed to cloud-integration July 9, 2026 08:04 — with GitHub Actions Inactive
@nuwang nuwang temporarily deployed to cloud-integration July 9, 2026 08:04 — with GitHub Actions Inactive
The integration suite showed AzureVolume.source returning None for a
volume created from a snapshot: an Azure disk copied from a snapshot
records the source in ``creation_data.source_resource_id``, not
``source_uri`` (which is only set for blob imports). Read source_resource_id
first (falling back to source_uri), so the snapshot source resolves.
@nuwang nuwang temporarily deployed to cloud-integration July 9, 2026 09:52 — with GitHub Actions Inactive
@nuwang nuwang temporarily deployed to cloud-integration July 9, 2026 09:52 — with GitHub Actions Inactive
@nuwang nuwang temporarily deployed to cloud-integration July 9, 2026 09:52 — with GitHub Actions Inactive
@nuwang nuwang temporarily deployed to cloud-integration July 9, 2026 09:52 — with GitHub Actions Inactive
@nuwang nuwang merged commit 60dbe30 into main Jul 9, 2026
8 checks passed
@nuwang nuwang deleted the fix-provider-typing-followups branch July 9, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant