-
Notifications
You must be signed in to change notification settings - Fork 97
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
Move common arguments to their own structure #2449
Conversation
This will allow us to reuse them in subcommands
- Move common arguments to a new file and introduce a validation trait. - Move assess argument logic to the args module
Question 1: This change is a simple refactor to put all the args into two structures, one for common ones (Which will be used by the subcommands) and one structure for the verification related arguments, am i understanding that correct? Question 2: The plan to have two subcommands (assess and concrete-playback) and one default one for verify after this PR, is that correct? That makes sense. Does this also mean that running concrete-playback, will block the verification flow and just print the unit test after the coming PR? Question 3: I didn't understand the motivation behind removing --dry-run in the test case. Is it because you moved it into the ValidateArgs and so dry-run doesn't work now as expected, but it will with the upcoming 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.
Looks like a re organization, so I'm approving with a few questions. Thanks!
Great question! The test at hand had two errors:
Before this change, we checked # 1 first, then we checked # 2. With this change, the order has changed, and the test was failing now because of # 2. So I removed the |
Yes! I was thinking that we could even add a subcommand
Oh, I guess you already answered the first question here. 😉 So the testcase generation won't change, and it will still be part of the "verify" subcommand. The new
Per my previous answer, |
Description of changes:
This is a pre-work needed for implementing #2440 as a subcommand. Today, the only other subcommand we have is
assess
and the way it takes arguments is rather broken as explained in #1831.For the playback sub-command, I expect that we will need at least CargoArgs and CommonArgs to control the build process and to control the process verbosity.
We would probably benefit from properly isolating the build arguments, and not allowing arguments when subcommands are provided, but that will be a problem for another day since it will require changes to assess logic and Kani sesssion. I am hoping this will be enough for a first working version of the playback subcommand (famous last words... 🙂).
Resolved issues:
Related to #2440
Related RFC:
Call-outs:
I created an
args/
folder for all argument related logic because I believe it will be easier to maintain and it creates a better separation of responsibility and cleaner dependency tree (i.e.: args module no longer depends on assess module).Update: I'll probably need to create one more PR that enables args_conflicts_with_subcommands to fix the issue with the argument position.
Testing:
How is this change tested?
Is this a refactor change?
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.