-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate old TEdgeConfig #2143
Deprecate old TEdgeConfig #2143
Conversation
Robot Results
|
Codecov Report
Additional details and impacted files
|
pub use self::tedge_config_cli::tedge_config::*; | ||
pub use self::tedge_config_cli::tedge_config_defaults::*; | ||
pub use self::tedge_config_cli::tedge_config_location::*; | ||
pub use self::tedge_config_cli::tedge_config_repository::*; | ||
pub use camino::Utf8Path as Path; | ||
pub use camino::Utf8PathBuf as PathBuf; | ||
pub use certificate::CertificateError; | ||
|
||
/// loads the new tedge config from system default | ||
pub fn get_new_tedge_config() -> Result<TEdgeConfig, TEdgeConfigError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be deprecated as using a default location.
This is used in a single place: crates/core/tedge/src/cli/certificate/upload.rs
.
I will fix that in a follow-up PR.
pub struct TEdgeConfigRepository { | ||
config_location: TEdgeConfigLocation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no more points to have a struct TEdgeConfigRepository
as this is now just a TEdgeConfigLocation
with a load()
method.
I will fix that in a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how many times the load()
method is called (24 times in 23 files), we probably have multiple copies of TEdgeConfig
per process. We could lazily initialize it and only return a reference to the single instance. The struct is not very large, so it's not a big problem, but perhaps this will be easier to do sooner rather than later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how many times the
load()
method is called (24 times in 23 files), we probably have multiple copies ofTEdgeConfig
per process. We could lazily initialize it and only return a reference to the single instance. The struct is not very large, so it's not a big problem, but perhaps this will be easier to do sooner rather than later.
Added to #2153
@didier-wenzek you'll have to rebase from main to fix the workflow failures (due to the changes introduced in #2138) |
730faa7
to
8fd2026
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the remaining defaults not be removed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed.
- The first 3 are no more used => removed
- The two latter are related to the file-transfer service => moved them to
tedge_api
.
pub struct TEdgeConfigRepository { | ||
config_location: TEdgeConfigLocation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how many times the load()
method is called (24 times in 23 files), we probably have multiple copies of TEdgeConfig
per process. We could lazily initialize it and only return a reference to the single instance. The struct is not very large, so it's not a big problem, but perhaps this will be easier to do sooner rather than later.
One has to use new::TEdgeConfig::mqtt_config. Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
9b9c474
to
3fc6e72
Compare
Proposed changes
TEdgeConfig
new::TEdgeConfig
asTEdgeConfig
Types of changes
Paste Link to the issue
#2019
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments