Repository navigation
feat(manager/poetry): pass POETRY_SOLVER_MIN_RELEASE_AGE to Poetry when minimumReleaseAge is configured
#43428
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Overview
This is a suggested sub-feature of #41652.
When
minimumReleaseAgeis configured in Renovate, Poetry invocations during lock file updates should set thePOETRY_SOLVER_MIN_RELEASE_AGEenvironment variable so that Poetry's solver also enforces the age constraint on all resolved packages, including transitive dependencies.Background
Poetry 2.4.0 introduced
solver.min-release-age, which prevents the solver from considering package versions uploaded more recently than the specified number of days.The equivalent environment variable is
POETRY_SOLVER_MIN_RELEASE_AGE(integer, days).Without this integration, Renovate's
minimumReleaseAgeonly guards direct dependencies that Renovate proposes.When Poetry regenerates
poetry.lock, it can silently pull in brand-new transitive dependencies with no age filter, leaving a supply chain attack surface.Proposed changes
When
minimumReleaseAgeis configured:ceil(toMs(minimumReleaseAge) / 1 day)[tool.poetry.solver] min-release-agefrompyproject.tomlif presentPOETRY_SOLVER_MIN_RELEASE_AGEto the stricter (larger) of the two valuespoetry update --lockinvocations (both regular updates andlockFileMaintenance)Notes
>=2.4.0pyproject.tomlhasmin-release-ageand Renovate has nominimumReleaseAge, no env var is set — Poetry reads the value frompyproject.tomldirectly, so behavior is unchangedsolver.min-release-age-excludeandsolver.min-release-age-exclude-sourceare out of scope — Poetry reads them frompyproject.tomlautomatically and they are unaffected by the env varAll reactions