-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add #[derive(Document)] to TEdgeConfigDto and replace FilePath with camino::Utf8PathBuf #1867
Conversation
7184ced
to
b5b824f
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.
Some minor comments.
The output is not consistent regarding the separator between doc and example: some entries are missing a dot, others a space, some both:
$ tedge config list --doc
device.type The default device type. Example: thin-edge.io
http.address Http client address, which is used by the File Transfer ServiceExample: 127.0.0.1, 192.168.1.2
mqtt.client.host Mqtt broker address, which is used by the mqtt clients to publish or subscribe.Example: 127.0.0.1
...
crates/common/tedge_config/src/tedge_config_cli/models/connect_url.rs
Outdated
Show resolved
Hide resolved
// TODO improve these examples | ||
#[doku(example = "template1")] | ||
#[doku(example = "template2")] | ||
/// Set of c8y templates used for subscriptions | ||
pub(crate) smartrest_templates: Option<TemplatesSet>, |
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.
Rather than the examples, I think what needs to be improved is the field documentation. These are not templates but template names and they must be defined on c8y.
Also, from the examples, it's not clear how one can set a list of template names. As far I understand doku
these two examples are independent as those given for the bind_address
. I would expect a sample that is actually a set.
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.
Yeah, the doku example is a bit weird, but this does translate to a list when generating the documentation.
…amino::Utf8PathBuf Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
b5b824f
to
954e933
Compare
At the moment, that is still using the existing implementation, although I plan to start working on changing that next. |
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.
Approved
954e933
to
cb0cc99
Compare
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
650ff44
to
1814453
Compare
Robot Results
Passed Tests
|
Signed-off-by: James Rhodes <jarhodes314@gmail.com>
Proposed changes
This is the first batch of changes for #1812. It adds documentation to the
TEdgeConfigDto
struct via doku. It also replacesFilePath
withcamino::Utf8Path
for a few reasons:TEdgeConfigDto
will become more visible as part of later changes.to_str()
or storing them asString
s when we need to display them (e.g. writing to mosquitto configuration)From that, I believe camino is a good fit for our use case. I've not propagated the changes beyond a few crates, but I think I've covered the major interactions with tedge_config.
Types of changes
Paste Link to the issue
#1812
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINES