Description:
While checking the broader resource reference annotation gaps tracked in #379, I found two additional straightforward misses in storage/frontend_virtio_scsi.proto.
These fields represent other resources, but they do not currently declare (google.api.resource_reference).type:
storage/frontend_virtio_scsi.proto:190 - VirtioScsiLun.target_name_ref
storage/frontend_virtio_scsi.proto:421 - StatsVirtioScsiLunRequest.controller_name_ref
Why this is an issue:
The same file already uses explicit resource reference typing for related fields, for example:
CreateVirtioScsiLunRequest.parent uses child_type = "opi_api.storage.v1/VirtioScsiTarget"
DeleteVirtioScsiLunRequest.name uses type = "opi_api.storage.v1/VirtioScsiLun"
CreateVirtioScsiTargetRequest.parent uses child_type = "opi_api.storage.v1/VirtioScsiController"
So these two fields stand out as inconsistent with the rest of the schema and with AIP-122 guidance for fields that reference another resource.
Expected fix:
Add the missing resource reference annotations:
target_name_ref -> opi_api.storage.v1/VirtioScsiTarget
controller_name_ref -> opi_api.storage.v1/VirtioScsiController
Issue inspection:
Inspect storage/frontend_virtio_scsi.proto and compare:
- line 190:
string target_name_ref = 2 [(google.api.field_behavior) = REQUIRED];
- line 421:
string controller_name_ref = 2 [(google.api.field_behavior) = OPTIONAL];
against nearby fields in the same file that already include (google.api.resource_reference) metadata.
Description:
While checking the broader resource reference annotation gaps tracked in #379, I found two additional straightforward misses in
storage/frontend_virtio_scsi.proto.These fields represent other resources, but they do not currently declare
(google.api.resource_reference).type:storage/frontend_virtio_scsi.proto:190-VirtioScsiLun.target_name_refstorage/frontend_virtio_scsi.proto:421-StatsVirtioScsiLunRequest.controller_name_refWhy this is an issue:
The same file already uses explicit resource reference typing for related fields, for example:
CreateVirtioScsiLunRequest.parentuseschild_type = "opi_api.storage.v1/VirtioScsiTarget"DeleteVirtioScsiLunRequest.nameusestype = "opi_api.storage.v1/VirtioScsiLun"CreateVirtioScsiTargetRequest.parentuseschild_type = "opi_api.storage.v1/VirtioScsiController"So these two fields stand out as inconsistent with the rest of the schema and with AIP-122 guidance for fields that reference another resource.
Expected fix:
Add the missing resource reference annotations:
target_name_ref->opi_api.storage.v1/VirtioScsiTargetcontroller_name_ref->opi_api.storage.v1/VirtioScsiControllerIssue inspection:
Inspect
storage/frontend_virtio_scsi.protoand compare:string target_name_ref = 2 [(google.api.field_behavior) = REQUIRED];string controller_name_ref = 2 [(google.api.field_behavior) = OPTIONAL];against nearby fields in the same file that already include
(google.api.resource_reference)metadata.