ci: automated deploy to GCP VM (WIF + IAP) - #5
Conversation
- deploy.yml: WIF auth (no keys), build+push image to Artifact Registry, ship deploy files and run deploy.sh on planner-vm over an IAP tunnel. workflow_dispatch with a `tag` input redeploys/rolls back an existing image without rebuilding. Image tag validated against the docker-tag charset before entering any shell command. - go.yml: workflow_call trigger so deploy gates on lint + build + test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016aitZGthghNeJEdjYFsZT8
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a production deployment workflow for pushes to ChangesProduction deployment
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub Actions
participant GoWorkflow as Reusable Go workflow
participant GCP as GCP
participant Registry as Container registry
participant VM as Production VM
GitHub->>GoWorkflow: Run Go tests
GoWorkflow-->>GitHub: Return test result
GitHub->>GitHub: Resolve and validate image tag
GitHub->>GCP: Authenticate with Workload Identity
GitHub->>Registry: Build and push image when needed
GitHub->>VM: Copy deployment files over IAP
GitHub->>VM: Run deployment script with image tag
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/deploy.yml:
- Around line 12-14: Keep only contents: read in the workflow-level permissions,
and move id-token: write into the permissions block for jobs.deploy. Ensure the
reusable test job no longer inherits OIDC token access while the deployment job
retains it.
- Line 28: Update the actions/checkout step to set persist-credentials to false,
ensuring the checkout token is removed from workspace Git configuration before
the image build.
- Around line 30-40: Update the “Resolve and validate image tag” step so the raw
inputs.tag value is passed through the step environment rather than interpolated
into the run script. In the shell, apply the github.sha fallback using that
environment variable, then validate the resulting tag and write it to
GITHUB_OUTPUT, preventing command substitution or other shell syntax from
executing before validation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d41a2f57-5a76-4d00-a95b-04df9f7763a0
📒 Files selected for processing (2)
.github/workflows/deploy.yml.github/workflows/go.yml
- route inputs.tag through env (RAW_TAG) instead of interpolating it into the run script — a $(cmd) value would otherwise execute before the tag regex validated it - grant id-token: write only to the deploy job; the reusable test job now inherits a read-only token Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016aitZGthghNeJEdjYFsZT8
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016aitZGthghNeJEdjYFsZT8
Push-to-main auto-deploy for the planner backend (infra from PR #3). deploy.yml: WIF auth (no keys), build+push image to Artifact Registry, scp deploy files, run deploy.sh on planner-vm over IAP. workflow_dispatch tag input for rollback. Tag validated against docker-tag charset before any shell use (closes injection finding). go.yml gains workflow_call as the gate. Repo vars + deployer serviceAccountUser already set. 🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores