Conversation
…yaml for consistency
…the API Gateway to Kubernetes
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce a complete CI/CD pipeline for a Go API Gateway, replacing an older workflow with new build/test/package and Kubernetes deployment workflows. The gateway code is updated to support environment variable-based service URL configuration, and config.yaml is restructured to standardize API routes and add environment variable wiring for service discovery. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant Build as build.yaml
participant Docker as GHCR Registry
participant K8s as Kubernetes Cluster
participant Deploy as deploy.yaml
GH->>Build: Trigger on push to main/devOps/dev
Build->>Build: Checkout, setup Go 1.22
Build->>Build: Build & test gateway
Build->>Docker: Generate metadata & login
Build->>Docker: Build & push Docker image
Build-->>Deploy: Job completes successfully
Deploy->>Deploy: Trigger on main/devOps/dev
Deploy->>Deploy: Derive short commit SHA
Deploy->>Deploy: Install kubectl & yq
Deploy->>K8s: Authenticate via kubeconfig
Deploy->>K8s: Update gateway-deployment.yaml image tag
Deploy->>K8s: Apply manifest
Deploy->>K8s: Wait for rollout completion
sequenceDiagram
participant Config as config.yaml
participant Gateway as gateway (main.go)
participant Env as Environment Variables
participant Service as Target Service
Gateway->>Config: Load service configuration
Gateway->>Gateway: For each service, check EnvVar field
alt EnvVar explicitly set
Gateway->>Env: Lookup service's EnvVar name
Env-->>Gateway: Return env value (if set)
Gateway->>Gateway: Override TargetURL, log override
else EnvVar not set
Gateway->>Gateway: Auto-generate env name (UPPERCASE_SERVICE_NAME_SERVICE_URL)
Gateway->>Env: Lookup auto-generated name
Env-->>Gateway: Return env value (if set)
Gateway->>Gateway: Override TargetURL if found, log override
end
Gateway->>Service: Route requests to resolved TargetURL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
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 |
Summary by CodeRabbit
Chores
New Features
/api/v1/<service>format.