Fix Preview site and Push size validation to exclude archived-out directories - #2598
Merged
epeicher merged 1 commit intoFeb 18, 2026
Conversation
The size validation was rejecting sites that included large .git or node_modules directories inside wp-content, even though those directories are filtered out during archive creation. This extracts the exclusion logic into a shared isExcludedFromArchive function and applies it consistently in both the size calculation and the archive step.
epeicher
commented
Feb 17, 2026
| **Dev/Build**: `npm start` | `npm run cli:build` | `node dist/cli/main.js` | ||
| **Test**: `npm test [-- path/to/test.test.ts]` | `npm run e2e` | ||
| **Quality**: `npm run lint` | `npx prettier --write <files>` (format ONLY modified files) | ||
| **IMPORTANT - Post-Change Verification**: After applying code changes, always run the linter (`npm run lint`), format modified files (`npx prettier --write <files>`), and run relevant tests (`npm test [-- path/to/test]`) before considering the work complete. |
Contributor
Author
There was a problem hiding this comment.
I added this as the coding agent was including changes with linting errors
epeicher
commented
Feb 17, 2026
| * @returns A promise that resolves to the total size in bytes | ||
| */ | ||
| export function calculateDirectorySize( directoryPath: string ): Promise< number > { | ||
| export function calculateDirectorySizeForArchive( directoryPath: string ): Promise< number > { |
Contributor
Author
There was a problem hiding this comment.
Renaming this was not strictly required, but I think it better resembles that the directory size has some excluded folders
Collaborator
📊 Performance Test ResultsComparing ff8b180 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
ivan-ottinger
approved these changes
Feb 18, 2026
Contributor
Author
|
Thanks for your review and thorough testing, including before/after screenshots @ivan-ottinger! |
epeicher
deleted the
stu-1303-investigate-preview-size-limit-and-node_modules-exclusion
branch
February 18, 2026 11:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Related issues
Proposed Changes
.git,node_modules) into a sharedisExcludedFromArchivefunction incommon/lib/fs-utils.tscalculateDirectorySizeForArchive(renamed fromcalculateDirectorySize) so size validation matches what actually gets archivedcli/lib/archive.tsinstead of inline string checksAGENTS.mdTesting Instructions
node_modulesdirectory insidewp-content/plugins/. For example, you can clone the Gutenberg repo intowp-content/pluginsand runnvm use && npm installtherewp-contentsize exceeds 2GB but the size withoutnode_modules/.gitis under 2GBnode_modules)Pre-merge Checklist