Skip to content

Conversation

@jarhodes314
Copy link
Contributor

@jarhodes314 jarhodes314 commented Dec 18, 2025

Proposed changes

Add a migration tool for converting tedge.toml based configs to separate mapper configs.

To use the tool, run tedge-mapper migrate-config c8y (or with the cloud of your choosing).

TODO:

  • System tests for the separate mapper config functionality
  • Add line to tedge connect summary showing where the mapper is configured
  • Ensure there is a mechanism for changing the default mapper config location for new users
  • Ensure we are happy with tedge connect config summary showing the feature/temporarily hide it if not

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


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

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 89.39394% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...common/tedge_config/src/tedge_toml/tedge_config.rs 27.27% 8 Missing ⚠️
crates/core/tedge_mapper/src/lib.rs 0.00% 8 Missing ⚠️
crates/core/tedge/src/cli/log.rs 0.00% 3 Missing ⚠️
...dge_config/src/tedge_toml/tedge_config_location.rs 99.11% 0 Missing and 1 partial ⚠️
crates/core/tedge/src/cli/connect/command.rs 0.00% 1 Missing ⚠️

📢 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 Dec 18, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
785 0 4 785 100 2h34m54.624836s

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

tedge-mapper migrate-config is nicely working, including for cloud profile.

It could be improved a bit to be more explicit when no config is to be migrated (because not set or already migrated).

Comment on lines +122 to +125
#[clap(hide = true)]
MigrateConfig {
cloud_name: CloudType,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use a hidden command for this migration tool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the moment, I didn't want to expose the details for undocumented features, particularly one where the user has nothing obvious to gain by using the feature

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@jarhodes314 jarhodes314 requested a review from a team as a code owner December 19, 2025 15:07
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

The code is clear and the tests comprehensive. There are still some open UX questions, though.

I don't think we need to "Ensure there is a mechanism for changing the default mapper config location for new users" in this PR. We can make the new mapper schema the default, when the feature and the documentation will be complete.

I like that tedge connect displays the path to the mapper configuration file. This is not a problem to have a constant path when the config has not been migrated. This will even be handy to support users during the transition phase.

I noticed that now tedge config set remove unknown properties, while this was not the case before #3889. I'm okay with that, as I don't think it was a documented behavior, but it would be good to consider restoring the former behavior.

@jarhodes314
Copy link
Contributor Author

I noticed that now tedge config set remove unknown properties, while this was not the case before #3889. I'm okay with that, as I don't think it was a documented behavior, but it would be good to consider restoring the former behavior.

I believe this is the existing behaviour for tedge.toml even though it is new for the mapper toml files. Since pretty much no users edit these files directly, I don't think this matters.

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@jarhodes314 jarhodes314 force-pushed the feat/mapper-config-migration-tool branch from f324ec4 to ac295bd Compare January 5, 2026 12:22
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.

2 participants