Fix GCP Cloud Run deployer timeout for internal/authenticated services#4700
Fix GCP Cloud Run deployer timeout for internal/authenticated services#4700
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes Cloud Run deployment timeouts for services that aren’t directly reachable via unauthenticated public HTTP by skipping the base deployer’s HTTP health check and relying on Cloud Run’s API-reported readiness state during polling.
Changes:
- Override
GCPDeployer._check_deployment_health()to bypassrequests.gethealth checks when ingress is restricted or unauthenticated access is disabled. - Add debug logging explaining when/why the HTTP health check is skipped.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if settings.ingress != "all" or not settings.allow_unauthenticated: | ||
| logger.debug( | ||
| "Skipping HTTP health check for deployment " | ||
| f"'{deployment.name}' because the Cloud Run service is " | ||
| f"not publicly accessible (ingress={settings.ingress!r}, " | ||
| f"allow_unauthenticated={settings.allow_unauthenticated}). " | ||
| "Relying on Cloud Run API state instead." | ||
| ) | ||
| return True |
There was a problem hiding this comment.
The accessibility check uses the raw settings.ingress != "all", but the deploy path later maps unknown ingress values to INGRESS_TRAFFIC_ALL (public) via ingress_mapping.get(settings.ingress, ...). If a user provides an invalid ingress string, the service will be deployed publicly while this method will still skip the HTTP health check (treating it as restricted). Consider validating GCPDeployerSettings.ingress to only allow the known options (e.g., Literal/Enum) or base the check on the resolved/mapped ingress value (same mapping/default) to keep behavior consistent.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Describe changes
Pre-requisites
Please ensure you have done the following:
developand the open PR is targetingdevelop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes