fix: exclude node_modules and build artifacts from workspace uploads#391
Open
Praneeth16 wants to merge 1 commit intodatabricks-solutions:mainfrom
Open
fix: exclude node_modules and build artifacts from workspace uploads#391Praneeth16 wants to merge 1 commit intodatabricks-solutions:mainfrom
Praneeth16 wants to merge 1 commit intodatabricks-solutions:mainfrom
Conversation
…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
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.
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.EXCLUDED_DIRSinworkspace.py. Both_collect_filesand_collect_directoriesnow prune these from theos.walkupfront, so we never even enter those trees.4-deployment.mdto list which directories are auto-excluded and note thatdatabricks workspace import-dirdoesn't do this filtering (you'd need to clean the directory yourself).node_modules,venv,dist,buildexclusions in both file and directory collection.Test plan
pytest tests/unit/test_workspace.py— covers the new exclusionsnode_modulespresent, confirm it gets skippedThis pull request was AI-assisted by Isaac.