-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: reuse existing chain spec #351
Conversation
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.
Nice work! This definitely improves the DevEx.
The integration test is currently failing, see my comment for a way to test it without waiting for the full test to finish. Additionally, cargo test --doc
needs to be fixed too after your changes.
The rest are minor comments to address and a few suggestions for improvement.
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.
Love the flow, and it's great having the possibility of creating and modifying existing specs!
There's a few nits that need revisiting, but it's looking great!
@Daanvdplas thanks for the addressing the feedback! This is great! I yet have a comment on fix: prepare_output_path. I believe we are deviating on how we treat the input provided in
Whatever the user inputs should be the name of the file, I don't think we only need to consider the input as a file if it has the |
Imo it is a simple rule to follow, end your preferred name with |
chore: refactor prepare_output_path
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.
LGTM!
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.
Nice to see the unit tests in thepop-cli
crate.
Just one little point before merge it. If I run cargo +nightly clippy
I see a couple of warnings that can be fixed, or the CI will complain when point to main
.
Allow to provide an existing chain spec file for the
chain
flag. I aimed for flexibility and a clear flow in the code so that it is easily adaptable for future requirements.Added an additional
BuildSpec
struct to separate the flow between getting the users input and secondary input (prompts), and generating the files with the provided options. This also allowed to not have to worry about theOption
fields in theBuildSpecCmd
which complicated the code.If the user provides a chain spec file and it does not want to make changes to it (user is prompted whether it wants this), and e.g. the para id is not present in the file, a default value is used. No warning has been added as the chance of this happening is very small. Either due to a user mistake by manually removing it or a chain spec file is provided that is created without the pop cli which could cause to have no para id present. There will always be a para id in a chain spec file if it is created with the pop cli. This example counts for all the other
Option
fields in theBuildSpecCmd
.No tests have been written yet due to time and can be done if required
The build profile will be added as a separate PR after this is merged.