Fixed vera and GCP discrepancies for Zones, Regions, and Machine type#40
Open
raysunjello wants to merge 1 commit intoproject-vera:mainfrom
Open
Fixed vera and GCP discrepancies for Zones, Regions, and Machine type#40raysunjello wants to merge 1 commit intoproject-vera:mainfrom
raysunjello wants to merge 1 commit intoproject-vera:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 7 fidelity issues found by comparing vera's GCP emulator responses to real GCP API responses across zones, regions, and machine types.
Issues Fixed
Issue 1 — Malformed selfLink URLs
zone.to_dict()andregion.to_dict()were producing broken URLs likehttps://www.googleapis.com/compute/v1/us-central1-a(missing/projects/{project}/zones/path segment). Fixed to use the correct full path.Issue 2 — Missing creationTimestamp
Zones, regions, and machine types were missing
creationTimestamp. Added the correct Unix epoch sentinel value1969-12-31T16:00:00.000-08:00that real GCP uses for resources with no meaningful creation time.Issue 3 — Missing or non-deterministic IDs
Zone and region seeds had no
idfield. Machine type IDs were generated viahash()which changes every Python process run. Replaced with stable IDs verified against real GCP (e.g. us-central1-a →2000, us-central1 →1000, n1-standard-1 →3001).Issue 4 — deprecated field always included
zone.to_dict()andregion.to_dict()always serializeddeprecated: {}even for active resources. Real GCP omits this field entirely when a resource is not deprecated. Fixed to only include it when non-empty.Issue 5 — availableCpuPlatforms empty
All zones returned an empty
availableCpuPlatformsarray. Seeded the correct platform lists for each us-central1 zone verified against real GCP (us-central1-c has a slightly different set than a/b/f).Issue 6 — Machine type responses missing fields
Machine type responses were missing
imageSpaceGb,isSharedCpu,maximumPersistentDisks, andmaximumPersistentDisksSizeGb. Added all fields with values verified against real GCP for all 10 machine types. Also corrected descriptions to match real GCP exactly.Issue 7 — Only one zone seeded
Only
us-central1-awas seeded. Real GCP'sus-central1has four zones: a, b, c, and f. Added seeds for all four zones with correct IDs,supportsPzsvalues (a/b/c →true, f →false), and per-zone CPU platform lists. Updated the region's zones list accordingly.Files Changed
emulators/google-compute/emulator_core/services/zone.pyemulators/google-compute/emulator_core/services/region.pyemulators/google-compute/main.py