ci(mcp): validate package contents and version before npm publish#1706
Merged
Conversation
…y validation logic for framework directories
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the npm publish workflow by adding a pre-publish validation step for the @igniteui/mcp-server workspace and bumping package versions to 15.2.2-alpha.3 (and related Angular template/schematics versions).
Changes:
- Add
packages/igniteui-mcp/igniteui-doc-mcp/scripts/validate-package.tsand wire it asvalidate:package. - Run the new validator in
.github/workflows/npm-publish.ymlbetween build and tag selection; improve npm tag env handling. - Bump versions and internal dependency ranges across CLI/core/templates/schematics/MCP server metadata.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ng-schematics/package.json | Bumps schematics version and updates internal dependency ranges. |
| packages/igx-templates/package.json | Bumps templates version and updates @igniteui/cli-core dependency range. |
| packages/igniteui-mcp/igniteui-doc-mcp/server.json | Updates MCP server metadata versions to 15.2.2-alpha.3. |
| packages/igniteui-mcp/igniteui-doc-mcp/scripts/validate-package.ts | Adds pre-publish validation (DB/docs size + version consistency checks). |
| packages/igniteui-mcp/igniteui-doc-mcp/package.json | Bumps MCP package version and adds validate:package script. |
| packages/core/package.json | Bumps @igniteui/cli-core version. |
| packages/cli/package.json | Bumps CLI version and updates internal dependency ranges including MCP server. |
| .github/workflows/npm-publish.yml | Adds MCP package validation step and fixes npm tag env export/debug output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
damyanpetev
approved these changes
May 28, 2026
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.
Description
Hardens the npm publish workflow with a pre-publish validation step for the
@igniteui/mcp-serverpackage, so broken releases fail in CI before reaching the npm registry instead of being discovered after the fact.Changes:
New
scripts/validate-package.tsin the MCP package. Pre-publish sanity checks:dist/igniteui-docs.dband is at least 20 MB.docs/<framework>-api/directory (angular, react, webcomponents, blazor) totals at least 300 KB — catches an empty or partially-built docs pipeline.--expected-version <ver>(orEXPECTED_VERSIONenv) is passed, the script asserts the release tag matchespackage.jsonversion,server.jsontop-levelversion, and every entry inserver.jsonpackages[].version(iterated, not hardcoded to index 0). A leadingvis stripped so bothv15.2.2and15.2.2tag styles are accepted. If no expected version is supplied (local invocations), the version block is skipped silently.npm run validate:packagein the MCP workspace'spackage.json..github/workflows/npm-publish.ymlrewritten:validate-mcpjob (introduced earlier in this branch) is folded into the existingbuildjob as a newValidate MCP package contentsstep placed betweenBuild packagesandDefine npm tag. The release job now runsyarn installand the MCP build once instead of twice, reusing theVERSIONalready derived fromGITHUB_REF.submodules: recursiveretained on thebuildcheckout — required because the validator inspects paths populated by submodules.Define npm tagrewritten in multi-line form. The previous one-liner appended both branches' echoes to$GITHUB_ENVvia redirection onfi, thenecho ${NPM_TAG}ran in the same shell whereNPM_TAGwas never exported — so the debug echo always printed an empty line. Now the value is held in a local variable, written to$GITHUB_ENV, and echoed from the local variable.Tuning follow-up: the 300 KB framework-dir floor is intentionally lenient —
react-apiwas ~346 KB in the failing CI run, only 15% above the floor. The threshold is set conservatively to avoid false positives on the first release; consider raising it (or making it per-framework) once we have a few green release runs as a baseline.Related Issue
N/A — internal release-pipeline hardening.
Type of 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
npm run test)npm run build)npm run lint)Additional Context
Local validator output on a matching version:
On a version mismatch (
--expected-version 99.9.9), the script reports each of the three asserted locations separately and exits with code 1:On a CI run with truncated docs (the failure that motivated tightening the directory check to the framework level), the four
docs/<framework>-api/directories totaled 1.10 MB / 346 KB / 1.03 MB / 2.26 MB respectively — all above the 300 KB floor.