Skip to content

feat: maps service commands from Cumulocity - #4366

Open
rina23q wants to merge 5 commits into
thin-edge:mainfrom
rina23q:feat/c8y-service-commands
Open

rina23q wants to merge 5 commits into
thin-edge:mainfrom
rina23q:feat/c8y-service-commands

Conversation

@rina23q

@rina23q rina23q commented Oct 12, 2026

Copy link
Copy Markdown
Member

Proposed changes

This is part 3 of the service-commands feature. Part 1 was #4308, part 2 was #4338.

This PR does:

  1. maps the cmd/<action> capabilities of a service to the c8y_SupportedServiceCommands fragment, and registers c8y_ServiceCommand as a supported operation of the service.
  2. maps a c8y_ServiceCommand operation to the cmd/<action> command of the service, and reports its status back to Cumulocity.
  3. adds c8y.enable.service_commands to disable the Cumulocity mapping of service commands.
  4. documents the service commands from Cumulocity, in the operate guide and the Cumulocity mapper reference.
  5. adds system tests running service commands from Cumulocity, through the init system and through a service plugin.

This is the last part: service commands now work end to end from Cumulocity.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

#4299: Initial service command feature end-to-end PR
#4242: Issue
#4308: Part 1: tedge service CLI
#4338: Part 2: workflow engine support for service commands

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s. You can activate automatic signing by running just prepare-dev once)
  • I ran just format as mentioned in CODING_GUIDELINES
  • I used just check as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.08824% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/extensions/c8y_mapper_ext/src/service_command.rs 98.31% 10 Missing ⚠️
crates/core/c8y_api/src/json_c8y_deserializer.rs 75.00% 1 Missing ⚠️
crates/extensions/c8y_mapper_ext/src/config.rs 0.00% 1 Missing ⚠️
...per_ext/src/operations/handlers/service_command.rs 96.15% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
1037 0 8 1037 100 3h30m15.766902999s

@reubenmiller reubenmiller added the theme:monitoring Theme: Service monitoring and watchdogs label Oct 12, 2026
@rina23q
rina23q force-pushed the feat/c8y-service-commands branch from fae406c to a89fa71 Compare October 12, 2026 16:08
@rina23q
rina23q deployed to Test Pull Request October 12, 2026 16:08 — with GitHub Actions Active
@rina23q rina23q changed the title feat: maps service commands to Cumulocity feat: maps service commands from Cumulocity Oct 12, 2026
@rina23q
rina23q deployed to Test Auto October 12, 2026 16:19 — with GitHub Actions Active
rina23q and others added 5 commits October 12, 2026 16:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
A `cmd/<action>` capability of a service is published as one entry
of the `c8y_SupportedServiceCommands` fragment of the service,
and registers `c8y_ServiceCommand` as a supported operation of the service.
Clearing the capability topic removes the action from that fragment.

A `c8y_ServiceCommand` operation is mapped to the `cmd/<action>` command of the service,
the action being the lowercased command name.
The operation is failed, and no command published,
when the service has not declared the action
or when the request breaks the naming rules of `tedge service`.
The status of any command of a service is reported as `c8y_ServiceCommand`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…rvice_commands

When `c8y.enable.service_commands` is `false`,
the mapper ignores the `cmd/<action>` capabilities of the services
and the `c8y_ServiceCommand` operations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
@rina23q
rina23q force-pushed the feat/c8y-service-commands branch from a89fa71 to 84bd69f Compare October 12, 2026 16:34
@rina23q
rina23q deployed to Test Pull Request October 12, 2026 16:35 — with GitHub Actions Active
@rina23q
rina23q deployed to Test Auto October 12, 2026 16:45 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
Test Auto — 84bd69f1 Deployed Oct 12, 2026 by rina23q via Test x86_64 #8691
Test Pull Request — 84bd69f1 Deployed Oct 12, 2026 by rina23q via Approve #8691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:monitoring Theme: Service monitoring and watchdogs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants