Skip to content
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

Generate CLI docs #6145

Merged
merged 6 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,18 @@ jobs:
- run:
command: "! go fmt ./... 2>&1 | read"

cbor-gen-check:
gen-check:
executor: golang
steps:
- install-deps
- prepare
- run: make deps
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make type-gen
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet

Expand Down Expand Up @@ -701,7 +704,7 @@ workflows:
concurrency: "16" # expend all docker 2xlarge CPUs.
- mod-tidy-check
- gofmt
- cbor-gen-check
- gen-check
- docs-check
- test:
codecov-upload: true
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,13 @@ docsgen-openrpc-worker: docsgen-openrpc-bin
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin

gen: type-gen method-gen docsgen api-gen
@echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is doscgen-cli slow? Why not just always run it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not in gen because I'm not sure how to force make to execute one target after another when running in parallel without making one target depend on another - docsgen-cli depends on lotus binaries, which can't build if we're in the middle of generating api code, but we don't want the lotus build to depend on gen

.PHONY: gen

# separate from gen because it needs binaries
docsgen-cli: lotus lotus-miner lotus-worker
python ./scripts/generate-lotus-cli.py
.PHONY: docsgen-cli

print-%:
@echo $*=$($*)
6 changes: 6 additions & 0 deletions build/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package build

import "os"

var CurrentCommit string
var BuildType int

Expand Down Expand Up @@ -32,5 +34,9 @@ func buildType() string {
const BuildVersion = "1.11.0-dev"

func UserVersion() string {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
return BuildVersion
}

return BuildVersion + buildType() + CurrentCommit
}
Loading