Skip to content

feat(process-instance): add suspend and resume commands - #585

Open
kristinkomschow wants to merge 1 commit into
mainfrom
claude/camunda-issue-57996-d0ed09
Open

kristinkomschow wants to merge 1 commit into
mainfrom
claude/camunda-issue-57996-d0ed09

Conversation

@kristinkomschow

@kristinkomschow kristinkomschow commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

  • Add c8ctl suspend process-instance <key> and c8ctl resume process-instance <key>
  • Wired through COMMAND_REGISTRY / COMMAND_DISPATCH, calling the SDK's suspendProcessInstance / resumeProcessInstance (POST /process-instances/{key}/suspension and /resumption)
  • README.md and docs/command-reference.md regenerated from the registry (single source of truth)

Version note: this REST endpoint only exists starting with Camunda 8.10 — 8.8/8.9 gateways 404 on it. Documented in .github/SDK_GAPS.md, called out in the command help text ("Camunda 8.10+"), and the live integration tests below are version-gated accordingly.

Closes camunda/camunda#57996

Test plan

  • npm run typecheck
  • npx biome check --fix (clean)
  • npm run check:layering
  • npm run build
  • npm run test:unit (2339/2339 pass)
  • npm test (integration watch.test.ts failures are pre-existing, require a live local cluster, unrelated to this change)
  • Behavioural unit tests for suspend/resume dry-run and missing-key cases
  • Live CLI integration tests (deploy a user-task process, suspend pi, poll get pi --fields state for SUSPENDED, resume pi, poll back to ACTIVE) — verified locally against Camunda 8.10 and 8.9 (confirms the 404 on 8.9), gated to 8.10+ in CI

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Live integration coverage is needed because the current tests never execute either new SDK operation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Adds process-instance suspension and resumption commands through the existing command framework.

Changes:

  • Registers and dispatches suspend and resume.
  • Calls the corresponding SDK operations with dry-run support.
  • Updates generated documentation and behavioural tests.
File Description
src/​commands/​process-instances.ts Implements both handlers.
src/​command-dispatch.ts Wires handlers into dispatch.
src/​framework/​command-registry.ts Declares command metadata.
tests/​unit/​process-instances-behaviour.test.ts Tests dry-run and missing-key paths.
tests/​unit/​command-registry.test.ts Updates registry expectations.
README.md Lists the new verbs.
docs/​command-reference.md Documents command usage.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/commands/process-instances.ts
Comment thread src/commands/process-instances.ts
kristinkomschow added a commit that referenced this pull request Sep 25, 2026
Adds live CLI integration tests exercising suspendProcessInstance and
resumeProcessInstance against a real cluster (deploy a user-task
process, suspend, poll for SUSPENDED, resume, poll for ACTIVE),
addressing Copilot review feedback on #585 that the unit tests never
executed past the dry-run branch.

Found in the process: the REST endpoint only exists starting with
Camunda 8.10 — 8.8/8.9 gateways 404 on POST
/process-instances/{key}/suspension|resumption. Documented in
.github/SDK_GAPS.md and gated the new integration tests with a
CAMUNDA_VERSION skip, mirroring the existing businessIdSkip pattern in
the same file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kristinkomschow
kristinkomschow requested a balanced review from Copilot September 25, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Compatibility documentation and required help/completion and CLI-only integration-test coverage need correction.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (2)
Previously missed (2)

In code that hasn't changed since last review

Low severity Document Camunda 8.10 requirement in help and command references

.github/​SDK_GAPS.md:21

The Camunda 8.10 floor is only recorded in this contributor-facing file. The generated CLI help and public command reference advertise both commands without a version qualifier even though 8.8/8.9 remain supported targets, so users on those versions will encounter an unexplained 404. Add the requirement to both registry descriptions/help texts and regenerate README/docs.

Low severity Add suspend and resume to help and completion test coverage

tests/​unit/​command-registry.test.ts:45

These additions cover registry membership only. The existing help and completion tests explicitly enumerate exposed verbs but still omit suspend and resume, leaving the new generated help/completion entries without regression coverage. Add both verbs to those assertions, including detailed help and the process-instance (pi) <key> shape.

Comment thread tests/integration/process-instances.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Public help omits the 8.10 compatibility floor, and the integration helper introduces a prohibited unchecked assertion.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)
Previously missed (2)

In code that hasn't changed since last review

Low severity Mark command as available only in Camunda 8.10+

src/​framework/​command-registry.ts:1142

The repository supports Camunda 8.8/8.9, but this command is guaranteed to return 404 there, while the generated public help currently presents it without a version constraint. The internal SDK_GAPS.md entry is not user-facing. Add “(Camunda 8.10+)” to this help description, matching the existing Business ID annotations, and regenerate the command reference.

Low severity Mark resume command as available only in Camunda 8.10+

src/​framework/​command-registry.ts:1157

The generated public help also needs to identify resume as Camunda 8.10+; otherwise users of the supported 8.8/8.9 versions are told this command is available even though it always fails with 404. Annotate this help description and regenerate the command reference.

Comment thread tests/integration/process-instances.test.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

User-facing help must disclose that both commands require Camunda 8.10 or newer.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Add Camunda 8.10+ requirement to command help and documentation

src/​framework/​command-registry.ts:1142

This command is unavailable on the supported Camunda 8.8/8.9 clusters, but neither its top-level nor detailed help says so; users discover the limitation only through a gateway 404. Include “Camunda 8.10+” in both descriptions and regenerate README/command-reference, following the existing version annotations in this registry (for example, lines 265 and 315).

This issue also appears on line 1156 of the same file.

@kristinkomschow

Copy link
Copy Markdown
Author

Addressed the "Previously missed" finding from the latest Copilot review overview (Add Camunda 8.10+ requirement to command help and documentation, src/framework/command-registry.ts:1142/1156): both suspend/resume helpDescriptions now say "(Camunda 8.10+)", following the existing "(Camunda 8.9+)" convention used for the businessId flags. docs/command-reference.md regenerated. Pushed in c7cc180.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation is correctly wired, documented, version-gated, and covered by behavioral and integration tests.

Review effort: Balanced
Findings: None

Adds `c8ctl suspend process-instance <key>` and `c8ctl resume
process-instance <key>`, wired through the command registry and
dispatch map, calling the SDK's suspendProcessInstance /
resumeProcessInstance methods (POST /process-instances/{key}/suspension
and /resumption).

The REST endpoint only exists starting with Camunda 8.10 — 8.8/8.9
gateways 404 on this path. Documented in .github/SDK_GAPS.md, noted in
the command help text ("Camunda 8.10+"), and the live integration
tests are version-gated accordingly.

Covered by:
- behavioural unit tests (dry-run + missing-key cases)
- live CLI integration tests (deploy a user-task process, suspend,
  poll for SUSPENDED via `get pi`, resume, poll for ACTIVE), gated to
  Camunda 8.10+

README.md and docs/command-reference.md regenerated from the registry.

Closes camunda/camunda#57996

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kristinkomschow
kristinkomschow force-pushed the claude/camunda-issue-57996-d0ed09 branch from c7cc180 to 6eb7e3d Compare September 28, 2026 11:29
@kristinkomschow
kristinkomschow marked this pull request as ready for review September 28, 2026 11:43
@kristinkomschow

Copy link
Copy Markdown
Author

@jwulf I'm unsure who to request review from for this. I see that c8ctl ownership was moved to clients-sdks-ai-first-tooling (?) but I don't seem to be able to add that group as reviewer.

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.

Support suspend/resume commands in c8ctl

2 participants