ENG-7746: include assets in backend.zip#5814
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR implements ENG-7746 by adding configurable control over what files and directories are included in backend.zip exports. Previously, the 'assets' directory was hard-coded to be excluded from all backend zip exports. This change removes that restriction and introduces a new CLI option --exclude-from-backend that allows users to selectively exclude specific files or directories.
The implementation adds three main components:
-
CLI Interface: New
--exclude-from-backendoption added to bothexportanddeploycommands inreflex.py. This option accepts multiple file/directory paths and validates their existence. -
Parameter Threading: A new
backend_excluded_dirsparameter flows through the export pipeline from CLI βreflex.pyβutils/export.pyβutils/build.py, maintaining the tuple structure throughout. -
Core Logic Changes: The
_zipfunction inutils/build.pyundergoes significant refactoring:- Removes hard-coded exclusion of 'assets' directory from
top_level_dirs_to_exclude - Switches from string-based to Path object handling
- Implements more robust file exclusion using
samefile()method for better path resolution - Renames parameters for clarity (e.g.,
upload_db_fileβinclude_db_file)
- Removes hard-coded exclusion of 'assets' directory from
This change enables assets to be included in backend deployments by default while providing users the flexibility to exclude specific directories when needed. The refactoring also modernizes path handling throughout the export system, making it more robust for symbolic links and complex path scenarios.
Confidence score: 3/5
- This PR introduces a significant behavioral change that could affect deployment workflows and increase zip file sizes
- Score reflects concerns about the removal of hard-coded assets exclusion without clear migration guidance for existing users
- Pay close attention to
reflex/utils/build.pyfor the core exclusion logic changes and potential performance impacts
3 files reviewed, no comments
CodSpeed Performance ReportMerging #5814 will not alter performanceComparing Summary
|
No description provided.