Skip to content

Comments

feat: integrate serverless-prune-plugin functionality#13244

Merged
czubocha merged 1 commit intomainfrom
sc-3719
Jan 15, 2026
Merged

feat: integrate serverless-prune-plugin functionality#13244
czubocha merged 1 commit intomainfrom
sc-3719

Conversation

@czubocha
Copy link
Contributor

@czubocha czubocha commented Jan 13, 2026

Summary

This PR integrates the serverless-prune-plugin directly into the Serverless Framework core as a bundled plugin. This migration improves the developer experience by providing built-in Lambda version management without requiring external dependencies.

Key Changes

🚀 Core Integration

  • New Core Plugin: Implemented Prune core plugin in packages/serverless/lib/plugins/prune/index.js.
  • ESM Transition: Converted the original CommonJS codebase to ES Modules.
  • Async/Await: Replaced all bluebird promises with native async/await and Promise methods.
  • Plugin Manager Integration: Registered the plugin in plugin-manager.js as a core-bundled plugin. The prune command is now always available.
  • Schema Validation: Defined a full JSON schema for custom.prune configuration (automatic, number, includeLayers).

📚 Documentation

  • New Usage Guide: Created a comprehensive Version Pruning Guide (docs/sf/providers/aws/guide/prune.md).
  • New CLI Reference: Created CLI Reference for Prune (docs/sf/providers/aws/cli-reference/prune.md).
  • Navigation Update: Added "Version Pruning" to the documentation menu.

🧪 Testing & Verification

  • Jest Test Suite: Migrated the original Mocha suite to a native Jest suite with 33 comprehensive tests.
    • Passes with 100% success: npm run test:unit -- test/unit/lib/plugins/prune/index.test.js
  • Manual Verification: Verified serverless prune command and automatic pruning after deployment using a real AWS test service.
  • Security: Passed Snyk Code scan with 0 issues.

Verification Results

Unit Tests

PASS test/unit/lib/plugins/prune/index.test.js
Test Suites: 1 passed, 1 total
Tests:       33 passed, 33 total

Manual CLI Test (Dry-run)

$ serverless prune -n 3 --dryRun --verbose
Dry-run enabled, no pruning actions will be performed.
✔ Pruning of functions complete

@czubocha czubocha requested a review from eahefnawy January 13, 2026 20:19
@Mmarzex
Copy link
Contributor

Mmarzex commented Jan 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@czubocha czubocha merged commit 372463b into main Jan 15, 2026
10 checks passed
@czubocha czubocha deleted the sc-3719 branch January 15, 2026 13:54
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants