Skip to content

feat: complete not-found ConduitError codes (processor instance + plugin registries) - #2532

Merged
devarismeroxa merged 1 commit into
mainfrom
feat/conduiterr-processor-not-found
Jul 6, 2026
Merged

feat: complete not-found ConduitError codes (processor instance + plugin registries)#2532
devarismeroxa merged 1 commit into
mainfrom
feat/conduiterr-processor-not-found

Conversation

@devarismeroxa

Copy link
Copy Markdown
Contributor

Finishes the not-found migrations begun in #2528 (connector plugin) and #2530 (pipeline/connector instance):

Code Where
processor.instance_not_found pkg/processor Service.Get (the choke point every processor method routes through)
processor.plugin_not_found builtin and standalone processor registries
connector.plugin_not_found standalone connector registry (completes the set — builtin was #2528)

Every site keeps the original sentinel in the chain via conduiterr.Wraperrors.Is(err, ErrInstanceNotFound) / plugin.ErrPluginNotFound are unaffected (invariant noted at each site). Purely additive.

Tests

TestService_Get_Fail now asserts both the sentinel Is-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

…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>
@devarismeroxa
devarismeroxa requested a review from a team as a code owner July 6, 2026 00:02
@devarismeroxa
devarismeroxa merged commit cf47259 into main Jul 6, 2026
5 checks passed
@devarismeroxa
devarismeroxa deleted the feat/conduiterr-processor-not-found branch July 6, 2026 00:07
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>
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.

1 participant