[Refactor] Fix incorrect Promise.all usage in app preDeployValidation#7540
[Refactor] Fix incorrect Promise.all usage in app preDeployValidation#7540gonzaloriestra wants to merge 1 commit into
Conversation
Corrected the Promise.all([this.allExtensions.map(...)]) anti-pattern to properly await extension validations. Added a regression test to ensure that rejections in extension validation are correctly caught by the app's preDeployValidation method.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
WHY are these changes introduced?
Fixes an anti-pattern where
Promise.allwas called with an array containing another array (the result ofmap). This caused the inner promises to be ignored and thepreDeployValidationto resolve immediately without waiting for actual extension validations to complete.WHAT is this pull request doing?
Promise.all([array.map(...)])toPromise.all(array.map(...))inpackages/app/src/cli/models/app/app.ts.packages/app/src/cli/models/app/app.test.tsto ensure extension validations are properly awaited and rejections are caught.How to test your changes?
Run the newly added test case:
pnpm --filter @shopify/app vitest run src/cli/models/app/app.test.tsDuplicate check
I ran the following query:
git log --grep="\[Refactor\]" --oneline -n 20(sinceghis missing)Closest PRs:
f6849391e [Security] Sanitize Cookie headers in debug logs(This is a security fix in a different package, unrelated to this logic refactor).No other Jules-labeled Refactor PRs were found targeting this file or addressing this Promise anti-pattern.
Checklist
patch) and added a changeset withpnpm changeset add(Note: Changeset skipped to avoid modifying files outside of the immediate fix scope per agent constraints).PR created automatically by Jules for task 11540683829797935190 started by @gonzaloriestra