Implement mcp-scripts.dependencies end-to-end with runtime-manager install flow and pinned release-tag validation#39739
Conversation
|
Hey
If you'd like a hand continuing the implementation, here's a ready-to-use prompt:
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
mcp-scripts.dependencies end-to-end with runtime-manager install flow
There was a problem hiding this comment.
Pull request overview
This PR completes the end-to-end implementation of mcp-scripts.dependencies in gh-aw, wiring the field from workflow parsing through tools.json generation into MCP runtime execution, and adding compile-time validation and targeted tests to prevent late “module/package not found” failures.
Changes:
- Propagates
dependenciesthrough the mcp-scripts model/parser and emits them into generatedtools.json(sorted for stable output). - Adds compile-time validation for dependency names (npm/pip/go/system packages) and extends runtime detection for mcp-scripts language requirements.
- Introduces a runtime dependency installer/gate in the JS MCP server, with retry behavior and tests.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/validation_test.go | Adds a runtime package validation test covering invalid mcp-scripts dependency names. |
| pkg/workflow/runtime_validation.go | Hooks mcp-scripts dependency validation into the runtime package validation path. |
| pkg/workflow/runtime_setup_test.go | Adds test coverage for runtime detection from mcp-scripts tool definitions. |
| pkg/workflow/runtime_detection.go | Detects node/python/go runtime requirements based on mcp-scripts tool language fields. |
| pkg/workflow/mcp_scripts_parser.go | Parses dependencies from tool config and stores them in MCPScriptToolConfig. |
| pkg/workflow/mcp_scripts_parser_test.go | Adds parser tests for dependencies and verifies dependency preservation across merges. |
| pkg/workflow/mcp_scripts_generator.go | Emits dependencies into tools.json and sorts them for stable generation. |
| pkg/workflow/mcp_scripts_generator_test.go | Verifies tools.json includes dependencies and that ordering is stable/sorted. |
| pkg/workflow/mcp_scripts_dependencies_validation.go | Implements compile-time dependency name validation by inferred package manager. |
| pkg/workflow/mcp_scripts_dependencies_validation_wasm.go | Stubs dependency validation for js/wasm builds. |
| pkg/workflow/mcp_scripts_dependencies_validation_test.go | Unit tests for dependency name validation across managers. |
| docs/src/content/docs/specs/mcp-scripts-specification.md | Updates spec sync notes to reflect actual dependency propagation + install path. |
| docs/src/content/docs/reference/mcp-scripts.md | Updates author guidance to use dependencies: for third-party Python packages. |
| actions/setup/js/mcp_server_core.cjs | Wraps tool handlers with a dependency-install gate before first invocation. |
| actions/setup/js/mcp_scripts_tool_factory.cjs | Documents the dependencies field in tool config typedefs. |
| actions/setup/js/mcp_scripts_mcp_server.cjs | Documents the dependencies field in server typedefs. |
| actions/setup/js/mcp_scripts_config_loader.cjs | Documents the dependencies field in config loader typedefs. |
| actions/setup/js/mcp_dependencies_manager.test.cjs | Adds vitest coverage for manager inference, gating, retries, and fail-fast behavior. |
| actions/setup/js/mcp_dependencies_manager.cjs | Implements dependency install logic (npm/pip/go/system) with retry and dedupe gates. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 19/19 changed files
- Comments generated: 3
| } else if (manager === "shell") { | ||
| const shellPM = resolveShellPackageManager(); | ||
| if (!shellPM) { | ||
| throw new Error(`Dependency installation failed for '${dependency}': no supported system package manager found (expected apt-get, yum, or dnf)`); | ||
| } | ||
| command = shellPM.command; | ||
| args = [...shellPM.args, dependency]; | ||
| cwd = process.cwd(); | ||
| } else { |
| return async () => { | ||
| if (perToolInstallPromises.has(toolKey)) { | ||
| return perToolInstallPromises.get(toolKey); | ||
| } | ||
|
|
||
| const installPromise = (async () => { | ||
| for (const dependency of depList) { | ||
| const key = `${manager}:${dependency}`; | ||
| if (!installedDependencyPromises.has(key)) { | ||
| installedDependencyPromises.set( | ||
| key, | ||
| Promise.resolve().then(() => installDependency(logger, toolName, dependency, manager, basePath)) | ||
| ); | ||
| } | ||
| await installedDependencyPromises.get(key); | ||
| } | ||
| })(); | ||
|
|
||
| perToolInstallPromises.set(toolKey, installPromise); | ||
| return installPromise; | ||
| }; |
|
❌ Test Quality Sentinel failed during test quality analysis. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. |
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
@copilot compiler must enforce pinning of dependencies in .md source to release tags. no floating dependencies. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in |
mcp-scripts.dependencies end-to-end with runtime-manager install flowmcp-scripts.dependencies end-to-end with runtime-manager install flow and pinned release-tag validation
|
@copilot run pr-finisher skill |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot revert logging with core and use existing logger |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in
Done. I ran the PR-finisher flow for this iteration: triaged PR feedback, applied the requested logging revert in |
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in |
mcp-scripts.dependencieswas schema-valid and documented but dropped at parse/runtime, causing late tool failures (module/package not found). This change wires the field through parser → generatedtools.json→ runtime execution, with validation and install semantics aligned to the spec.Parser + model propagation
Dependencies []stringtoMCPScriptToolConfig.dependenciesfrom tool config (string entries only; non-strings ignored defensively).Manifest generation (
tools.json)dependenciestoMCPScriptsToolJSON.Runtime-manager integration for installs
actions/setup/js/mcp_dependencies_manager.cjs..cjs/JS →npm install --ignore-scripts --no-save.py→python3 -m pip install.go→go mod init(if needed) +go get.sh→ system manager (apt-get/yum/dnf)require("./shim.cjs")from dependency manager and script runner.mcp_dependencies_manager.cjsis included insetup.shrequired file lists (MCP_SCRIPTS_FILESandSAFE_OUTPUTS_FILES) so runtime assets are always copied.Dependency validation
.mdworkflow sources; floating dependencies are rejected.name@1.2.3/@scope/name@1.2.3name==1.2.3module@v1.2.3name=1.2.3)[what's wrong]. [what's expected]. [example]Runtime detection updates
script→ nodepy→ pythongo→ goDocs sync
Targeted tests
tools.jsondependency emission + sort stability.mcp_dependencies_manager.cjs) are included insetup.sh.