Refactor config interpolation in gateway#2761
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughGateway configuration now uses explicit ChangesGateway configuration interpolation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Compose
participant ConfigFile
participant GatewayController
participant Environment
Compose->>GatewayController: start with api-platform.env
GatewayController->>ConfigFile: load config.toml over defaults
ConfigFile->>Environment: resolve {{ env }} tokens
Environment-->>GatewayController: interpolated settings
GatewayController->>GatewayController: unmarshal and validate
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 1
🧹 Nitpick comments (1)
gateway/configs/config-template.toml (1)
14-14: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider generating a unique
gateway_iddynamically.The default
gateway_idis still the static"platform-gateway-id"placeholder. Based on learnings, when deploying multiple gateways against a shared database, ensure that deployment scripts or configurations dynamically generate and inject a unique ID (preferably UUIDv7) via theAPIP_GW_CONTROLLER_SERVER_GATEWAY_IDenvironment variable to prevent identification collisions.🤖 Prompt for 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. In `@gateway/configs/config-template.toml` at line 14, Update the gateway_id configuration in the template to require or generate a deployment-specific unique identifier, preferably UUIDv7, through APIP_GW_CONTROLLER_SERVER_GATEWAY_ID instead of falling back to the static "platform-gateway-id" value. Ensure deployment scripts or configuration inputs inject a distinct ID for each gateway instance.Source: Learnings
🤖 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 `@gateway/configs/config.toml`:
- Around line 39-61: Add the missing [controller.storage.postgres] configuration
block to config.toml with explicit env interpolation tokens for its Postgres
settings, and add deployment_sync_enabled under [controller.controlplane] using
the corresponding environment override token and default. Preserve the existing
configuration structure and naming conventions so Docker Compose users can
configure Postgres and deployment sync through api-platform.env.
---
Nitpick comments:
In `@gateway/configs/config-template.toml`:
- Line 14: Update the gateway_id configuration in the template to require or
generate a deployment-specific unique identifier, preferably UUIDv7, through
APIP_GW_CONTROLLER_SERVER_GATEWAY_ID instead of falling back to the static
"platform-gateway-id" value. Ensure deployment scripts or configuration inputs
inject a distinct ID for each gateway instance.
🪄 Autofix (Beta)
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7f189a96-dd91-4fe6-a94e-a98395682ccf
⛔ Files ignored due to path filters (2)
gateway/gateway-controller/go.sumis excluded by!**/*.sumgateway/gateway-runtime/policy-engine/go.sumis excluded by!**/*.sum
📒 Files selected for processing (24)
.agents/skills/gateway-debug/SKILL.mddocs/gateway/bottom-up-api-deployment-guide.mddocs/gateway/immutable-gateway.mdgateway/.gitignoregateway/DEBUG_GUIDE.mdgateway/README.mdgateway/configs/config-template.tomlgateway/configs/config.tomlgateway/distribution/docker-compose.yamlgateway/docker-compose-perf.yamlgateway/docker-compose.debug.yamlgateway/docker-compose.yamlgateway/gateway-builder/templates/Dockerfile.gateway-controller.tmplgateway/gateway-controller/README.mdgateway/gateway-controller/go.modgateway/gateway-controller/pkg/config/config.gogateway/gateway-controller/pkg/config/config_test.gogateway/gateway-runtime/README.mdgateway/gateway-runtime/policy-engine/go.modgateway/gateway-runtime/policy-engine/internal/config/config.gogateway/gateway-runtime/policy-engine/internal/config/config_test.gogateway/it/test-config.tomlgateway/it/test-config.vhosts-multi.tomlgateway/it/test-config.vhosts-single.toml
💤 Files with no reviewable changes (2)
- gateway/gateway-runtime/policy-engine/go.mod
- gateway/gateway-controller/go.mod
Dependency Validation ResultsDependency name: github.com/envoyproxy/go-control-plane/envoy Dependency name: google.golang.org/grpc Dependency name: github.com/gorilla/websocket Dependency name: github.com/testcontainers/testcontainers-go/modules/compose Dependency name: github.com/envoyproxy/go-control-plane/envoy Dependency name: go.opentelemetry.io/otel Dependency name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Dependency name: go.opentelemetry.io/otel/sdk Dependency name: go.opentelemetry.io/otel/trace Dependency name: go.opentelemetry.io/proto/otlp Dependency name: google.golang.org/grpc Dependency name: github.com/testcontainers/testcontainers-go/modules/compose Next Steps
|
Dependency Validation ResultsDependency name: github.com/envoyproxy/go-control-plane/envoy Dependency name: google.golang.org/grpc Dependency name: github.com/gorilla/websocket Dependency name: github.com/testcontainers/testcontainers-go/modules/compose Dependency name: github.com/envoyproxy/go-control-plane/envoy Dependency name: go.opentelemetry.io/otel Dependency name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Dependency name: go.opentelemetry.io/otel/sdk Dependency name: go.opentelemetry.io/otel/trace Dependency name: go.opentelemetry.io/proto/otlp Dependency name: google.golang.org/grpc Dependency name: github.com/testcontainers/testcontainers-go/modules/compose Next Steps
|
Pending