Skip to content

Recognize nested *Settings.cpp files in the feature_docs hook - #113387

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix/feature-docs-nested-settings-files
Aug 4, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix/feature-docs-nested-settings-files

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or improvement (changelog entry is not required)

ci/jobs/scripts/workflow_hooks/feature_docs.py accepts embedded settings documentation (the DECLARE docstrings from which the settings reference pages are autogenerated) by matching changed files against the glob src/**/*Settings.cpp / src/**/*Settings.h with PurePosixPath.match. But PurePosixPath.match treats ** like a single *, so the glob matched src/Core/Settings.cpp and src/Core/FormatFactorySettings.h, yet not the more deeply nested src/Storages/MergeTree/MergeTreeSettings.cpp. As a result, a pr-feature PR that adds a new MergeTree setting together with its DECLARE docstring — the only correct place to document it, since docs/reference/settings/** is autogenerated and direct edits there are rejected — failed the hook with "No documentation changes found, please update the documentation".

Replace the glob with an explicit src/ prefix + suffix check, keeping the existing DECLARE_SETTING / DECLARE( content-marker requirement.

Seen on #113020 (report).

Related: #113020

Version info

  • Merged into: 26.8.1.785 (included in 26.8 and later)

`PurePosixPath.match` treats `**` like a single `*`, so the pattern
`src/**/*Settings.cpp` matched `src/Core/Settings.cpp` but not
`src/Storages/MergeTree/MergeTreeSettings.cpp`. A pr-feature PR that
documents a new MergeTree setting via its `DECLARE` docstring (the
source the settings reference pages are autogenerated from) was
rejected with "No documentation changes found". Replace the glob with
a prefix + suffix check.

Seen on #113020 (report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113020&sha=c6ca56a5bc62a9b8c5e1b853f623f4b4d4e19fbe&name_0=PR&name_1=Finish%20Workflow)

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8434321]

Summary: ✅


AI Review

Summary

This PR replaces the broken PurePosixPath.match glob in the feature_docs workflow hook with a prefix/suffix check so nested settings sources can satisfy the pr-feature documentation gate. The intended fix for src/Storages/MergeTree/MergeTreeSettings.cpp is reasonable, but the new predicate is too broad and now treats nested internal settings headers and other non-doc settings containers as documentation changes, so the hook can be bypassed.

Findings

⚠️ Majors

  • [ci/jobs/scripts/workflow_hooks/feature_docs.py:71-73] The new src/ + *Settings.{cpp,h} check no longer limits itself to settings sources that actually back user-facing docs. Any nested header or source file with helper macros such as DECLARE_SETTING_TRAIT now passes is_source_owned_doc; for example, src/Storages/MergeTree/MergeTreeSettings.h, src/Interpreters/FileCache/FileCacheSettings.h, and src/Processors/QueryPlan/QueryPlanSerializationSettings.h all return True even though they do not contain the description-bearing DECLARE(...) blocks the hook is supposed to recognize. A pr-feature PR that only changes one of those internal files can now skip the docs requirement entirely.
    Suggested fix: restrict the nested-path allowance to the actual settings documentation sources, or tighten the marker check so helper macros in headers do not count as embedded docs.
Tests
  • ⚠️ Add a focused unit test for is_source_owned_doc that accepts src/Storages/MergeTree/MergeTreeSettings.cpp but rejects nested helper headers such as src/Storages/MergeTree/MergeTreeSettings.h or src/Processors/QueryPlan/QueryPlanSerializationSettings.h. The current coverage only proves the shallow src/Core/Settings.cpp case, so it would not catch this regression.
Final Verdict

Needs changes before merge: the nested-path fix currently weakens the pr-feature docs gate by treating nested internal *Settings headers/sources as documentation changes.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 4, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM

@alexey-milovidov alexey-milovidov self-assigned this Aug 4, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 4, 2026
Merged via the queue into master with commit 77cc235 Aug 4, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix/feature-docs-nested-settings-files branch August 4, 2026 22:00
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants