-
Notifications
You must be signed in to change notification settings - Fork 671
Validate generated reference docs in CI #13451
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
Validate generated reference docs in CI #13451
Conversation
The `doc` target now generates reference documentation files via `reference-help` and `check-doc` validates all generated files are committed. This replaces scattered unit tests that only validated 3 out of 4 files and had reliability issues. Previously, `mimir-flags-defaults.json` wasn't validated, leading to incorrect values being committed (e.g., 9223372036854776000 instead of 9223372036854775807 for max int64).
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.
Please see the Cursor comment though! I didn't notice that at first.
The doc target depends on reference-help, so reference-help must also run in the container when BUILD_IN_CONTAINER=true.
reference-help should not run in the container target list because it would try to resolve its binary dependencies on the host. Instead, when doc runs in the container, it will call reference-help which will then build Linux binaries inside the container.
Split doc target into container and non-container versions. In container mode, doc enters the container with BUILD_IN_CONTAINER=false to avoid resolving reference-help dependencies on the host, which would build macOS binaries that can't run in the Linux container.
Split reference help validation from check-doc into its own target that always runs outside the container. This allows CI to validate reference documentation without needing the build container.
|
changed the approach and now we have |
Signed-off-by: Dimitar Dimitrov <[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.
Pull Request Overview
This PR refactors the validation of reference help documentation by replacing Go-based tests with a Makefile-based check that runs in CI. The key motivation is to eliminate flaky tests while maintaining validation coverage for generated documentation files.
Key changes:
- Removed
TestConfigDescriptorIsUpToDateandTestHelpGo tests and replaced them with a newcheck-reference-helpMakefile target - Added the new check to the CI workflow to ensure reference documentation stays up to date
- Corrected max int64 values in gRPC keepalive configuration from incorrect values to the accurate
9223372036854775807
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/config-inspector/main_test.go | Removed the entire TestConfigDescriptorIsUpToDate test function, leaving only package declaration |
| cmd/mimir/main_test.go | Removed the TestHelp function that validated help output templates |
| Makefile | Added new check-reference-help target to validate reference documentation is up to date |
| .github/workflows/test-build-deploy.yml | Added step to run the new check-reference-help validation in CI |
| operations/mimir/mimir-flags-defaults.json | Corrected gRPC keepalive max connection values to accurate max int64 value |
| .github/workflows/flaky-tests.yml | Removed TestConfigDescriptorIsUpToDate from ignored tests list since the test no longer exists |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Dimitar Dimitrov <[email protected]>
alexweav
left a comment
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.
Seems reasonable, LGTM. I like the newer, split target approach more, make reference-help and make check-reference-help feels consistent
The check-doc CI step now validates generated markdown files, while a new check-reference-help step validates reference documentation files (help.txt.tmpl, help-all.txt.tmpl, config-descriptor.json, mimir-flags-defaults.json). Both checks always run outside the container.
Why
Previously, operations/mimir/mimir-flags-defaults.json wasn't validated in CI, leading to incorrect values being committed (e.g., 9223372036854776000 instead of 9223372036854775807 for max int64).
The reference-help target needs to run outside the container since it executes the compiled mimir binary and config-inspector tool directly. Splitting it into a separate check makes the separation clear and allows check-doc to continue running in the container for markdown validation.
Note
Adds a CI step and Makefile target to validate generated reference docs, corrects gRPC keepalive max int64 defaults, updates flaky-tests ignored list, and removes redundant help/config descriptor tests.
Check Reference Help Documentationstep in/.github/workflows/test-build-deploy.ymlrunningmake BUILD_IN_CONTAINER=false check-reference-help./.github/workflows/flaky-tests.ymlto only ignoreTestOurUpstreamTestCasesAreInSyncWithUpstream.check-reference-helptarget to verifycmd/mimir/help.txt.tmpl,cmd/mimir/help-all.txt.tmpl,cmd/mimir/config-descriptor.json, andoperations/mimir/mimir-flags-defaults.jsonare up to date.TestHelpincmd/mimir/main_test.go.tools/config-inspector/main_test.go(config descriptor up-to-date test).operations/mimir/mimir-flags-defaults.jsonforserver.grpc.keepalive.*defaults.Written by Cursor Bugbot for commit 32d5f93. This will update automatically on new commits. Configure here.