Skip to content

chore(renovate): canary — pip-compile manager regenerates requirements.lock (Workflows only) - #2411

Merged
stranske merged 1 commit into
mainfrom
canary/renovate-pip-compile-manager
Jun 15, 2026
Merged

chore(renovate): canary — pip-compile manager regenerates requirements.lock (Workflows only)#2411
stranske merged 1 commit into
mainfrom
canary/renovate-pip-compile-manager

Conversation

@stranske

@stranske stranske commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Goal

Close the lock-regen gap going forward: Renovate does not touch uv pip compile requirements.lock files by default, so every Renovate dep bump leaves the lock stale — and the reusable Python CI installs -r requirements.lock (reusable-10-ci-python.yml), so stale = CI silently installs old deps. (The already-stale lock was fixed in #2404.)

Chosen mechanism: Renovate's pip-compile manager, so Renovate regenerates the lock in its own commit. This keeps platformAutomerge intact — unlike a CI workflow committing back, which marks the branch "modified" and (with a GITHUB_TOKEN push) does not re-trigger the required summary gate check, stalling auto-merge.

CANARY scope

Workflows' own renovate.json only — NOT the shared fleet preset. Prove it here (dogfood), then promote the pip-compile block into renovate-presets/fleet.json for the fleet.

Validated in-session (local renovate@43 --dry-run against this branch)

  • ✅ pip-compile manager matches requirements.lock, parses the uv header, and builds the correct source graph (pyproject.toml, requirements.txtrequirements.lock).
  • Equals-form header is required. Renovate's pip-compile parser rejects uv's default space form (--python-version 3.12, --extra dev) with "Option … must have equal sign" and silently skips the lock. Fix: regenerated with full equals form (--python-version=3.12 --extra=dev --extra=langchain --output-file=…) — content byte-identical — and updated maint-51 (the scheduled refresher that runs on Workflows) to emit equals form so it doesn't revert the header.
  • ℹ️ Benign warnings only: setuptools/wheel "not found in lock" (build-backend deps, not in the resolved lock by design).
  • pip_requirements disabled for requirements.txt only (it's a pip-compile source — Renovate docs say disable source managers to avoid duplicate PRs). tools/requirements-llm.txt keeps pip_requirements (standalone LLM pins, not a lock source).

Open follow-ups (before fleet promotion)

  1. maint-51 --upgrade: maint-51 still passes --upgrade, which lands in the lock header on its next run (Jul 1). Verify Renovate's pip-compile parser tolerates --upgrade (and that its regen doesn't inherit it), or replace maint-51 with Renovate lockFileMaintenance (the pip-compile manager supports it) and retire the now-redundant scheduled refresher.
  2. pep621 overlap (watch live): pyproject.toml is also managed by pep621. Workflows' pyproject uses ranges for runtime (langchain) — Renovate won't bump those, so no overlap there — but pinned, non-excluded dev tools (pre-commit, flake8) live in both pyproject and the lock and could draw duplicate proposals. Confirm on the first live Renovate pip bump; if duplicates appear, scope pep621 for pyproject.toml similarly.
  3. Fleet promotion: once 1–2 are clean, move the pip-compile block + the equals-form generator fix into renovate-presets/fleet.json and update the consumer-side generators (incl. maint-69 integration-repo). Gate consumer rollout on each repo being on Renovate.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved dependency refresh workflow configuration for better stability and clarity
    • Enhanced dependency management bot configuration to streamline lockfile handling and prevent redundant operations

…quirements.lock

Renovate doesn't touch uv-pip-compile `requirements.lock` files by default,
so Renovate-driven dep bumps leave the lock stale (the reusable Python CI
installs `-r requirements.lock`). Enable Renovate's pip-compile manager so it
regenerates the lock IN its own PR/commit — which keeps platformAutomerge
intact (unlike a CI workflow committing back, which marks the branch modified
and a GITHUB_TOKEN push doesn't re-trigger the required gate check).

CANARY scope: Workflows' own renovate.json only (NOT the shared fleet preset).
Promote the pip-compile block into renovate-presets/fleet.json once proven.

Key gotcha (found via local `renovate --dry-run`): Renovate's pip-compile
manager parses the lock header and requires EVERY option in equals form
(`--python-version=3.12`, `--extra=dev`, `--output-file=...`); uv's default
space form ("--extra dev") makes it throw "Option ... must have equal sign"
and silently skip the lock. Regenerated the lock with full equals form
(content byte-identical) and updated maint-51 (the scheduled refresher that
runs on Workflows) to emit equals form so it doesn't revert the header.

pip_requirements is disabled for requirements.txt only (it's a pip-compile
source — Renovate docs: disable source managers to avoid duplicate PRs);
tools/requirements-llm.txt keeps pip_requirements (standalone LLM pins).

Open follow-ups (see PR body): maint-51 still passes `--upgrade`, which lands
in the header; verify Renovate's regen ignores it or replace maint-51 with
Renovate lockFileMaintenance. pep621/pip-compile overlap on pyproject.toml is
untested (no pending pip bump) — watch the first live Renovate pip update.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The uv pip compile call in the lockfile refresh workflow is updated from the short -o flag to --output-file=requirements.lock. The inline verification script's comment-detection pattern is updated to match the new full flag set. renovate.json gains a pip-compile manager entry for requirements.lock and a packageRules override that disables the pip_requirements manager for requirements.txt.

Changes

requirements.lock pipeline: workflow and Renovate alignment

Layer / File(s) Summary
uv pip compile flag and verification script
.github/workflows/maint-51-dependency-refresh.yml
The compile step switches from -o requirements.lock to --output-file=requirements.lock. The lockfile-alignment verification script updates its hardcoded autogenerated-comment pattern to include --extra=dev, --extra=langchain, and --output-file=requirements.lock so the new header line is correctly detected and skipped.
Renovate pip-compile manager and deduplication rule
renovate.json
Adds a pip-compile manager block with managerFilePatterns targeting requirements.lock and a packageRules entry disabling pip_requirements for requirements.txt to avoid duplicate update PRs. The top-level description is expanded to document the CANARY behavior and lock regeneration approach.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • stranske/Workflows#2404: Directly targets the same requirements.lock refresh and pytest pin reconciliation process that this PR's workflow and Renovate changes manage.
  • stranske/Workflows#2386: Also modifies renovate.json to extend a shared fleet preset, overlapping at the same Renovate config file level.
  • stranske/Workflows#2385: Introduces the root renovate.json Renovate setup that this PR further refines for pip-compile/requirements.lock handling.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: enabling Renovate's pip-compile manager to regenerate requirements.lock in the Workflows configuration as a canary deployment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch canary/renovate-pip-compile-manager

Comment @coderabbitai help to get the list of available commands and usage tips.

@stranske-keepalive

Copy link
Copy Markdown
Contributor

Workflow source needed

PR #2411 needs either a linked GitHub issue or one valid non-issue Workflow Source before PR metadata automation can manage it safely.

Please do one of:

  • Add <!-- meta:issue:123 --> or a normal Closes #123 / Related to #123 line.
  • Check one Workflow Source option in the PR body.
  • Add a hidden marker such as <!-- workflow-source:local_request -->, <!-- workflow-source:manual_remote -->, <!-- workflow-source:review_followup -->, <!-- workflow-source:sync_campaign -->, or <!-- workflow-source:dependabot -->.
  • Add a workflow source label such as workflow:source-direct-pr, workflow:source-local-request, workflow:source-review-followup, workflow:source-sync, or workflow:no-automation.

Once a valid source is present, this warning will not be reposted.

@stranske
stranske temporarily deployed to agent-high-privilege June 15, 2026 06:11 — with GitHub Actions Inactive
@stranske-keepalive

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: 665304a
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske
stranske merged commit 2ff3f3d into main Jun 15, 2026
45 of 46 checks passed
@stranske
stranske deleted the canary/renovate-pip-compile-manager branch June 15, 2026 06:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 058b4d5d72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread renovate.json
Comment on lines +11 to +13
"matchManagers": ["pip_requirements"],
"matchFileNames": ["requirements.txt"],
"enabled": false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable pep621 for the pip-compile source too

Because this canary makes requirements.lock a pip-compile output whose header names both pyproject.toml and requirements.txt as sources, suppressing only pip_requirements still leaves Renovate's default pep621 manager running independently on pyproject.toml. Renovate's pip-compile docs say source managers should be disabled to avoid running the same source twice; in this repo pre-commit==4.6.0/flake8==7.3.0 are non-excluded optional-dependency pins, so a pep621-only bump can still change pyproject.toml without regenerating requirements.lock, recreating the stale-lock PRs this change is meant to prevent. Add a scoped pep621 disable for pyproject.toml (or exclude those pins) alongside this rule.

Useful? React with 👍 / 👎.

stranske added a commit that referenced this pull request Jun 15, 2026
…tenance (#2413)

Renovate's pip-compile manager (enabled on requirements.lock via the canary
renovate.json #2411 + fleet preset #2406) already owns periodic lock
regeneration: supportsLockFileMaintenance=true and its defaultConfig enables
lockFileMaintenance by default (branchTopic `pip-compile-refresh`), recompiling
the lock from scratch on a schedule. That makes maint-51-dependency-refresh.yml's
scheduled `uv pip compile --upgrade` a duplicate refresher (and it had failed
every run since ~March until #2404). Retire it.

Verified the feared `--upgrade`-in-header risk does NOT exist:
- uv omits `--upgrade` from the recorded lock header (empirically: compiles with
  and without `--upgrade` produce byte-identical headers).
- Even if it appeared, Renovate's pip-compile header parser (common.ts
  throwForUnknownOption) would throw `Option --upgrade not supported (yet)` and
  skip the file; it never re-runs a mass `--upgrade` (per-dep bumps are scoped
  via `--upgrade-package` in artifacts.ts).

maint-51's other steps remain covered: sync_test_dependencies.py --verify runs in
reusable-10-ci-python on every PR; dev-tool pin alignment is enforced on schedule
by maint-auto-update-pypi-versions + maint-sync-env-from-pyproject (--apply).

- delete .github/workflows/maint-51-dependency-refresh.yml
- drop its EXPECTED_NAMES entry in tests/workflows/test_workflow_naming.py
- remove it from docs/ci/WORKFLOWS.md (link guard), WORKFLOW_SYSTEM.md,
  WORKFLOW_GUIDE.md, DEPENDENCY_TESTING.md; document lockFileMaintenance
  ownership in renovate.json

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant