Skip to content

[docs-utils] 4️⃣ pre-req: Prepare for new validations#250810

Merged
clintandrewhall merged 5 commits intoelastic:mainfrom
clintandrewhall:feat/docs-utils/4-tooling
Feb 4, 2026
Merged

[docs-utils] 4️⃣ pre-req: Prepare for new validations#250810
clintandrewhall merged 5 commits intoelastic:mainfrom
clintandrewhall:feat/docs-utils/4-tooling

Conversation

@clintandrewhall
Copy link
Copy Markdown
Contributor

Summary

Prepares @kbn/docs-utils for upcoming validation enhancements by refactoring the stats collection API to be extensible. This will allow other Phase 4 PRs to be reviewed and committed to main independently of each other.

Note

This PR is a subset of #247688 for ease of review.

This PR was written with Cursor and claude-4.5-opus-high.

Changes

  • Add IssuesByPlugin interface to types.ts for passing validation issues as extensible options.
  • Refactor collectApiStatsForPlugin to accept IssuesByPlugin instead of individual parameters.
  • Update README with comprehensive documentation.
  • Update tests and integration test calls to use new signature

Why

This refactor allows future validation rules (e.g., @returns checks, param mismatches, unnamed exports) to be added without breaking the function signature. Each new validation can simply add a field to IssuesByPlugin.

- Update README with comprehensive documentation.
- Add IssuesByPlugin interface for extensible options for future validations.
- Refactor collectApiStatsForPlugin to use IssuesByPlugin.
@clintandrewhall clintandrewhall requested a review from a team as a code owner January 28, 2026 19:26
@clintandrewhall clintandrewhall added Team:Operations Kibana-Operations Team release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.4.0 labels Jan 28, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

Copy link
Copy Markdown
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 collectApiStatsForPlugin function to accept validation issues through a single extensible IssuesByPlugin interface instead of individual parameters. This change prepares the codebase for future validation enhancements by making the function signature more maintainable as new validation rules are added.

Changes:

  • Introduced IssuesByPlugin interface to group validation issue collections
  • Refactored collectApiStatsForPlugin to accept the new interface
  • Updated all test cases and integration tests to use the new signature

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/kbn-docs-utils/src/types.ts Added IssuesByPlugin interface definition
packages/kbn-docs-utils/src/stats.ts Refactored function signature to use IssuesByPlugin
packages/kbn-docs-utils/src/stats.test.ts Updated test cases with helper function and new signature
packages/kbn-docs-utils/src/integration_tests/api_doc_suite.test.ts Updated integration test calls to use new signature
packages/kbn-docs-utils/src/cli/tasks/collect_stats.ts Updated CLI task to use new signature
packages/kbn-docs-utils/src/README.md Enhanced documentation with comprehensive usage details
packages/kbn-docs-utils/src/integration_tests/snapshots/*.mdx Updated snapshot dates (auto-generated files)

@clintandrewhall clintandrewhall changed the title [pre-req][kbn-docs-utils] Prepare for new validations [docs-utils] 4️⃣ pre-req: Prepare for new validations Jan 29, 2026
Copy link
Copy Markdown
Contributor

@mistic mistic left a comment

Choose a reason for hiding this comment

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

lgtm

@clintandrewhall clintandrewhall enabled auto-merge (squash) February 4, 2026 20:14
@clintandrewhall clintandrewhall merged commit 7b93ca1 into elastic:main Feb 4, 2026
16 checks passed
@clintandrewhall clintandrewhall deleted the feat/docs-utils/4-tooling branch February 4, 2026 22:07
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

mbondyra added a commit to mbondyra/kibana that referenced this pull request Feb 5, 2026
* commit '5c0872d56bc0268177cd3c7150a1685481fb5238': (221 commits)
  Add .cursorignore file (elastic#251709)
  [Search] Add descriptions to semantic_text field inference endpoint select (elastic#249265)
  [Agent Builder] Agent skills implementation (elastic#251209)
  [Lens] [ES|QL] Improve types for ES|QL conversion. (elastic#251042)
  Update the trace waterfall to make it easy to understand (elastic#250442)
  [ES|QL] [Lens] Adds query stats (elastic#251029)
  [Lens] Fix KQL character escaping when query is generated from Top values column (breakdown). (elastic#250925)
  fix(kbn-elastic-assistant): fix a11y issue with missing label on flyout (elastic#251656)
  Update dependency @elastic/monaco-esql to v3.1.16 (main) (elastic#251666)
  [Automatic Import V2] Add langsmith tracing (elastic#251592)
  [scout] fix duplicated test failure reports in Buildkite annotations (elastic#251455)
  chore(NA): remove us-central1-b from gcp zones on high load jobs (elastic#251748)
  skip flaky suite (elastic#250973)
  [Lens] Allow read only view for users with write permissions but having no write access to the dashboard (elastic#247746)
  [CI] Increase artifacts disk to 180gb (elastic#251774)
  [content-list] 1. Provider Foundation (elastic#251344)
  [AI Infra] Add missing ES|QL commands and functions documentation for inference tasks (elastic#249089)
  [docs-utils] 4️⃣ pre-req: Prepare for new validations (elastic#250810)
  [APM] Extend React flow service map test coverage (elastic#251624)
  [scout] discover tests with custom server configs (elastic#251297)
  ...

# Conflicts:
#	src/platform/plugins/shared/dashboard/tsconfig.json
#	x-pack/platform/plugins/shared/agent_builder_platform/server/tools/create_visualization/create_visualization.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes review Team:Operations Kibana-Operations Team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants