[docs-utils] 4️⃣ Add complex type validation#250825
Merged
clintandrewhall merged 3 commits intoelastic:mainfrom Feb 11, 2026
Merged
[docs-utils] 4️⃣ Add complex type validation#250825clintandrewhall merged 3 commits intoelastic:mainfrom
clintandrewhall merged 3 commits intoelastic:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances API documentation validation by tracking complex types (objects, interfaces, compound types) that lack descriptions, adding a new missingComplexTypeInfo field to the ApiStats interface.
Changes:
- Added
missingComplexTypeInfotracking to identify complex types without descriptions - Refactored
collectApiStatsForPluginto accept anIssuesByPluginobject instead of individual parameters - Updated tests, mocks, and fixtures to reflect the new validation
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/kbn-docs-utils/src/types.ts |
Adds missingComplexTypeInfo field to ApiStats and introduces IssuesByPlugin interface |
packages/kbn-docs-utils/src/stats.ts |
Implements trackMissingComplexTypeInfo function and refactors function signature |
packages/kbn-docs-utils/src/stats.test.ts |
Updates all test cases to use new IssuesByPlugin parameter format |
packages/kbn-docs-utils/src/integration_tests/api_doc_suite.test.ts |
Updates stats collection calls and adds missingComplexTypeInfo to snapshot output |
packages/kbn-docs-utils/src/integration_tests/snapshots/*.stats.json |
Updates snapshot with expected missingComplexTypeInfo counts and entries |
packages/kbn-docs-utils/src/integration_tests/snapshots/*.mdx |
Updates generated date stamps in documentation files |
packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a/* |
Adds expected issue comments documenting missing complex type info |
packages/kbn-docs-utils/src/cli/tasks/collect_stats.ts |
Updates stats collection to use new IssuesByPlugin parameter |
packages/kbn-docs-utils/src/cli/tasks/collect_stats.test.ts |
Adds missingComplexTypeInfo to mock stats |
packages/kbn-docs-utils/src/check_package_docs_cli.ts |
Includes missingComplexTypeInfo in comment validation check |
packages/kbn-docs-utils/src/__test_helpers__/mocks.ts |
Adds missingComplexTypeInfo to mock data structures |
packages/kbn-docs-utils/src/README.md |
Reformats and updates documentation structure |
packages/kbn-docs-utils/scripts/update_fixture_comments.js |
Adds missingComplexTypeInfo category to fixture comment updater |
13 tasks
Contributor
|
Pinging @elastic/kibana-operations (Team:Operations) |
067e1c7 to
1f7cb2f
Compare
- Add missingComplexTypeInfo field to ApiStats. - Add trackMissingComplexTypeInfo function. - Update mocks and fixture Expected issues blocks.
e88110e to
4180094
Compare
Contributor
💚 Build Succeeded
Metrics [docs]
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
missingComplexTypeInfofield toApiStatsto track complex types (objects, interfaces, compound types) that are missing descriptions. These types are particularly important to document because their structure isn't self-explanatory.Note
This PR is a subset of #247688 for ease of review.
This PR was written with Cursor and
claude-4.5-opus-high.Important
This PR relies on #250810 and includes it as its base commit. This PR will remain draft until that PR is merged and this branch is rebased.
Before / After Example
Given these TypeScript types:
Before this PR:
All undocumented items were lumped together in
missingComments, making it hard to prioritize:{ "counts": { "missingComments": 4 }, "missingComments": [ { "label": "SearchOptions", "type": "Interface" }, { "label": "query", "type": "string" }, { "label": "FilterSpec", "type": "Object" }, { "label": "DEFAULT_TIMEOUT", "type": "number" } ] } // No way to identify which items are complex types needing priority!After this PR:
Complex types are tracked separately for prioritized documentation efforts:
{ "counts": { "missingComments": 4, "missingComplexTypeInfo": 2 // ✅ Complex types flagged separately! }, "missingComplexTypeInfo": [ { "id": "def-public.SearchOptions", "label": "SearchOptions", "type": "Interface", // ✅ Interface - complex! "lineNumber": 6 }, { "id": "def-public.FilterSpec", "label": "FilterSpec", "type": "Object", // ✅ Object - complex! "lineNumber": 11 } // UserPreferences NOT flagged (has description) // DEFAULT_TIMEOUT NOT flagged (not a complex type) ] }What Counts as "Complex"?
InterfaceKindObjectKindCompoundTypeKindStringKindNumberKindFunctionKindWhy This Matters
Complex types are the highest-value documentation targets:
stringornumberare self-documentinginterface SearchOptionswith 5 properties? Readers need context'eq' | 'neq' | 'gt' | 'lt'need explanation of what each value meansChanges
trackMissingComplexTypeInfofunction instats.tsto detect and collect these issues during API stat collectioncheck_package_docs_cli.tsto includemissingComplexTypeInfoin the comments validation checkImpact
--check commentsflag incheck_package_docs