-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Run check in CI for generated docs #783
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
The docs were out of date.
--logtostderr log to standard error instead of files (default true) | ||
--metric-blacklist string Comma-separated list of metrics not to be enabled. The whitelist and blacklist are mutually exclusive. | ||
--metric-whitelist string Comma-separated list of metrics to be exposed. The whitelist and blacklist are mutually exclusive. | ||
--namespace string Comma-separated list of namespaces to be enabled. Defaults to "" | ||
--port int Port to expose metrics on. (default 80) | ||
--skip_headers If true, avoid header prefixes in the log messages | ||
--stderrthreshold severity logs at or above this threshold go to stderr | ||
--skip_log_headers If true, avoid headers when openning log files |
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.
--skip_log_headers If true, avoid headers when openning log files | |
--skip_log_headers If true, avoid headers when opening log files. |
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.
Ah I see, it (make generate) was using the latest release, instead of master, let me fix this!
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.
@tariq1890 Actually! I take that back, it's correct, it comes from klog, it's a typo there. If you do kube-state-metrics --help
you will see it there :)
So if we want to use the make generate
to update these docs, we need to keep it as is.
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.
See kubernetes/klog#62 :)
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.
Thanks !
--logtostderr log to standard error instead of files (default true) | ||
--metric-blacklist string Comma-separated list of metrics not to be enabled. The whitelist and blacklist are mutually exclusive. | ||
--metric-whitelist string Comma-separated list of metrics to be exposed. The whitelist and blacklist are mutually exclusive. | ||
--namespace string Comma-separated list of namespaces to be enabled. Defaults to "" | ||
--port int Port to expose metrics on. (default 80) | ||
--skip_headers If true, avoid header prefixes in the log messages | ||
--stderrthreshold severity logs at or above this threshold go to stderr | ||
--skip_log_headers If true, avoid headers when openning log files | ||
--stderrthreshold severity logs at or above this threshold go to stderr (default 2) |
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.
--stderrthreshold severity logs at or above this threshold go to stderr (default 2) | |
--stderrthreshold severity logs at or above this threshold go to stderr (default 2). |
| kube_hpa_labels | Gauge | `hpa`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE | |
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.
I am not able to determine what this change exactly is.
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.
Think it's a space, but these docs are generated so it's correct. :)
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.
Cool! Thanks
Makefile
Outdated
@@ -122,7 +124,7 @@ generate: build-local embedmd | |||
@$(GOPATH)/bin/embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print` | |||
|
|||
embedmd: | |||
go get github.com/campoy/[email protected] | |||
GO111MODULE=on go get github.com/campoy/[email protected] |
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.
I am not sure if this is desirable. This changes the go mod
artifacts and will affect the go mod verify
checks in the CI.
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.
Yep you are right. But otherwise, go get fails.
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.
I am not sure we want to add this @go mod tidy
to the doccheck
target. Can we try this with GO111MODULE=off
instead? I don't see why this needs to be added to the go mod
artifacts, assuming we are using embdedmd
as a a CLI convenience in CI.
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.
Interestingly enough with "off" hit this problem locally: cannot use path@version syntax in GOPATH mode
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.
But I agree that was a hack, doing go mod tidy, I am sure there is a better way! :)
7f915a7
to
ee2efae
Compare
@@ -122,7 +124,7 @@ generate: build-local embedmd | |||
@$(GOPATH)/bin/embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print` | |||
|
|||
embedmd: | |||
go get github.com/campoy/embedmd@v1.0.0 | |||
GO111MODULE=off go get github.com/campoy/embedmd |
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.
Yup I was going to suggest this. This go mod
limitation is very annoying. You can see what the prometheus team had to do in order to get around this issue:
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.
^ That's just an FYI btw. I am definitely okay with go getting the embedmd without the versionedPath. Hopefully it works :)
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.
That looks interesting 😄
I removed the version restrain, test pass now, tbh the embedmd project does not change much. But up to you?
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.
Fine by me.
Makefile
Outdated
doccheck: | ||
doccheck: generate | ||
@echo "- Checking if the generated documentation is up to date..." | ||
@git diff --exit-code -- | ||
@echo "- Checking if the documentation is 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.
Can we change this to something like Checking if the documentation is in sync with the code"
? Do you agree that this would perhaps add more clarity on what's going on ?
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.
Makes sense, done ✔️
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.
Whoops, I actually meant changing this "- Checking if the documentation is up to date..."
to "-Checking if the documentation is in sync with the code"
The informational line that you had added in this PR was fine IMO.
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.
ha, fixed and unfixed. Should be good now.
This way we will catch when we need to regenerate the docs, as the doccheck make target is run as part of CI.
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
Thanks @lilic for your contribution. Your patience is appreciated :).
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LiliC, tariq1890 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
The generated docs were out of date, so I reran the
make generate
. Also added a check for the generated docs, which will be now run as part of doc travis job.