Skip to content

Prune older function versions#278

Open
mnapoli wants to merge 7 commits into
4.xfrom
prune-function-versions
Open

Prune older function versions#278
mnapoli wants to merge 7 commits into
4.xfrom
prune-function-versions

Conversation

@mnapoli
Copy link
Copy Markdown
Contributor

@mnapoli mnapoli commented May 19, 2026

This replaces https://github.com/claygregory/serverless-prune-plugin and makes it a first class feature.

This implementation contains less options though and goes directly in provider:

provider:
  pruneFunctionVersions: true # keeps 10 versions per default

or

provider:
  pruneFunctionVersions:
    number: 20

Pruning is automatic on deployment.

It is disabled by default so no breaking change, it's completely opt-in.

mnapoli added 7 commits May 19, 2026 23:02
Reject unparseable configuration instead of silently disabling pruning.
The option is not part of osls and never reached this code path.
Compare alias and version qualifiers as strings so numeric alias
versions are not pruned by mistake.
Mirror compile-time versioning rules so unversioned functions are left
untouched after deploy.
Report how many function and layer versions were removed instead of
always printing a completion message after deploy.
@GrahamCampbell GrahamCampbell self-requested a review May 19, 2026 21:20
@mnapoli mnapoli marked this pull request as ready for review May 19, 2026 21:25
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