kai_mcp_solution_server: hash-locked requirements for Hermeto permissive mode#4
Conversation
|
Warning Review limit reached
More reviews will be available in 41 minutes and 20 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR introduces hash-locked Python build dependencies using Hermeto's pybuild-deps tooling. The changes add a Makefile target to compile pinned build requirements, integrate verification into CI, configure Git merge handling for generated files, and automate regeneration on merge syncs and in Docker builds. ChangesHermeto Build Dependency Locking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.gitattributes (1)
1-2: ⚡ Quick winInclude
requirements-build.txtin the same merge strategy asrequirements.txt.Given this PR’s lockfile contract, add
kai_mcp_solution_server/requirements-build.txt merge=oursso both generated lock artifacts follow identical merge behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.gitattributes around lines 1 - 2, Add the build lockfile to the .gitattributes merge rule so it uses the same "ours" strategy as the existing lockfile: update .gitattributes to include the entry "kai_mcp_solution_server/requirements-build.txt merge=ours" (placed alongside the existing "kai_mcp_solution_server/requirements.txt merge=ours") so both generated lock artifacts follow identical merge behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.gitattributes:
- Line 2: Remove the "merge=ours" attribute for the workflow path entry (the
".github/workflows/verify-requirements-txt.yml merge=ours" line) in
.gitattributes so CI workflow files are not forced to local content during
merges; instead either delete the attribute for that path or replace it with a
safer strategy (e.g., remove the line entirely or use a documented less
destructive merge strategy) to ensure upstream workflow/security updates aren’t
silently discarded.
In `@kai_mcp_solution_server/Makefile`:
- Around line 203-204: The Makefile invocation using "uvx --from pybuild-deps
pybuild-deps compile" must pin the pybuild-deps package to a fixed version so
regenerated requirements-build.txt is stable; update the Makefile (the rule
invoking uvx/pybuild-deps) to reference a specific version (e.g.,
pybuild-deps==<LOCKED_VERSION>) or add a PYBUILD_DEPS_VERSION variable and use
that in the uvx command, then regenerate and commit requirements-build.txt to
ensure future runs use the pinned pybuild-deps release.
In `@kai_mcp_solution_server/requirements-build.txt`:
- Around line 15-16: The requirements-build.txt contains conflicting duplicate
pins (e.g., package names cffi, hatchling, setuptools-scm, setuptools appear
with multiple versions), breaking hash-locked installs; regenerate or rebuild
the build lock so each package name is pinned only once (or split into separate
lock files per environment), remove or consolidate duplicate entries (keep the
intended version for cffi, hatchling, setuptools-scm, setuptools) and ensure
hashes match the chosen version; after regen, verify pip install
--require-hashes succeeds against the updated requirements-build.txt.
---
Nitpick comments:
In @.gitattributes:
- Around line 1-2: Add the build lockfile to the .gitattributes merge rule so it
uses the same "ours" strategy as the existing lockfile: update .gitattributes to
include the entry "kai_mcp_solution_server/requirements-build.txt merge=ours"
(placed alongside the existing "kai_mcp_solution_server/requirements.txt
merge=ours") so both generated lock artifacts follow identical merge behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 877d42a6-1137-4073-b19e-ae7128549968
📒 Files selected for processing (8)
.gitattributes.github/workflows/verify-requirements-txt.ymlkai_mcp_solution_server/Makefilekai_mcp_solution_server/requirements-build-constraints.txtkai_mcp_solution_server/requirements-build.txtkai_mcp_solution_server/requirements.txtkonflux.solution-server.Dockerfilescripts/post-sync.sh
b3e8e39 to
4efcddc
Compare
…ackend Regenerates requirements.txt with --generate-hashes (3766 lines, was 192) and adds requirements-build.txt (1045 lines, 65 build deps) generated by pybuild-deps for Hermeto/Konflux's permissive pip backend. Resolves the mta-solution-server side of KONFLUX-14150; pairs with the ART tooling work in openshift-eng/art-tools#3047. How the overlay survives upstream syncs: - .gitattributes marks requirements.txt + verify-requirements-txt.yml as merge=ours so upstream's unhashed copies don't fight the merge. - scripts/post-sync.sh runs `make regen-hermeto-requirements` after each upstream merge so the hashed file stays in step with pyproject.toml changes (no silent drift). Invoked by mta-sync's new hook (PR fabianvf/mta-sync#post-sync-hook). - verify-requirements-txt.yml CI workflow regenerates and diffs as a safety net for direct PRs and a first-sync backstop. requirements-build-constraints.txt pins meson==1.9.2 (latest sdist on PyPI; >=1.10 ships wheels only and pybuild-deps can't introspect wheels). Pulled in transitively as a build dep of meson-python → numpy. Update when a newer meson regains an sdist. konflux.solution-server.Dockerfile: uncomment the requirements-build.txt COPY, drop the stale /workspace/kai/ path segment. Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
4efcddc to
bcdc019
Compare
PR migtools/mta-kai#4 (merged to main) adds requirements-build.txt with build deps like setuptools needed for hermetic prefetch. rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Regenerates
kai_mcp_solution_server/requirements.txtwith--generate-hashesand addsrequirements-build.txtfor Hermeto's pip backend, so ART can exercise the new permissive-mode support (openshift-eng/art-tools#3047) against the solution-server. Resolves the mta-solution-server side of KONFLUX-14150.What's in the overlay
kai_mcp_solution_server/requirements.txtuv pip compile --generate-hashes(192 → 3766 lines)kai_mcp_solution_server/requirements-build.txtpybuild-deps compile --generate-hashes(1045 lines, 65 build deps)kai_mcp_solution_server/requirements-build-constraints.txtmeson==1.9.2— meson >=1.10 ships wheels only and pybuild-deps can't introspect wheelsscripts/post-sync.sh./scripts/post-sync.sh) regenerates both files. Invoked by Dylan'smta-syncpost-sync hook AND by the CI verify workflow.gitattributesmerge=oursforrequirements.txtand the verify workflow.github/workflows/verify-requirements-txt.yml./scripts/post-sync.sh+ diffkonflux.solution-server.Dockerfilerequirements-build.txtCOPYNote: deliberately did NOT add a
maketarget —kai_mcp_solution_server/Makefileis shared with upstream konveyor/kai, and a midstream-only target there pollutes theirmake helpoutput and adds merge-attack-surface. All regen logic lives inscripts/post-sync.sh(which is a net-new file invisible to upstream merges).How this stays in sync with konveyor/kai upstream
Dylan's
dymurray/mta-syncdoesgit merge konveyor/kai → migtools/mta-kai. Upstream keeps the unhashedrequirements.txt(theirverify-requirements-txt.ymlregenerates it viauv pip freeze— a fine fit for an unhashed convenience export, but incompatible with Hermeto). The two-piece overlay handles this without manual merge work:.gitattributes merge=ourskeeps midstream's hashedrequirements.txt(and our verify workflow) untouched ongit merge.scripts/post-sync.shruns after each successful sync via a new hook inmta-sync, regeneratingrequirements.txt+requirements-build.txtfrom the newly-mergedpyproject.tomlso dep bumps propagate. No drift.The
verify-requirements-txt.ymlworkflow's regen-and-diff is the safety net — if anyone bumps deps on this fork directly and forgets to regen, CI fails with the exact command to run.Merge-conflict / drift caveats
requirements.txt:merge=ours+scripts/post-sync.shkeep it both conflict-free AND in-step with upstream'spyproject.tomlchanges. No drift.verify-requirements-txt.yml:merge=ourskeeps it conflict-free, but it WILL slowly drift from upstream's copy — e.g. if konveyor bumpsactions/setup-python@v5→@v6, we won't auto-pick it up. That's acceptable because the two workflows are doing different things (upstream's verifies unhasheduv pip freezeoutput; ours verifies hasheduv pip compile+pybuild-depsoutput). Manual rebase or Dependabot can refresh Action versions periodically.Bootstrap window: until dymurray/mta-sync#1 merges and Dylan re-runs
clone.sh(which registers theoursmerge driver viagit config merge.ours.driver true), themerge=oursattribute is a no-op on his local clone. The first sync after this PR lands would conflict onrequirements.txtif upstream changed it in the meantime. Dylan resolves once withgit checkout --ours kai_mcp_solution_server/requirements.txt .github/workflows/verify-requirements-txt.yml && ./scripts/post-sync.sh, or runsgit config merge.ours.driver truein the kai clone first. After that, automated forever.meson constraint caveat
requirements-build-constraints.txtpinsmeson==1.9.2because >=1.10 publishes wheels only on PyPI and pybuild-deps errors on wheel-only sources. Pulled in transitively as a build dep of meson-python → numpy. When/if a newer meson regains an sdist, bump the pin and regen.Verification
uv pip install --dry-run --require-hashes -r requirements.txtresolves cleanly (3766 lines).requirements-build.txtis 65 pinned packages, every line carries--hash=sha256:.... (Note: this file legitimately contains duplicate pins for some packages — e.g.setuptools==81.0.0ANDsetuptools==82.0.1— because different runtime deps need different build-time setuptools versions. The file is consumed by Hermeto's prefetch, not bypip install -r.)verify-requirements-txt.ymlwill run on this PR and confirms the regen is reproducible.hermeto --mode permissive fetch-deps pipagainst this branch.cc @dymurray @ashwinsudhakaran
Refs: KONFLUX-14150, openshift-eng/art-tools#3047, dymurray/mta-sync#1