-
Notifications
You must be signed in to change notification settings - Fork 43
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
[#432] Implement CLI iox2-config #468
base: main
Are you sure you want to change the base?
[#432] Implement CLI iox2-config #468
Conversation
@brosier01 don't close it - it looked good! |
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.
In general looks pretty good, just one real blocker re: config location and also you'll need to address the static analysis CI findings.
Thanks for getting involved and welcome!
ff8654f
to
973c574
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.
I tested the CLI on the different platforms. A few more things to resolve before it can be merged.
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.
The generated configs are now being used and there is a confirmation message for overwriting a pre-existing generated config - nice.
Some more things left to address, see unresolved threads.
e7798a3
to
037781e
Compare
Hi @orecham @elfenpiff, is there any way to run CI locally? |
037781e
to
82f5387
Compare
@brosier01 Yes there is. You can use the When you entered it you can run the usual cargo commands. Under |
08a4135
to
41d20b8
Compare
Hi @orecham, I think I've implemented all the elements described in the original problem. Do you see any other features I need to work on ? |
@brosier01 I will be able to review sometime today or tomorrow, apologies for the delay. |
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.
Sorry for taking so long to get back to you on this - had too much on my plate the last few weeks. I should be more responsive from now though.
PR is almost done! Can be merged after:
- Rebasing on
main
- Addressing the remaining open conversations (I have resolved all not relevant for this PR)
@brosier01 Back to you. |
41d20b8
to
bd3e3d2
Compare
Some conflicts need resolving: Also, these duplicate commits should be squashed into single commits. |
Co-authored-by: orecham <[email protected]>
…rm coloring + implementation of user confirmation required before deleting current configuration file
d28c6fb
to
613a2e0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #468 +/- ##
==========================================
+ Coverage 79.25% 79.49% +0.23%
==========================================
Files 203 205 +2
Lines 25230 25179 -51
==========================================
+ Hits 19995 20015 +20
+ Misses 5235 5164 -71
|
613a2e0
to
836b7c4
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.
I need to review the last 3 files but I left some comments. The review of the next 3 files will follow soon.
NOTE: Add new entries sorted by issue number to minimize the possibility of | ||
conflicts when merging. | ||
--> | ||
Create a new CLI for iceoryx2 `iox2-config` |
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.
Please summarize everything into one sentence and put everything in one bullet point as you did in line 15. If someone is interested in the details, they can follow the provided issue link.
--> | ||
|
||
* Example text [#1](https://github.com/eclipse-iceoryx/iceoryx2/issues/1) | ||
Remove the `print_system_configuration()` function in |
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.
Please put everything into one bullet point.
|
||
1. Example | ||
iox2 config show system |
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 you put every command into an
```sh
```
environment and explain with one sentence what it does.
iceoryx2-cal/Cargo.toml
Outdated
@@ -26,6 +26,7 @@ iceoryx2-bb-memory = { workspace = true } | |||
iceoryx2-bb-lock-free = { workspace = true } | |||
iceoryx2-pal-concurrency-sync = { workspace = true } | |||
|
|||
dirs = { workspace = true } |
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.
Please remove this and the config_path
component from iceoryx2_cal
. This is not a iceoryx2 concept. The mistake is on our side since we did not yet had the time to document the iceoryx2 concept pattern in detail, what it is, what problem it solves and how it shall be implemented.
A concept is an abstract mechanism:
- That has multiple implementations.
- Can be constructed and used via the traits of the concepts
- Comes with a generic test suite to verify the same behavior of all concept implementations.
One example is the communication channel.
- it has a receiver and a sender
- it comes with a builder trait
- the sender sends data, the receiver receives data
- it can be implemented by a UNIX domain socket, message queue, named pipe or a shared memory queue
- it comes with a test suite that verifies that the sent data can be retrieved with the corresponding receiver.
I agree that you require a way of acquiring the config directory and your approach seems valid but this should be part of the iceoryx2/src/config.rs
iceoryx2-cal/src/config_path/dirs.rs
Outdated
@@ -0,0 +1,29 @@ | |||
// Copyright (c) 2024 Contributors to the Eclipse Foundation |
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.
Please remove this
iceoryx2-cal/src/config_path/mod.rs
Outdated
@@ -0,0 +1,22 @@ | |||
// Copyright (c) 2024 Contributors to the Eclipse Foundation |
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.
Please remove this
836b7c4
to
92982fb
Compare
… subcommand to display the contents of the configuration file + added configuration file standard location
92982fb
to
c66b7d9
Compare
Err(ConfigCreationError::FailedToReadConfigFileContents) => { | ||
warn!(from "Config::global_config()", "Default config file found but unable to read content, populate config with default values."); | ||
ICEORYX2_CONFIG.set_value(Config::default()); | ||
match config_dir() { |
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.
I took a deep dive into the dirs
crate and the config_dir
function and I realized that it depends on dirs-rs which requires a $HOME
env variable that is available on linux and some unix systems - not Windows. But we must have a solution that is extendable to other platforms and works out of the box on Linux, Windows, Mac OS and FreeBSD.
So the best solution would be to add this functionality to the iceoryx2_pal
layer. I will take care of this in the next days and make it available to you.
We have to be careful with introducing new dependencies to iceoryx2. They must work on all our target platforms and we also need to have a strategy on how to handle software certification later.
But please do not let this discourage you! You did a great job with the CLI so far and the crate-dependency thing was also nowhere documented (so its on me). I'll try to add this to the platform and then we can merge this hopefully latest next week.
Notes for Reviewer
Pre-Review Checklist for the PR Author
SPDX-License-Identifier: Apache-2.0 OR MIT
iox2-123-introduce-posix-ipc-example
)[#123] Add posix ipc example
)Tests follow the best practice for testingtask-list-completed
)Checklist for the PR Reviewer
Unit tests have been written for new behaviorPost-review Checklist for the PR Author
References
Relates to #432