Skip to content

ENG-7746: include assets in backend.zip#5814

Merged
adhami3310 merged 1 commit into
mainfrom
khaleel/eng-7746-include-assets-directory-in-backendzip
Sep 22, 2025
Merged

ENG-7746: include assets in backend.zip#5814
adhami3310 merged 1 commit into
mainfrom
khaleel/eng-7746-include-assets-directory-in-backendzip

Conversation

@adhami3310

Copy link
Copy Markdown
Member

No description provided.

@linear

linear Bot commented Sep 22, 2025

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. CLI Interface: New --exclude-from-backend option added to both export and deploy commands in reflex.py. This option accepts multiple file/directory paths and validates their existence.

  2. Parameter Threading: A new backend_excluded_dirs parameter flows through the export pipeline from CLI β†’ reflex.py β†’ utils/export.py β†’ utils/build.py, maintaining the tuple structure throughout.

  3. Core Logic Changes: The _zip function in utils/build.py undergoes 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)

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.py for the core exclusion logic changes and potential performance impacts

3 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@codspeed-hq

codspeed-hq Bot commented Sep 22, 2025

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #5814 will not alter performance

Comparing khaleel/eng-7746-include-assets-directory-in-backendzip (4566360) with main (4468e14)

Summary

βœ… 8 untouched

@adhami3310 adhami3310 merged commit 47f3ee4 into main Sep 22, 2025
41 checks passed
@adhami3310 adhami3310 deleted the khaleel/eng-7746-include-assets-directory-in-backendzip branch September 22, 2025 21:54
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.

2 participants