Skip to content

Conversation

@JesperTerkelsen
Copy link
Member

Summary

FIX: Detect autoSync configuration from kube-manifests repo when not present in service repo.

Problem

ArgoCD auto-sync detection was failing for services where the ArgoCD config is in the kube-manifests repo rather than embedded in the service repo.

Example: https://github.com/monta-app/rfx-engine/actions/runs/21045549584/job/60519250666

Error:

⏭️ No config.yaml found - ArgoCD auto-sync is not configured
⏭️ Skipping ArgoCD sync monitoring - auto-sync is not configured for this application

Root Cause: The detection logic only checked for ../cluster/config.yaml relative to the helm values path in the service repo. For rfx-engine (and potentially other services), the actual config is in kube-manifests at apps/rfx-engine/production/cluster/config.yaml.

Solution

Add fallback logic to check kube-manifests repo via GitHub API when config is not found locally.

Detection Flow

  1. First: Check for local ../cluster/config.yaml (preserves existing behavior)
    • ✅ Works for services with embedded helm charts and configs
  2. Fallback: If not found locally, check kube-manifests via GitHub API
    • ✅ Path: apps/{service-identifier}/{stage}/cluster/config.yaml
    • ✅ Uses MANIFEST_REPO_PAT for authentication
    • ✅ Fetches content, decodes base64, checks for autoSync

Changes

component-deploy-v2.yml

Updated detection logic:

# Check local config first
if [ -f "../cluster/config.yaml" ]; then
  # Check autoSync locally (existing behavior)
else
  echo "⏭️ No local config.yaml found, checking kube-manifests repo..."
  
  # Fallback: Check kube-manifests via GitHub API
  CONFIG_PATH="apps/${service-identifier}/${stage}/cluster/config.yaml"
  
  if CONFIG_CONTENT=$(gh api repos/monta-app/kube-manifests/contents/$CONFIG_PATH --jq '.content' 2>/dev/null); then
    # Decode and check for autoSync
    if echo "$CONFIG_CONTENT" | base64 -d | yq e '.autoSync' - | grep -q -v "null"; then
      echo "enabled=true"
      echo "✓ ArgoCD auto-sync is enabled (kube-manifests config)"
    fi
  fi
fi

Services Affected

Fixes autoSync Detection For:

  • rfx-engine - Config in kube-manifests (immediate fix)
  • ✅ Any other services with external ArgoCD configs

Preserves Existing Behavior For:

  • ✅ Services with embedded helm charts and local configs
  • ✅ agentic, ai-platform, and all v2 services

Impact

After merge:

  • ✅ rfx-engine deployments will correctly detect autoSync and enable monitoring
  • ✅ Real-time ArgoCD sync status will be available
  • ✅ Deployment timing metrics will be captured
  • ✅ No impact on services with local configs (same behavior)

Testing

The fix can be validated by:

  1. Merging this PR
  2. Deploying rfx-engine
  3. Verifying detection message: "✓ ArgoCD auto-sync is enabled (kube-manifests config)"
  4. Confirming ArgoCD monitoring activates

🤖 Generated with Claude Code

The autoSync detection was failing for services where the ArgoCD config
is in kube-manifests repo rather than embedded in the service repo.

Changes:
- First checks for local cluster/config.yaml (preserves existing behavior)
- Falls back to checking kube-manifests via GitHub API if not found locally
- Uses MANIFEST_REPO_PAT for authentication
- Path: apps/{service-identifier}/{stage}/cluster/config.yaml

This fixes autoSync detection for:
- rfx-engine (config in kube-manifests)
- Any other services with external ArgoCD configs

Existing services with embedded configs are unaffected (same behavior).
@JesperTerkelsen JesperTerkelsen merged commit b553940 into main Jan 15, 2026
1 check passed
@JesperTerkelsen JesperTerkelsen deleted the fix/detect-autosync-from-kube-manifests branch January 15, 2026 20:52
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.

3 participants