Repository navigation
fix(consul): remove Consul handler and add recurrence-prevention [OMN-4857] - #804
Conversation
…-4857] T5-A confirmed Consul is decommissioned. Remove live Consul HTTP call from HandlerRegistryApiListInstances (returns empty list instead). Remove all CONSUL_* error codes from node_registry_effect/contract.yaml. Add pre-commit hook and CI step to block future CONSUL_HOST reintroduction in src/.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoves Consul service discovery: adds CI and pre-commit checks to block Consul references, replaces Consul-backed list_instances handler with an empty response, and updates the node registry contract to PostgreSQL-only (rename capability, remove Consul errors/health checks, update metadata). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can disable sequence diagrams in the walkthrough.Disable the |
…dler-add-recurrence-prevention
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/omnibase_infra/nodes/node_registry_effect/contract.yaml (2)
97-108: Stale comments describe dual-backend Consul/PostgreSQL behavior.These comments describe parallel execution with both
HandlerConsulRegisterandHandlerPostgresUpsert, but Consul handlers no longer exist. Consider updating or removing these references to avoid confusion.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/omnibase_infra/nodes/node_registry_effect/contract.yaml` around lines 97 - 108, The comments in the contract.yaml describe dual-backend behavior referencing HandlerConsulRegister and HandlerPostgresUpsert which no longer exist; update the documentation block to remove or replace Consul-specific references: locate the "Parallel Execution Behavior" section and either remove mentions of Consul handlers (HandlerConsulRegister) and the dual-backend example, or replace them with the current handler names and backends used by the register_node flow; keep/clarify descriptions of execution_mode ("parallel"), partial_failure_handling, and retry_partial_failure semantics so they reflect the current implementation and avoid referencing stale Consul handlers.
46-56: Stale comments reference Consul in the design rationale.The design rationale comments (lines 46-48, 54-55) still describe parallel execution for "Consul + Postgres" backends, but Consul is now decommissioned. While the response model intentionally retains
consul_resultfor backward compatibility, these comments could mislead future readers.📝 Suggested comment updates
# Design Rationale: -# - Parallel execution for independent backends (Consul + Postgres) -# - Partial failure handling allows one backend to succeed even if other fails +# - Parallel execution architecture (originally Consul + Postgres, now Postgres-only) +# - Partial failure handling retained for future multi-backend support # - Each handler is responsible for a single backend operation # # Execution Flow: # 1. Receive ModelRegistryRequest with operation type # 2. Route to all matching handlers based on payload type -# 3. Execute handlers in parallel (for dual-backend operations) +# 3. Execute handlers (single backend post OMN-4857) # 4. Aggregate results with partial failure handling # 5. Return ModelRegistryResponse with combined status🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/omnibase_infra/nodes/node_registry_effect/contract.yaml` around lines 46 - 56, Update the design rationale comments to remove references to the decommissioned "Consul + Postgres" pairing and instead describe the current backend arrangement (e.g., Postgres as the active backend), while noting that the response model still contains consul_result for backward compatibility; specifically edit the block describing parallel execution and partial failure handling so it no longer mentions Consul but explains that handlers may target multiple backends (active and legacy fields) and that ModelRegistryRequest is routed to handlers and aggregated into ModelRegistryResponse with partial-failure semantics, keeping consul_result as a preserved compatibility field..github/workflows/test.yml (1)
137-141: CI check pattern is less comprehensive than pre-commit hook.The CI step only checks for
CONSUL_HOST, but the pre-commit hook (.pre-commit-config.yamlline 329) also blocksconsul.connect.io. This inconsistency could allowconsul.connect.ioreferences to pass CI but fail locally on pre-commit.Consider aligning the patterns:
🔧 Proposed fix to align CI with pre-commit pattern
- if grep -rn "CONSUL_HOST" src/; then - echo "FAIL: CONSUL_HOST references found in src/ — Consul is decommissioned (OMN-4857)" + if grep -rn -E "CONSUL_HOST|consul\.connect\.io" src/; then + echo "FAIL: Consul references found in src/ — Consul is decommissioned (OMN-4857)" exit 1 fi - echo "PASS: No CONSUL_HOST references in src/" + echo "PASS: No Consul references in src/"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/test.yml around lines 137 - 141, The CI grep in .github/workflows/test.yml currently only checks for "CONSUL_HOST" but must match the pre-commit hook which also blocks "consul.connect.io"; update the CI check to use an extended regex (e.g., search for CONSUL_HOST or consul\.connect\.io) so the if condition fails when either pattern is present, and update the failure/ success messages accordingly; locate the block containing the grep invocation in test.yml and replace the single-pattern grep with an egrep/grep -E pattern like "CONSUL_HOST|consul\.connect\.io".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/test.yml:
- Around line 137-141: The CI grep in .github/workflows/test.yml currently only
checks for "CONSUL_HOST" but must match the pre-commit hook which also blocks
"consul.connect.io"; update the CI check to use an extended regex (e.g., search
for CONSUL_HOST or consul\.connect\.io) so the if condition fails when either
pattern is present, and update the failure/ success messages accordingly; locate
the block containing the grep invocation in test.yml and replace the
single-pattern grep with an egrep/grep -E pattern like
"CONSUL_HOST|consul\.connect\.io".
In `@src/omnibase_infra/nodes/node_registry_effect/contract.yaml`:
- Around line 97-108: The comments in the contract.yaml describe dual-backend
behavior referencing HandlerConsulRegister and HandlerPostgresUpsert which no
longer exist; update the documentation block to remove or replace
Consul-specific references: locate the "Parallel Execution Behavior" section and
either remove mentions of Consul handlers (HandlerConsulRegister) and the
dual-backend example, or replace them with the current handler names and
backends used by the register_node flow; keep/clarify descriptions of
execution_mode ("parallel"), partial_failure_handling, and retry_partial_failure
semantics so they reflect the current implementation and avoid referencing stale
Consul handlers.
- Around line 46-56: Update the design rationale comments to remove references
to the decommissioned "Consul + Postgres" pairing and instead describe the
current backend arrangement (e.g., Postgres as the active backend), while noting
that the response model still contains consul_result for backward compatibility;
specifically edit the block describing parallel execution and partial failure
handling so it no longer mentions Consul but explains that handlers may target
multiple backends (active and legacy fields) and that ModelRegistryRequest is
routed to handlers and aggregated into ModelRegistryResponse with
partial-failure semantics, keeping consul_result as a preserved compatibility
field.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7b1265e3-5c45-4009-a9c7-032f18b9a637
📒 Files selected for processing (4)
.github/workflows/test.yml.pre-commit-config.yamlsrc/omnibase_infra/nodes/node_registry_api_effect/handlers/handler_registry_api_list_instances.pysrc/omnibase_infra/nodes/node_registry_effect/contract.yaml
…dler-add-recurrence-prevention
…dler-add-recurrence-prevention
The test was still passing consul_host/consul_port to HandlerRegistryApiListInstances which no longer accepts constructor arguments after Consul decommissioning. Simplified to verify the handler returns an empty instance list without Consul mocking.
…dler-add-recurrence-prevention
Summary
HandlerRegistryApiListInstances— replaces with a clean empty-list stub (Consul was decommissioned per OMN-3540; T5-A investigation (OMN-4856) confirmed noCONSUL_HOSTin env, k8s manifests, or Docker infra)CONSUL_*error codes fromnode_registry_effect/contract.yaml(6 error codes, consul circuit breaker backend, consul health check, consul tags/capabilities)no-consul-references(pygrep:CONSUL_HOST|consul.connect.ioinsrc/) to block reintroductiontest.ymlONEX Validators job to enforce the same check in CIRisk
Low — Consul was already decommissioned (OMN-3540). The handler was reading
CONSUL_HOSTenv var that does not exist in production config. The change makes the handler return the same result it was already returning on every real invocation (empty list, because Consul was unreachable).Test Evidence
no-consul-referenceshook)grep -rn "CONSUL_HOST" src/returns clean after the changegrep -r "CONSUL" src/omnibase_infra/returns zero matches forCONSUL_HOST(warning codes incatalog_warning_codes.pyare intentional — see OMN-3540 stub design)Rollback
Revert this commit. No migration, no data change, no config change required.
Linear
Closes OMN-4857
Part of OMN-4832 (Epic 5: Consul Decommission Audit)
Summary by CodeRabbit