Skip to content

Conversation

jarhodes314
Copy link
Contributor

@jarhodes314 jarhodes314 commented Mar 21, 2025

Proposed changes

Allow a configuration to be reset to the default by passing an environment variable value of '' (an empty string). Previously, to "undo" the effects of setting a TEDGE_ variable for configuration (so you can use the default value), you would need to unset the value

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

Copy link

codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ates/common/tedge_config/src/tedge_toml/figment.rs 87.09% 0 Missing and 4 partials ⚠️

📢 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.

Copy link
Contributor

github-actions bot commented Mar 21, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
599 0 3 599 100 1h41m26.978551999s

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.

Approved

Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

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

Works nicely, and solves the linked ticket.

Simple example showing that the user can ignore the environment variable by setting it to an empty value.

export TEDGE_MQTT_CLIENT_HOST=tedge
TEDGE_MQTT_CLIENT_HOST= tedge mqtt sub '#' --log-level info >/dev/null
2025-03-21T14:19:41.831241Z  INFO MQTT: Connecting to broker: host=127.0.0.1:2883, session_name=Some("tedge-sub-50652")

@jarhodes314 jarhodes314 added this pull request to the merge queue Mar 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 21, 2025
@jarhodes314 jarhodes314 added this pull request to the merge queue Mar 21, 2025
Merged via the queue into thin-edge:main with commit 7ab3b29 Mar 21, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:configuration Theme: Configuration management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants