feat: complete not-found ConduitError codes (processor instance + plugin registries) - #2532
Merged
Merged
Conversation
…gin registries) Finishes the not-found migrations begun in the connector-plugin (#2528) and pipeline/connector-instance (#2530) PRs: - processor.instance_not_found (CodeProcessorNotFound, pkg/processor/codes.go): Service.Get now wraps ErrInstanceNotFound with the code + a suggestion — the single choke point every processor method routes through. - processor.plugin_not_found (CodeProcessorPluginNotFound): the builtin and standalone processor registries now emit the code when a plugin/version is missing, mirroring the connector builtin registry from #2528. - connector.plugin_not_found: the standalone connector registry now emits the code too, completing the connector plugin-not-found set (builtin was #2528). All sites keep the original sentinel in the chain via conduiterr.Wrap (errors.Is(err, ErrInstanceNotFound) / plugin.ErrPluginNotFound unaffected; invariant noted at each site). Purely additive. Test: TestService_Get_Fail asserts both the sentinel Is-check and the new code + suggestion. Existing registry/service suites pass unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks
devarismeroxa
added a commit
that referenced
this pull request
Jul 6, 2026
…peline, connector, orchestrator (#2538) Continues the structured-error rollout (steps 2-4 covered not-found errors in #2527-#2532) by migrating the non-not-found sentinels used to guard pipeline lifecycle and mutation preconditions: - pipeline.running / pipeline.not_running (codes.FailedPrecondition): ErrPipelineRunning / ErrPipelineNotRunning, wrapped at their clean control-plane raise sites in pkg/lifecycle/service.go (Start/Stop) and pkg/orchestrator/{pipelines,connectors,processors}.go (Update/Delete/Create guards). - pipeline.name_already_exists (codes.AlreadyExists) / pipeline.name_missing (codes.InvalidArgument): pkg/pipeline/service.go Update and validatePipeline (the latter joined via cerrors.Join, same pattern as pkg/provisioning/config/validate.go). - connector.running (codes.FailedPrecondition): the single choke point, Instance.Connector in pkg/connector/instance.go. - connector.invalid_type (codes.InvalidArgument): the user-facing check in connector.Service.Create. - orchestrator.invalid_processor_parent_type (codes.InvalidArgument), orchestrator.pipeline_has_{processors,connectors}_attached, orchestrator.connector_has_processors_attached, orchestrator.immutable_provisioned_by_config (all codes.FailedPrecondition): new pkg/orchestrator/codes.go, wrapped at every raise site in the orchestrator package. Every sentinel stays in the error chain via conduiterr.Wrap (invariant comment at each site); existing errors.Is checks are preserved, though tests that previously asserted strict `is.Equal(err, sentinel)` identity had to be updated to errors.Is + a ConduitError code/suggestion check, since wrapping necessarily changes the concrete error value (documented in the PR). Deferred (reported, not migrated, to keep blast radius tight): the lifecycle-poc (PipelineArchV2 preview) mirror of ErrPipelineRunning/ ErrPipelineNotRunning; the internal runPipeline tomb-alive defensive check; and three defensive/unreachable ErrInvalidConnectorType switch defaults (SetState, store.decode, Instance.Connector) guarding already-validated data. Design: docs/design-documents/20260705-conduit-error-and-structured-output.md Claude-Session: https://claude.ai/code/session_01Tapg9dLWXKMZJoL65R24vd Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finishes the not-found migrations begun in #2528 (connector plugin) and #2530 (pipeline/connector instance):
processor.instance_not_foundpkg/processorService.Get(the choke point every processor method routes through)processor.plugin_not_foundconnector.plugin_not_foundEvery site keeps the original sentinel in the chain via
conduiterr.Wrap—errors.Is(err, ErrInstanceNotFound)/plugin.ErrPluginNotFoundare unaffected (invariant noted at each site). Purely additive.Tests
TestService_Get_Failnow asserts both the sentinelIs-check and the new code + suggestion. Existing registry/service suites pass unchanged; orchestrator/provisioning/api (the heavy sentinel consumers) verified green.With this, every not-found path in the engine — pipeline, connector, processor instances, and connector/processor plugins — carries a machine-actionable code. Tier 2 (additive). Advances #2451 and the v0.16 structured-error rollout.
🤖 Generated with Claude Code