-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: autogenerate bash completion #25243
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
Conversation
Thanks for picking this up. Did you re-use any code from #18606? A lot of the changes are very similar to the changes there, except for different whitespace, class names, copyright dates etc. If so, cherry-picking so that the original author is preserved is appropriate. |
1e67d08
to
2c10b6d
Compare
380c7f4
to
d0c2140
Compare
Concept ACK on auto-generating what can be auto-generated. I'm not entirely sure about the approach of making this a functional test. It's clever, but also different from how other auto-generated files (the manual pages, the example bitcoin.conf introduced in #22235) are handled in the release process. On the other hand by adding the check this forces the file on the branch to always be up-to-date so it doesn't need to be in the release process. That's also something. |
d79fe4a
to
784c4e5
Compare
Look at #17289 (comment) |
Yeah, I wrote that comment before bitcoin.conf moved over to auto-generation. A functional test is one way to achieve this, but this can also be achieved by an auto-generation script at release time. |
I mean you can argue this is a better solution, and that we should move to this for all three. |
From linter:
|
Thanks for the review @laanwj! Just wondering, do the three of them have to be done the same way? I don't know how I would do it the same way it was done in #22235. |
c97d573
to
a8e6ab5
Compare
Squashed commits. |
f9d7f57
to
5f3ba0e
Compare
Not necessarily, but some structure/standardization around release processes makes it harder to forget any steps, than if everything needs to be done in a different way. |
If we're not careful, it could also increase the rate of diff conflicts (and/or silent merge bugs?). |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
Hi everyone, I have a questions / suggestion:
I believe the object of this issue was to keep the bash files up to date, but this PR only adds a test to check for the file, or optionally update it. Is there something that can be done to make sure that the file is updated or generated on every compile, perhaps by modifying the Makefile to run this test everytime? In that case, I believe that the "--overwrite" option should be the default.
Closed and reopened to hopefully trigger CI |
@achow101 Any idea why CI is not running on this PR? |
Rebasing may help. While you are at it, you can also squash your commits. |
Triggered CI |
54d06dd
to
0cf4fd4
Compare
Add a functional test which parses available RPC commands, generates the associated bitcoin-cli autocomplete file and checks that the current autocomplete file matches. An outdated autocomplete file can be updated via the --overwrite test parameter. test: keeps bitcoin-cli autocomplete in sync Add a functional test which parses available RPC commands, generates the associated bitcoin-cli autocomplete file and checks that the current autocomplete file matches. An outdated autocomplete file can be updated via the --overwrite test parameter. rpc: add format command with support for args_cli - add format command to get infos about commands via a particular format - add output format args_cli to get arguments type info of shown commands - refactor RPCArg::ToTypeString to be used accross multiple output formats - overload CRPCTable::execute to call != methods than in their request
test: keeps bitcoin-cli autocomplete in sync fixed linter error added bash-completion to makefile fixed typo autogenerate bash completion autogenerate bash completion added tool_bash_completion.py to test_runner.py added format RPC fixed typo added python functional test test: keeps bitcoin-cli autocomplete in sync Add a functional test which parses available RPC commands, generates the associated bitcoin-cli autocomplete file and checks that the current autocomplete file matches. An outdated autocomplete file can be updated via the --overwrite test parameter. rpc: add format command with support for args_cli - add format command to get infos about commands via a particular format - add output format args_cli to get arguments type info of shown commands - refactor RPCArg::ToTypeString to be used accross multiple output formats - overload CRPCTable::execute to call != methods than in their request removed duplicates removed unnecessary change
5d7224d
to
f8858f7
Compare
🐙 This pull request conflicts with the target branch and needs rebase. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Are you still working on this? |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Added a functional test which parses all the RPC help commands then automatically generates the bitcoin-cli bash-completion file and makes sure that the original file matches the newly generated one.
In order to get the RPC help commands in the correct format needed for the test, I added the "format" RPC command.
Test using
python3 test/functional/tool_cli_completion.py --overwrite