Skip to content

fix: exclude node_modules and build artifacts from workspace uploads#391

Open
Praneeth16 wants to merge 1 commit intodatabricks-solutions:mainfrom
Praneeth16:fix/exclude-node-modules-from-deploy
Open

fix: exclude node_modules and build artifacts from workspace uploads#391
Praneeth16 wants to merge 1 commit intodatabricks-solutions:mainfrom
Praneeth16:fix/exclude-node-modules-from-deploy

Conversation

@Praneeth16
Copy link
Copy Markdown
Contributor

Summary

  • upload_folder() and _collect_files() only filtered hidden files and __pycache__. Everything else — node_modules, venv, dist, build — got uploaded during app deploys. That's why the first upload pass was painfully slow; thousands of dependency files went up before the deployment framework realized it didn't need them.
  • Added EXCLUDED_DIRS in workspace.py. Both _collect_files and _collect_directories now prune these from the os.walk upfront, so we never even enter those trees.
  • Updated 4-deployment.md to list which directories are auto-excluded and note that databricks workspace import-dir doesn't do this filtering (you'd need to clean the directory yourself).
  • Added unit tests for node_modules, venv, dist, build exclusions in both file and directory collection.

Test plan

  • pytest tests/unit/test_workspace.py — covers the new exclusions
  • Existing workspace upload tests still pass
  • Deploy an app with node_modules present, confirm it gets skipped

This pull request was AI-assisted by Isaac.

…e uploads

The upload_folder() and _collect_files() functions were only filtering out
hidden files and __pycache__. This meant node_modules, venv, dist, build,
and other dependency/build directories got uploaded during app deployments,
causing unnecessary slowdowns on the initial upload pass.

Added an EXCLUDED_DIRS set that both _collect_files and _collect_directories
use to prune the walk early, so os.walk never descends into these trees.
Updated deployment docs to document the behavior.

Co-authored-by: Isaac
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