feat(dockhand): support transitive dependency overrides/constraints in spec.yaml#669
Draft
JAORMX wants to merge 1 commit into
Draft
feat(dockhand): support transitive dependency overrides/constraints in spec.yaml#669JAORMX wants to merge 1 commit into
JAORMX wants to merge 1 commit into
Conversation
…n spec.yaml
Renovate version bumps fail the build-containers Grype gate when the bumped
package pins or caps a transitive dependency to a vulnerable version. Add an
optional dependency-override mechanism to the spec.yaml schema, plumbed into the
generated Dockerfile.
- npx: spec.overrides ([]{package, version, reason}) is injected as an npm
"overrides" block in the generated package.json before the npm install step.
- uvx: spec.constraints ([]{spec, reason}) is written to a uv overrides
requirements file and passed to "uv tool install --overrides".
Both injection points match the install step by content (not line number) so
they stay robust to toolhive template formatting. Every entry requires a
non-empty reason (validation fails otherwise) so the justification for
circumventing an upstream pin is auditable in-repo.
Verified end-to-end against the CI build + Grype recipe:
- #469 @brightdata/mcp 2.9.5 + override @modelcontextprotocol/sdk 1.26.0:
resolves to SDK 1.26.0, grype --fail-on high --only-fixed passes.
- #527 mcp-clickhouse 0.3.0 + constraint fastmcp>=3.2.0: fastmcp 3.4.0,
import mcp_clickhouse OK, grype passes.
Refs #668
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🔒 MCP Security Scan Results |
Contributor
🛡️ Skill Security Scan Results |
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.
Implements the dependency-override mechanism from #668.
What
Renovate version bumps fail the
build-containersGrype gate (--fail-on high --only-fixed) when the bumped package pins/caps a transitive dependency to a vulnerable version. This adds an optional override mechanism tospec.yaml, plumbed into the generated Dockerfile. toolhive needs no changes — itsBuildFromProtocolSchemeWithName(..., dryRun=true)returns the Dockerfile as a string, which is the injection seam.Schema (
cmd/dockhand/main.go)Overrides []OverrideEntry{Package, Version, Reason}(npx only)Constraints []ConstraintEntry{Spec, Reason}(uvx only)Reasonis mandatory — validation fails otherwise, mirroringsecurity.allowed_issues.Injection
RUN echo '{...}' > package.jsonstep to embed anoverridesblock (npm honorsoverridesonly from package.json), kept before thenpm installstep.RUN printf ... > /tmp/uv-overrides.txtstep before the install step and adds--overrides /tmp/uv-overrides.txtto theuv tool installinvocation. The install line is matched by content, ignoring comment lines that merely mentionuv tool install.Verification (end-to-end: dockhand-generated Dockerfile -> docker build -> grype --fail-on high --only-fixed)
@modelcontextprotocol/sdk1.26.0fastmcp>=3.2.0import mcp_clickhouseOK; grype gate passesfastmcp>=3.2.0import mcp_neo4j_cypherOK; grype passes — but crosses upstream's deliberate<2.14cap (major 2->3); functional testing of the neo4j tools is required before relying on it.go build ./...,go vet,go test ./cmd/dockhand/..., andgolangci-lint run ./cmd/dockhand/...all pass.Follow-up
This PR only adds the mechanism — it does not modify the three renovate spec.yaml files. After this merges to
main, each renovate PR (#469, #527, #528) needs to be rebased on main and have its override/constraint block added to itsspec.yaml.Refs #668
🤖 Generated with Claude Code