Skip to content

Conversation

@jeremyeder
Copy link
Collaborator

Summary

Implements automated version synchronization for local development to prevent version drift between git tags and deployment manifests.

Changes

  • Makefile: Add local-sync-version target to automatically sync version from git
  • local-up workflow: Integrated version sync to run before deploying services
  • local-status enhancement: Show Git/Manifest/Running version alignment with drift warnings
  • Frontend manifest: Updated to current version (auto-synced from git describe)

Problem Solved

Previously, the web UI displayed version v0.0.3 (hardcoded in manifest) instead of the current release v0.0.12. This required manual updates every release and caused version drift.

Solution

Automatic version injection using git describe --tags --always, matching the pattern used in CI/CD workflows:

  • Production: Uses release tags
  • Staging: Uses git SHA
  • Local Dev: Now uses git describe (latest tag + commits ahead)

Workflow

Every make local-up now:

  1. Syncs version from git → manifest
  2. Applies updated manifest
  3. Deploys with current version

Verification

After deployment:

  • API returns correct version: {"version":"v0.0.12-22-g5553056"}
  • make local-status shows aligned versions with no warnings

Benefits

  • ✅ Single source of truth (git tags)
  • ✅ No manual version updates needed
  • ✅ Consistent across all environments (local/staging/prod)
  • ✅ Prevents version drift permanently

🤖 Generated with Claude Code

- Add local-sync-version Makefile target to sync version from git tags
- Integrate version sync into local-up workflow (runs before deployment)
- Enhance local-status to show version alignment (Git/Manifest/Running)
- Update frontend deployment manifest to current version (v0.0.12-22-g5553056)

This prevents version drift in local development by automatically
syncing the VTEAM_VERSION environment variable from git describe,
matching the pattern used in CI/CD workflows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Claude Code Review

Summary

This PR implements automated version synchronization for local development environments, addressing version drift between git tags and deployment manifests. The approach is sound and aligns with CI/CD patterns already in use.

Issues by Severity

🚫 Blocker Issues

None identified.

🔴 Critical Issues

None identified.

🟡 Major Issues

1. Overly Broad Regex Pattern

  • Location: Makefile:212
  • Issue: The regex pattern is too greedy and could match unintended environment variables
  • Problem: Will match ANY line with value: "v...", not just VTEAM_VERSION
  • Risk: Could accidentally modify other environment variables
  • Recommended fix: Use /VTEAM_VERSION/,+1 pattern to be more specific

2. Base Manifest Not Updated

  • Location: components/manifests/base/frontend-deployment.yaml
  • Issue: Only minikube manifest is updated, base manifest remains at v0.0.7
  • Impact: Inconsistency between base and minikube manifests
  • Recommendation: Either update both or document why only minikube is synced

🔵 Minor Issues

1. Missing Documentation

  • Issue: No inline comments explaining the version sync strategy
  • Recommendation: Add comments explaining the git describe pattern

2. Version Format Comparison

  • Location: Makefile:204
  • Issue: Version comparison may show warnings for valid version format differences

Positive Highlights

✅ Excellent alignment with CI/CD patterns
✅ Automatic integration - Runs as part of make local-up
✅ Good user feedback - local-status shows version alignment
✅ Idempotent operation - Can run multiple times safely
✅ Fallback handling - Uses dev as fallback
✅ Clean implementation - Minimal changes
✅ Proper .PHONY declaration

Recommendations

High Priority

  1. Fix regex specificity to target only VTEAM_VERSION
  2. Add inline documentation explaining versioning strategy

Medium Priority

  1. Update base manifest or document the intentional difference
  2. Test on both macOS and Linux to verify sed compatibility

Security Review

✅ No security concerns identified

Testing Recommendations

  • Test on macOS BSD sed
  • Test on Linux GNU sed
  • Test with no git tags
  • Verify UI shows correct version
  • Confirm other env vars are not modified

Conclusion

Recommendation: APPROVE with minor improvements

This PR successfully solves the version drift problem. The only significant concern is the regex pattern specificity which should be addressed before merge.

Suggested merge strategy: Squash and merge after addressing regex specificity

📊 Review Statistics: 2 files, 23 additions, 2 deletions, 0 critical issues, 2 major issues

🤖 Generated with Claude Code


🔍 View AI decision process (logs available for 90 days)

📋 View memory system files loaded (click to expand)

What Amber Loaded for Code Review

Amber automatically loaded these repository standards from the memory system:

  1. CLAUDE.md - Master project instructions, development standards
  2. backend-development.md - Go backend, K8s integration patterns
  3. frontend-development.md - NextJS, Shadcn UI, React Query patterns
  4. security-standards.md - Auth, RBAC, token handling
  5. k8s-client-usage.md - User token vs service account patterns
  6. error-handling.md - Consistent error patterns
  7. react-query-usage.md - Data fetching patterns

Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines.

@jeremyeder jeremyeder merged commit cd9577b into ambient-code:main Dec 7, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant