Bug Report
Description
Resource visibility handling is inconsistent between initial gateway registration and subsequent gateway updates:
-
register_gateway() (line ~956) preserves upstream resource-specific visibility:
r_visibility = getattr(r, "visibility", None) or visibility
This allows an upstream resource to specify its own visibility, falling back to the gateway's visibility.
-
_update_or_create_resources() (line ~4228) always forces gateway.visibility:
existing_resource.visibility = gateway.visibility
This overwrites any resource-specific visibility on every gateway refresh.
Impact
If a resource was initially registered with a resource-specific visibility override, that override is silently lost on the first gateway refresh/update that succeeds. The resource's visibility is normalized back to the gateway's visibility.
Expected Behavior
Either:
- Both paths should consistently respect resource-specific visibility, OR
- Both paths should consistently use gateway visibility (and
register_gateway should not have the override logic)
The current inconsistency means behavior changes depending on whether a gateway is being registered for the first time vs being refreshed.
Discovered During
Review of PR #3476
Bug Report
Description
Resource visibility handling is inconsistent between initial gateway registration and subsequent gateway updates:
register_gateway()(line ~956) preserves upstream resource-specific visibility:This allows an upstream resource to specify its own visibility, falling back to the gateway's visibility.
_update_or_create_resources()(line ~4228) always forcesgateway.visibility:This overwrites any resource-specific visibility on every gateway refresh.
Impact
If a resource was initially registered with a resource-specific visibility override, that override is silently lost on the first gateway refresh/update that succeeds. The resource's visibility is normalized back to the gateway's visibility.
Expected Behavior
Either:
register_gatewayshould not have the override logic)The current inconsistency means behavior changes depending on whether a gateway is being registered for the first time vs being refreshed.
Discovered During
Review of PR #3476