feat(runtime): add reset executable endpoint#6738
Conversation
a9af052 to
65694f1
Compare
65694f1 to
1283a2d
Compare
There was a problem hiding this comment.
Pull request overview
Adds a runtime-management capability to manually reset an inbound connector executable via a new REST endpoint, leveraging the existing inbound executable registry and batch processing infrastructure.
Changes:
- Added
POST /inbound-instances/{type}/executables/{executableId}/resetendpoint that triggers an executable reset and returns anActiveInboundConnectorResponse. - Introduced
InboundExecutableRegistry.reset(ExecutableId)and implemented it inInboundExecutableRegistryImpl. - Added
BatchExecutableProcessor.restartFromContext(RegisteredExecutable)helper to restart using an existing executable’s context.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/instances/service/InboundInstancesService.java | Adds resetExecutable(...) service method used by the REST endpoint. |
| connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistryImpl.java | Implements registry-level reset by restarting an executable from its current state/context. |
| connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistry.java | Extends the public registry interface with a reset(ExecutableId) API. |
| connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/BatchExecutableProcessor.java | Adds restart-from-context convenience method used by reset. |
| connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/controller/InboundInstancesRestController.java | Exposes the new reset endpoint under /inbound-instances. |
d4c8e61 to
777586e
Compare
fca2fe5 to
8f4fca1
Compare
…set endpoint
Adds a manual reset capability for inbound connector executables:
- POST /inbound-instances/{type}/executables/{executableId}/reset
- Deactivates the current executable and re-activates it with a fresh
instance while reusing the same context
- Supports Activated and Cancelled states
- Returns the updated ActiveInboundConnectorResponse after reset
- Forwards to the correct runtime instance in multi-instance deployments
Closes #6028
# Conflicts: # bundle/default-bundle/src/test/resources/application-local.properties
8f4fca1 to
5c592e8
Compare
5c592e8 to
1ccf2bb
Compare
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@johnBgood should we be concerned that i can reset without authorization? |
No, currently we only check the org roles: admin, support agent, owner, developer, and operation engineer should have access to all the resources. |
|
okay, and the issue with tye? will you have a seconds look on that? |
|
@Szik I'll change the endpoint, we don't use the type now, only the executableId, as this ID is self-sufficient |
Agent-Logs-Url: https://github.com/camunda/connectors/sessions/330b3d47-05bd-41dc-a7a6-c53ce3f9a1b0 Co-authored-by: johnBgood <1797846+johnBgood@users.noreply.github.com>
31be67a to
d91190f
Compare
|
@Szik I removed the |
|
🎉 This pull request has been included in release Thank you for your contribution! 🚀 |
Description
This pull request introduces several improvements and refactorings to the inbound connector runtime, focusing on making the querying and management of connector executables more flexible and robust. The changes include replacing the immutable
ActiveExecutableQueryrecord with a mutable, builder-style class, updating the query API to use this new approach, and adding the ability to reset (deactivate and reactivate) connector executables via the REST API. Additionally, the handling of connector responses and activity logs has been streamlined and improved.Key changes:
Query API and Filtering Improvements
Replaced the immutable
ActiveExecutableQueryrecord with a mutable class that uses builder-style setters, allowing for more flexible and readable query construction. The query API now accepts a function to configure the query object, enabling more expressive and composable queries. (ActiveExecutableQuery.java,InboundConnectorRestController.java,InboundExecutableQueryService.java) [1] [2] [3] [4]Added support for filtering by
executableIdin queries, improving the precision of executable lookups. (ActiveExecutableQuery.java,InboundExecutableQueryService.java) [1] [2]Executable Lifecycle Management
Added a new REST endpoint to reset (deactivate and reactivate) connector instance executables, enabling runtime recovery and reconfiguration without manual intervention. (
InboundInstancesRestController.java)Refactored the executable activation and deactivation logic: extracted activation into a
doActivatemethod, split out single/batch deactivation, and introduced a robust reset mechanism (restartFromContext) with retry support. (BatchExecutableProcessor.java) [1] [2] [3] [4] [5]Response and Data Handling
Updated the
ActiveInboundConnectorResponseto include alogsfield (collection ofActivity), ensuring activity logs are available in API responses. (ActiveInboundConnectorResponse.java,ConnectorDataMapper.java) [1] [2] [3]Simplified the
ConnectorDataMapperby removing the specialized webhook data mapping logic and always returning all connector-level properties. (ConnectorDataMapper.java)Minor and Supporting Changes
Made
ExecutableId.fromHashedIdpublic to support its use in the new query API. (ExecutableId.java)Updated controller methods to remove unnecessary parameters and align with the new query and service method signatures. (
InboundInstancesRestController.java) [1] [2] [3]These changes collectively improve the maintainability, flexibility, and robustness of the inbound connector management subsystem.
Related issues
closes #6737
Checklist
release, as this branch will be rebased onto main before the next release. Example backport labels:
backport stable/8.8: for changes that should be included in the next 8.8.x release.backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and thisrelease has already been created. The release branch will be merged back into stable/8.8 later, so the change
will be included in future 8.8.x releases as well.