Fit staging Cloud Run tag within the 46-char combined limit#3730
Merged
Conversation
Cloud Run rejects deploys where traffic tag + service name exceed 46 characters (they form the tag URL's DNS label). The Stage 1 service rename to policyengine-api-staging (24 chars) left 22 for the tag, but the staging tag template stage3-staging-<run#>-<sha7> is at least 24 — every staging deploy failed at gcloud. Shorten the staging tag to stg-<run#>-<sha7> (combined <=45 even at 9-digit run numbers; prod keeps stage3-prod-*, which exit gates key on) and add a fail-fast combined-length guard to deploy validation. Fixes #3729 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3730 +/- ##
=======================================
Coverage 79.82% 79.82%
=======================================
Files 70 70
Lines 4336 4336
Branches 808 808
=======================================
Hits 3461 3461
Misses 655 655
Partials 220 220 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #3729
Summary
The first post-merge deploy after #3720 failed at Deploy staging Cloud Run candidate (run 28809472052): Cloud Run rejects deploys where traffic tag + service name exceed 46 combined characters (they form the tag URL's DNS label). The Stage 1 rename to
policyengine-api-staging(24 chars) leaves 22 for the tag, butstage3-staging-<run#>-<sha7>is ≥24 even with a one-digit run number — structurally impossible, every staging deploy fails, and the production promote gates depend on this leg, so master is undeployed until this merges.Changes
push.yml: staging revision tag becomesstg-<run#>-<sha7>(16 chars today, ≤21 at nine-digit run numbers → combined ≤45). The prod tag is untouched — exit gates and traffic-isolation checks key onstage3-prod-*.validate_cloud_run_deploy_env.sh: fail-fast combined-length guard with an explicit message, so this class of error dies in validation rather than at gcloud. Verified against the exact failing combo (reports 51 > 46 and exits 1).Verification
stage3-staging-2401-7110f23+policyengine-api-stagingand passes on the new tag.tests/unit/test_cloud_run_deploy_scripts.py: 30/30 (including the inline-run-block length rule).After merge
This PR's own push cycle doubles as the Stage 1 exit-gate observation run (traffic isolation, staging service health, header presence, first-attempt-green Cloud Run deploys, container-start → ready duration for Stage 2).
🤖 Generated with Claude Code