Skip to content

feat(docs): implement documentation build and database workflow with … - #1769

Merged
kdinev merged 5 commits into
masterfrom
dkalinov/mcp-db-git-workflow
Aug 6, 2026
Merged

feat(docs): implement documentation build and database workflow with …#1769
kdinev merged 5 commits into
masterfrom
dkalinov/mcp-db-git-workflow

Conversation

@dkalinovInfra

Copy link
Copy Markdown
Contributor

Description

Hardens the documentation database build after a partial DB (112 documents instead of 1232) shipped on master unnoticed.

  • Compact the DBbuild-db.ts now runs VACUUM, but only when the DB file already existed before the build. DROP/DELETE frees pages without shrinking the file, which left the committed DB 90% empty space (33 MB holding 1.8 MB of content). Rebuilding over that file now yields 25 MB with zero free pages.
  • Regression testspec/unit/docs-db-counts-spec.ts asserts per-framework document counts, integrity and FTS consistency against the committed DB. Runs in the existing jasmine suite, so it gates CI with no workflow change. Verified to fail against both historical failure modes (an angular-only DB and a 90%-truncated one).
  • Automated build — a manually triggered workflow that rebuilds the documentation DB and opens a PR for review. Frameworks run one after another to stay within OpenAI rate limits, and the database is assembled once from all of them, since a per-framework build on a clean runner produces a single-framework DB — the original bug.
  • Supporting changes: restore-docs-final.ts (rebuilds the compressed docs from the committed DB so incremental runs work on a clean checkout), a COMPRESS_MODEL env override for the compression model, and switch-submodules.sh is now tracked.

The DB binary changes in size only — the same 1232 documents, recompacted.

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration change

Affected Packages

  • igniteui-cli (packages/cli)
  • @igniteui/cli-core (packages/core)
  • @igniteui/angular-templates (packages/igx-templates)
  • @igniteui/angular-schematics (packages/ng-schematics)
  • @igniteui/mcp-server (packages/igniteui-mcp)

Checklist

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

Additional Context

Verified locally:

  • New spec passes (10 specs) and fails as intended against deliberately damaged databases.
  • VACUUM over the historical bloated file: 33,764 KB → 25,060 KB, freelist_count = 0, 1232 documents intact.
  • restore-docs-final.ts round-trips byte-identically across all 1232 documents.
  • ESLint clean on the new spec.

The full npm run test / npm run build / npm run lint boxes are left unchecked — only the new spec and its lint were run locally.

The workflow itself can only be exercised by dispatching it. Suggested first run: frameworks: angular, mode: incremental, to validate the chain cheaply before a full rebuild. It requires an OPENAI_API_KEY repository secret.

Copilot AI review requested due to automatic review settings August 6, 2026 11:16
@coveralls

coveralls commented Aug 6, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 87.816%. remained the same — dkalinov/mcp-db-git-workflow into master

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 hardens the Ignite UI documentation database build pipeline in packages/igniteui-mcp/igniteui-doc-mcp by adding a regression test, improving DB compaction behavior, and introducing a manual GitHub Actions workflow to rebuild the committed docs DB safely.

Changes:

  • Add a Jasmine regression spec that validates committed docs DB integrity, per-framework counts, and FTS consistency.
  • Harden DB build behavior by vacuuming inherited DB files to avoid committing bloated/free-page-heavy DBs.
  • Add a workflow + composite action to rebuild per-framework docs sequentially (rate-limit friendly), assemble a single DB, and open a PR with the updated DB/baselines.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/unit/docs-db-counts-spec.ts New Jasmine spec validating committed docs DB counts, integrity, and FTS behavior.
packages/igniteui-mcp/igniteui-doc-mcp/switch-submodules.sh New helper script to move docs submodules to a target branch during workflow runs.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/restore-docs-final.ts New script to restore dist/docs_final (and optional toc stubs) from the committed DB for clean incremental runs.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/compress-angular-docs.ts Allow compression model override via COMPRESS_MODEL.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/compress-react-docs.ts Allow compression model override via COMPRESS_MODEL.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/compress-blazor-docs.ts Allow compression model override via COMPRESS_MODEL.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/compress-wc-docs.ts Allow compression model override via COMPRESS_MODEL.
packages/igniteui-mcp/igniteui-doc-mcp/scripts/build-db.ts Run VACUUM only when rebuilding over an existing DB file to compact it before committing.
.github/workflows/build-docs-db.yml New manual workflow to rebuild docs DB end-to-end and open a PR with updated artifacts.
.github/actions/build-framework-docs/action.yml New composite action to build/compress a single framework and upload artifacts for assembly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/unit/docs-db-counts-spec.ts
Comment thread .github/workflows/build-docs-db.yml Outdated
Comment thread packages/igniteui-mcp/igniteui-doc-mcp/switch-submodules.sh
@dkalinovInfra
dkalinovInfra requested a review from kdinev August 6, 2026 12:05
dkalinovInfra and others added 4 commits August 6, 2026 15:10
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kdinev
kdinev merged commit ed427d7 into master Aug 6, 2026
4 checks passed
@kdinev
kdinev deleted the dkalinov/mcp-db-git-workflow branch August 6, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants