cloud-build-investigation
БесплатноЗапускает вложенные скриптыНе проверен🏗️ | Expert-level SRE skill for Google Cloud Build (GCB) and Cloud Run investigations. Activate when user mentions Cloud Build failures, deployment issues to…
Об этом скилле
Cloud Build Investigation Skill
This skill provides expert-level SRE capabilities for investigating and debugging Google Cloud Build (GCB) issues, particularly for deployments to Cloud Run.
When to Activate
Use this skill when:
- User mentions Cloud Build failures or errors
- Debugging deployment issues to Cloud Run
- Investigating why a build/deployment stopped working
- Correlating git commits with build failures
- Setting up or troubleshooting Cloud Build pipelines
- Adding environment variables to Cloud Build/Cloud Run
Core Principles
⚠️ CRITICAL: Assume positive intention!
- If a
cloudbuild.yamlexists with a trigger, DO NOT MOVE OR MAJORLY CHANGE IT - The user (likely Riccardo) may have spent hours making it work
- Take baby steps and minimize mutations
- Changing folder targets or major refactoring will likely break things further
Investigation Workflow
Step 1: Gather Build History
- Run
just git-logs-timestampedto get compact commit history with timestamps (YYYYMMDD HH:MM) - Run
just cloud-build-listto get recent Cloud Builds - Identify N successful builds and M failed builds
- Focus on the FIRST failing build (this is key!)
Step 2: Analyze the Failure
- Use
just cloud-build-show-log FIRST_FAILING_BUILD_IDto examine logs - Cross-correlate with git commits via timestamps
- Cross-reference with the VERSION file (Carlessian standard)
- Identify the exact commit that introduced the failure
Step 3: Root Cause Analysis
Cross-correlate failed build logs with the git diff of the culprit commit:
- Was it a Dockerfile change?
- A dependency update (Gemfile/requirements.txt/package.json)?
- A configuration change?
- An environment variable issue?
Step 4: Corrective Action
If investigation shows NO errors → Done! ✅
If errors found:
File GitHub Issue:
- Title:
[failed Cloud Build] <BUILD_ID> <SHORT_DESCRIPTION> - BUILD_ID in title enables deduplication
- Post the git log list (enables GH to link commits visually)
- Title:
Investigate & Propose Fix:
- Document findings in the issue
- Propose a fix with user collaboration
Test with Baby Steps:
- Cloud Build tests require small commit/pushes
- Version bumps:
1.2.3→1.2.3a→1.2.3b(for quick testing) - Each build takes 5-6 minutes
- Consider combining with minor UI/UX improvements for time efficiency
Monitor:
- Keep checking build status every 2 minutes
- Use
just cloud-build-listandjust cloud-build-show-log {{build_id}}
Required Justfile Targets
Ensure the project's justfile has these targets (adapt PROJECT_ID and CLOUD_RUN_ENDPOINT):
# List latest 10 CB builds, possibly the first might still be running
cloud-build-list:
gcloud builds list --project=PROJECT_ID --limit=10
# Show the log of a specific Cloud Build, eg 7c82188e-485a-4735-a70d-fb303fbfe5a0
cloud-build-show-log build_id:
@echo "Showing log for build ID: {{build_id}}. Use --stream to follow the log indefinitely (you can do it, but I want Gemini NOT to do it)."
gcloud builds log {{build_id}} --project=PROJECT_ID
# Show Cloud Run logs
cloud-run-logs:
@echo "☁️ Fetching logs for Cloud Run environment..."
gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=CLOUD_RUN_ENDPOINT" --project=PROJECT_ID --limit=100 --format="value(timestamp, severity, textPayload)"
# Shows git logs in timestamped way
git-logs-timestamped:
git log --pretty=format:'%h %ad | %s%d [%an]' --date=iso -n 10
Note: If just is not available, use a Makefile instead (convert N spaces to tabs).
Adding Environment Variables
This is a complex process. Follow carefully:
- Add variable to the script (usually in
bin/with "cloud build" in name)- Example:
bin/ricc-cb-push-to-cloudrun-magic.sh
- Example:
- Ensure the variable is passed from Cloud Build in the step that calls it
- Update the Cloud Run trigger for this service
- Should be documented in
README.md(if not, document it!)
- Should be documented in
- Check
gcp/oriac/folders for additional hints
File Structure
If Cloud Build is set up, expect:
cloudbuild.yaml(root file, likely has trigger attached)- Possibly
bin/scripts for deployment - Possibly
gcp/oriac/folders with infrastructure code
Resources
- Scripts: Check
.gemini/skills/cloud-build-investigation/scripts/for helper utilities - References: See
.gemini/skills/cloud-build-investigation/references/for GCP docs
Important Reminders
🚫 DO NOT:
- Change
cloudbuild.yamllocation or major structure - Modify
buildtarget injustfilewithout understanding full context - Make sweeping changes to folder structures
- Auto-stream logs indefinitely (use
--streamcautiously)
✅ DO:
- Take baby steps
- Test incrementally
- Document findings in GitHub issues
- Collaborate with the user (Riccardo)
- Cross-correlate timestamps between git and Cloud B
Установить cloud-build-investigation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cloud-build-investigation?
🏗️ | Expert-level SRE skill for Google Cloud Build (GCB) and Cloud Run investigations. Activate when user mentions Cloud Build failures, deployment issues to Cloud Run, or needs help debugging GCB pipelines. Specializes in correlating git commits with build failures, analyzing build logs, and providing systematic debugging workflows.
Как установить скилл cloud-build-investigation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cloud-build-investigation запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic