Skip to content

Conversation

@reubenmiller
Copy link
Contributor

Proposed changes

Support new tedge configuration (c8y.enable.device_restart) to disable the handling of the the c8y_Restart operation from Cumulocity.

Other Cumulocity cloud operations already support this mechanism, so the PR just aligns the c8y_Restart with the other cloud operation handlers.

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

#3939

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

Comment on lines +703 to +705
/// Enable device restart feature
#[tedge_config(example = "true", default(value = true))]
device_restart: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure whether we should use device_restart or just restart. I opted for a more explicit approach given that some time in the future we'll probably have a "service_restart" command.

@reubenmiller reubenmiller added the theme:troubleshooting Theme: Troubleshooting and remote control label Jan 26, 2026
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/extensions/c8y_mapper_ext/src/converter.rs 37.50% 4 Missing and 1 partial ⚠️
crates/extensions/c8y_mapper_ext/src/config.rs 0.00% 1 Missing ⚠️
...xtensions/c8y_mapper_ext/src/operations/handler.rs 83.33% 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
Copy link
Contributor

github-actions bot commented Jan 26, 2026

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
823 0 3 823 100 2h50m54.745683s

@reubenmiller reubenmiller force-pushed the feat-disable-cloud-restart-option branch from d69a5a2 to 9894711 Compare January 26, 2026 11:54
Comment on lines +36 to +37
Execute Command tedge config set c8y.enable.device_restart false
Execute Command rm -f /etc/tedge/operations/c8y/c8y_Restart
Copy link
Contributor

Choose a reason for hiding this comment

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

Does a user need to do both these actions to disable the operation, or is deleting the file just done so we can verify it doesn't reappear after restarting the mapper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I think the file still needs to be deleted if the tedge-mapper-c8y service has already been started (with the setting on)...though I didn't verify this, so maybe I'm wrong.

Copy link
Contributor Author

@reubenmiller reubenmiller Jan 27, 2026

Choose a reason for hiding this comment

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

I just confirmed that once the c8y_Restart file is created, then the user has to manually remove it as disabling the feature does not affect the supported operations list that is sent to Cumulocity. However the mapper won't react to the operation if it is sent to the cloud.

We could delete the operation if present on startup though. Previously we avoided this as we thought that people might want to customize the operation handler (e.g. create the file themselves), however I don't think anyone is doing this now that we can customize the tedge-agent workflows instead.

The code shows that there is only an "add_operation" function, and nothing to remove an already existing one.

pub async fn add_operation(

Copy link
Contributor

@albinsuresh albinsuresh left a comment

Choose a reason for hiding this comment

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

LGTM. For the sake of completeness, shouldn't we do the same for software update operation as well?

Copy link
Member

@rina23q rina23q left a comment

Choose a reason for hiding this comment

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

Looks good. I just found a trivial thing that can be better.

@reubenmiller reubenmiller force-pushed the feat-disable-cloud-restart-option branch from 53259f7 to 9b8eaac Compare January 27, 2026 11:13
@reubenmiller reubenmiller added this pull request to the merge queue Jan 27, 2026
Merged via the queue into thin-edge:main with commit 38564a3 Jan 27, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:troubleshooting Theme: Troubleshooting and remote control

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants