Skip to content

refactor: reduce the number of times we read tedge.toml#3625

Merged
jarhodes314 merged 4 commits intothin-edge:mainfrom
jarhodes314:refactor/tedge-config-location
May 19, 2025
Merged

refactor: reduce the number of times we read tedge.toml#3625
jarhodes314 merged 4 commits intothin-edge:mainfrom
jarhodes314:refactor/tedge-config-location

Conversation

@jarhodes314
Copy link
Copy Markdown
Contributor

@jarhodes314 jarhodes314 commented May 15, 2025

Proposed changes

  • Store TEdgeConfigLocation inside TEdgeConfig so we avoid passing TEdgeConfigLocation around. As a result, read TEdgeConfig only where necessary
  • Simplify the many interfaces to TEdgeConfigLocation/TEdgeConfig, lots of duplicate ways to do thing
  • Refactor update_toml to be a consuming method on TEdgeConfig, so the outdated configuration definitely gets disposed of?

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

@codecov
Copy link
Copy Markdown

codecov bot commented May 15, 2025

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 16, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
633 0 3 633 100 1h47m26.264328999s

@jarhodes314 jarhodes314 marked this pull request as ready for review May 16, 2025 15:30
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 16, 2025 15:35 — with GitHub Actions Inactive
@didier-wenzek didier-wenzek temporarily deployed to Test Pull Request May 16, 2025 16:57 — with GitHub Actions Inactive
Copy link
Copy Markdown
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. Thank you very much for this refactoring which completely removes unnecessary abstractions for accessing the config directory and the config directory.

@reubenmiller reubenmiller added the refactoring Developer value label May 19, 2025
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
…ad the config

Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
@jarhodes314 jarhodes314 force-pushed the refactor/tedge-config-location branch from 3d32c78 to 7bf4846 Compare May 19, 2025 09:18
@jarhodes314 jarhodes314 temporarily deployed to Test Pull Request May 19, 2025 09:18 — with GitHub Actions Inactive
Copy link
Copy Markdown
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.

I just wanted to check out the new tedge_config API. It really simplifies the code, a nice improvement! 👍

@jarhodes314 jarhodes314 added this pull request to the merge queue May 19, 2025
Merged via the queue into thin-edge:main with commit dbfad46 May 19, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Developer value

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants