Conversation
✱ Stainless preview buildsThis PR will update the
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Risk assessment: Medium-High.
Reasoning from diff scope:
- Cross-cutting production behavior changes across multiple core resource paths (
instances,snapshots,images,volumes,devices,ingress,builds). - New shared metadata validation/matching package (
lib/tags) wired into create/list/get flows, including request validation and filtering semantics. - API contract expansion in
openapi.yamland large generatedlib/oapi/oapi.goupdate increases client/server compatibility surface. - Non-trivial blast radius (43 files, ~1.3k insertions) with user-facing query/filter behavior changes.
Decision:
- Review is required; I did not approve this PR.
- Requested reviewers:
@rgarcia,@hiroTamada.
|
Closes: #126 |
| kind: | ||
| $ref: "#/components/schemas/SnapshotKind" | ||
| metadata: | ||
| $ref: "#/components/schemas/MetadataTags" |
There was a problem hiding this comment.
wondering if we should name this field tags instead of metadata since we already use metadata (at least internally) when talking about instance metadata stored on disk
the counterpoint is that i've never been a fan of the name tags in AWS because i think of tags as a set<string> not map[string]string, but maybe this is just me


Summary
lib/tagspackage for strict metadata validation, cloning, and filter matchingMetadataTagsschema and metadata filters across mutable resourcescreateBuildmultipartmetadatafield as JSON objectValidation
make oapi-generatego test ./lib/tagsgo test ./lib/snapshot -run 'TestStoreSaveLoadListDelete|TestListSnapshotsFilterMatches'go test ./lib/images -run TestImageMetadataToImagego test ./lib/volumes -run TestCreateVolume_MetadataRoundTripgo test ./lib/ingress -run TestCreateIngress_MetadataRoundTripgo test ./lib/builds -run TestBuildMetadataReadWrite_MetadataRoundTripgo test ./lib/instances -run 'TestListInstancesFilter|TestCloneStoredMetadataForFork_DeepCopiesReferenceFields|TestCreateSnapshot'Notes
go test ./...includes unrelated platform/environment-specific failures in this environment (e.g. VZ lifecycle tests and existing cross-platform device test compilation constraints).Note
Medium Risk
Cross-cutting API and persistence changes add/validate
metadataon multiple resource types and modify generated OAPI client/server method signatures for list endpoints. Main risk is backward-compatibility (new 400s for invalid metadata and updated client call sites) rather than core security logic.Overview
Introduces a shared
lib/tagspackage (Validate,Clone,Matches) and adoptstags.Metadataacross builds, devices, images, ingresses, instances, snapshots, and volumes, including persistence and deep-copy behavior.Expands
openapi.yaml/generatedlib/oapiwith a reusableMetadataTagsschema, addsmetadatafields to request/response models, and addsmetadataquery filtering (deepObject) to list endpoints—updating generated client/server interfaces to take*List*Params.Updates API handlers/managers to accept, validate, store, return, and filter by metadata (including parsing
CreateBuildmultipartmetadataJSON), and returns400 invalid_requestfor invalid metadata; adds focused round-trip tests covering metadata storage/cloning and filter matching.Written by Cursor Bugbot for commit 358a2c0. This will update automatically on new commits. Configure here.