[Refractor:System] Optimize install script: skip unneeded builds#12751
[Refractor:System] Optimize install script: skip unneeded builds#12751jndlansh wants to merge 6 commits into
Conversation
…arallelize vendor permissions
|
This PR removes ts/vue directory cleanup and also does not add rsync deletion mode, it then conditionally skips frontend build based on rsync output. |
|
thanks for pointing this out, I have addressed this issue |
|
I think your change for addressing the deleted fronted-file issue is solid. In #12692, the no-composer-change path narrowed permission updates to vendor/composer only to reduce repeated heavy traversal. In this PR, I see unconditional vendor-wide chmod again after the composer block. |
|
Now in sync with PR #12692, Vendor permissions now only traverse the full vendor directory when |
|
The frontend change detector seems incomplete. It is only checking site/ts/* , site/vue/* , site/package.json and site/vite.config , but the actual build also depends on vue-tsc and node.build.js from package.json . That would mean changes to tsconfig.json or build.js could still incorrectly skip the frontend is build. Rest I have also checked your fix for my previous concern and that looks solid to me. |
|
Great working with you on this. I don't find any other issue with this just the fact with this is maintainability. Bcoz maybe be in future if the frontend build starts depending on more files later, the trigger list will need updating. |
|
Thanks @GarvitKhandelwal31, you pointed some quality concerns and issues, hope the maintainers give it a review! |
|
Please resolve conflicts before we review this PR. |
|
Hi @dagemcn |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12751 +/- ##
=========================================
Coverage 21.64% 21.64%
Complexity 9654 9654
=========================================
Files 268 268
Lines 36244 36244
Branches 487 487
=========================================
Hits 7845 7845
Misses 27916 27916
Partials 483 483
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
I want to further iterate on this. The frontend build inputs are defined in one place but the rebuild trigger list is maintained in a different place, so every future build-input change requires manual sync in two locations. Fix that can be done-
|
…dd CI check to enforce required build-critical paths remain in sync
|
It makes sense. Now trigger paths are declared once and consumed by detection logic. Added respective CI check to It verify that the known build-critical paths are present in the trigger block. |
|
Unfortunately we're already working on an alternative solution for this and are not able to consider other contributions towards this goal at this time. |
Okay @williamjallen, that's alright! |
Why is this Change Important & Necessary?
The
submitty_install_sitebuild script was extremely slow due to several inefficiencies:find -exec chmodper-file (28,018 seconds on shared folders)-zwhich adds unnecessary CPU overheadThis optimization allows full reinstalls to complete in 96.6% less time when frontend files haven't changed (477s → 16s).
What is the New Behavior?
Key optimizations implemented:
site/ts/,site/vue/,site/package*.json/site/vite.config.*,site/.build.jsandsite/tsconfig.jsonfiles. Only run npm build if changes detected.find ... -exec chmodwithchmod -R+xargsbatch operations (28,000x speedup on shared folders)-zcompression flag (5s+ savings)--deleteto remove stale frontend source files from installation.Behavior changes:
npm installandnpm run buildphases are skipped (logs:"Skipping esbuild (no frontend changes detected)") and when no composer changes detected, vendor permissions limited tovendor/composeronlyWhat steps should a reviewer take to reproduce or test the bug or new feature?
Test 1: Verify skip behavior (no frontend changes)
Automated Testing & Documentation
Other information