Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Sep 22, 2025

This PR is large apologies! One of those that has to be done in one big swoop.

This makes our tooling project's commands lightweight shims over services. These services can more easily be shared with other invokees (e.g an MCP server) and composed.

We've now merged docs-assembler into docs-builder

All the commands are available under docs assembler .. with minor changes:

Commands:
  assemble                                        Do a full assembler clone and assembler build in one swoop
  assembler bloom-filter create                   Generate the bloom filter binary file
  assembler bloom-filter lookup                   Lookup whether <paramref name="path"/> exists in the bloomfilter
  assembler build                                 Builds all repositories
  assembler clone                                 Clones all repositories
  assembler config init                           Clone the configuration folder
  assembler content-source match
  assembler content-source validate
  assembler deploy apply                          Applies a sync plan
  assembler deploy plan                           Creates a sync plan
  assembler deploy update-redirects               Refreshes the redirects mapping in Cloudfront's KeyValueStore
  assembler navigation validate                   Validates navigation.yml does not contain colliding path prefixes and all urls are unique
  assembler navigation validate-link-reference    Validate all published links in links.json do not collide with navigation path_prefixes and all urls are unique.
  assembler serve                                 Serve the output of an assembler build

Notably

docs-assembler docs-builder
content-source match assembler content-source match
content-source validate assembler content-source validate
deploy apply assembler deploy apply
deploy plan assembler deploy plan
deploy update-redirects assembler deploy update-redirects
legacy-docs create-bloom-bin assembler bloom-filter create
legacy-docs page-exists assembler bloom-filter lookup
navigation validate assembler navigation validate
navigation validate-link-reference assembler navigation validate-link-reference
repo build-all assembler build
repo clone-all assembler clone
repo init-config assembler config init

New commands

assembler serve

replaces serve-static on docs-builder

assemble

You can now clone build and serve (if --serve) is passed the assembler build in one swoop

./docs-builder assemble --serve

Is the same as

./docs-builder assembler clone
./docs-builder assembler build
./docs-builder assembler serve

Misc Fixes

When running in the IDE we were using .artifacts/bin/.../.artifacts/... as checkout and build folder. This is a waste of disk space and we now correctly .artifacts in the root of the checkout.

Uncaught exceptions now get reported as errors on DiagnosticCollector so its summary does not say 0 Erros while printing an exception stacktrace. This now says 1 error.

@Mpdreamz Mpdreamz requested a review from a team as a code owner September 22, 2025 20:22
@Mpdreamz Mpdreamz requested a review from reakaleek September 22, 2025 20:22
@Mpdreamz Mpdreamz self-assigned this Sep 22, 2025
@reakaleek reakaleek requested a review from Copilot September 22, 2025 20:23
Copy link
Contributor

@Copilot 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 reorganizes CLI tools into services for better code sharing, ensures uncaught exceptions are properly reported, and consolidates command handling across both docs-builder and docs-assembler tools. The main changes include extracting business logic into reusable service classes, standardizing error handling, and moving shared functionality to dedicated service layers.

  • Extract CLI command implementations into reusable service classes
  • Implement unified exception handling and error reporting across tools
  • Move shared navigation, deployment, and build functionality to service layer

Reviewed Changes

Copilot reviewed 104 out of 105 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tooling/docs-builder/Program.cs Adds service registration and new command structure for docs-builder
src/tooling/docs-assembler/Cli/ Refactors assembler CLI commands to use service layer
src/services/Elastic.Documentation.Services/ New service layer with ServiceInvoker for command execution
src/services/Elastic.Documentation.Assembler/ Extracted assembler business logic into service classes
src/services/Elastic.Documentation.Isolated/ New isolated build service for standalone builds
src/Elastic.Documentation.Links/ Moved cross-link functionality to dedicated project
src/tooling/Elastic.Documentation.Tooling/ Updated diagnostics and filter infrastructure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Mpdreamz Mpdreamz changed the title feature/merge cli tools Merge docs-assembler commands into docs-builder Sep 22, 2025
Mpdreamz and others added 4 commits September 23, 2025 09:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…onFilter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Mpdreamz Mpdreamz merged commit 7c32cc6 into main Sep 23, 2025
19 checks passed
@Mpdreamz Mpdreamz deleted the feature/merge-cli-tools branch September 23, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants