Skip to content

Conversation

@dimitarvdimitrov
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov commented Nov 10, 2025

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.

  • CI:
    • Add Check Reference Help Documentation step in /.github/workflows/test-build-deploy.yml running make BUILD_IN_CONTAINER=false check-reference-help.
    • Update /.github/workflows/flaky-tests.yml to only ignore TestOurUpstreamTestCasesAreInSyncWithUpstream.
  • Build/Makefile:
    • Introduce check-reference-help target to verify cmd/mimir/help.txt.tmpl, cmd/mimir/help-all.txt.tmpl, cmd/mimir/config-descriptor.json, and operations/mimir/mimir-flags-defaults.json are up to date.
  • Tests:
    • Remove TestHelp in cmd/mimir/main_test.go.
    • Remove tools/config-inspector/main_test.go (config descriptor up-to-date test).
  • Data/Fixes:
    • Correct max int64 values in operations/mimir/mimir-flags-defaults.json for server.grpc.keepalive.* defaults.

Written by Cursor Bugbot for commit 32d5f93. This will update automatically on new commits. Configure here.

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).
Copy link
Contributor

@aknuds1 aknuds1 left a 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.
@dimitarvdimitrov dimitarvdimitrov added the changelog-not-needed PRs that don't need a CHANGELOG.md entry label Nov 10, 2025
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.
@dimitarvdimitrov
Copy link
Contributor Author

changed the approach and now we have check-reference-help

Signed-off-by: Dimitar Dimitrov <[email protected]>
Copy link
Contributor

Copilot AI left a 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 TestConfigDescriptorIsUpToDate and TestHelp Go tests and replaced them with a new check-reference-help Makefile 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]>
Copy link
Contributor

@alexweav alexweav left a 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

@dimitarvdimitrov dimitarvdimitrov merged commit 706ace9 into main Nov 11, 2025
39 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the dimitar/build/validate-generated-reference-docs branch November 11, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-not-needed PRs that don't need a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants