-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
doc: book cli updater #3576
doc: book cli updater #3576
Conversation
|
||
.PHONY: update-book-cli | ||
update-book-cli: ## Update book cli documentation. | ||
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)" |
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.
Unsure about this command but the idea is to build the code
```bash | ||
$ reth stage --help | ||
|
||
Usage: reth db <COMMAND> |
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.
It also helps to avoid manual errors :)
3eedbb3
to
5708a10
Compare
.github/workflows/book.yml
Outdated
@@ -7,6 +7,25 @@ on: | |||
merge_group: | |||
|
|||
jobs: | |||
up-to-date: |
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.
It might not be the best place to add this CI job because it can't be canceled when a new commit is pushed and since it's a quite long-running job (because of the build part), it may be useful to be able to cancel in progress jobs. Feel free to move it where you want :)
Codecov Report
see 153 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
.github/workflows/book.yml
Outdated
@@ -15,7 +15,7 @@ jobs: | |||
- uses: actions/checkout@v3 | |||
|
|||
- name: Try to update the book cli documentation | |||
run: make update-book-cli | |||
run: BUILD_PATH=/home/runner/work/reth/target && make update-book-cli |
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.
should we use ./reth/target
instead?
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.
Trying rn 👍
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.
overall this is ok to me as a first step, but iirc there is a better way to do this using clap, but I forget how - it should be possible for clap to generate manpages or something similar, and we could turn this into markdown
Interesting, I'm still very new to Rust. I can take a look and implement something better! :) |
@leovct It might be possible to create a new binary under This is a bit more advanced, but the idea basically fits what an This is just an idea for an improvement btw, we can stil merge this an you are free to iterate on it :) |
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.
Needs an adjustment in the update.sh
script to work on Linux (didn't spot it before)
I really like this idea, this is powerful. I'll try to get more familiar with |
Head branch was pushed to by a user without write access
I can't figure how to solve the issue of the |
While working on #3309, I noticed that the book cli documentation is not up to date. We should advocate for software automation to handle the task of updating the book instead of relying on manual efforts.
I suggest a simple bash script tied to the Makefile that will run in CI to check if the book is properly updated given the latest changes. Anyone can run the script locally (just like a linter) to update the book cli doc using
make update-book-cli
.The script updates every file under
book/cli
such ascli.md
and reth commands and subcommands likeconfig.md
,db.md
, etc. It uses a configuration fileconfig.json
to keep track of which commands, subcommands and subsubcommands to include in the book. It's important to note that if someone introduces a new command or subcommand, the script won't be aware of it and we still need to include it manually but it helps in updating the commands and subcommands already referenced in the book.