Skip to content

Conversation

@matejchalk
Copy link
Collaborator

@matejchalk matejchalk commented Apr 25, 2025

Received an error report from customer with large Nx monorepo and GitLab CI/CD. Although nx run-many -t code-pushup command succeeded on all their projects, there was an Nx project graph error when trying to read their report files by running many nx run <project>:code-pushup --skipNxCache -- print-config --output=code-pushup.<random>.config.json processes in parallel (implementation uses Promise.all). It appears that Nx struggles to process all these commands at once.

CI logs

image

image

image

image

Changed implementation so that print-config is run sequentially for each project. It should be a relatively fast command (doesn't execute plugin runners), so it shouldn't have a noticeable impact on overall performance.

Also added a helper function to make sequential promises as easy to use as Promise.all - reduce with async accumulator is quite verbose. I decided to call it asyncSequential, but feel free to suggest a better name.

@github-actions
Copy link
Contributor

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit ee554e5 with previous commit ba5d177.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🟡 52 🔴 48 ↓ −3.2
Code coverage 🟢 90 🟢 90 ↑ +0.1
Documentation 🔴 23 🔴 23 ↓ −0.1
Security 🟡 62 🟡 62
Updates 🟡 84 🟡 84
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 1 group improved, 👎 2 groups regressed, 👍 5 audits improved, 👎 4 audits regressed, 10 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🟡 52 🔴 48 ↓ −3.2
Code coverage Code coverage metrics 🟢 90 🟢 90 ↑ +0.1
JSDoc coverage Documentation coverage 🔴 23 🔴 23 ↓ −0.1

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟩 Root document took 480 ms 🟥 Root document took 720 ms ↑ +48.5 %
Lighthouse Speed Index 🟥 5.9 s 🟥 6.6 s ↑ +12.1 %
Lighthouse Largest Contentful Paint 🟨 3.5 s 🟨 3.9 s ↑ +11 %
Lighthouse First Contentful Paint 🟨 2.9 s 🟨 2.7 s ↓ −6 %
Lighthouse Time to Interactive 🟥 13.3 s 🟥 12.5 s ↓ −5.7 %
JSDoc coverage Functions coverage 🟥 455 undocumented functions 🟥 456 undocumented functions ↑ +0.2 %
Code coverage Line coverage 🟨 89.8 % 🟨 89.8 % ↑ +0.1 %
Code coverage Function coverage 🟩 92.8 % 🟩 92.8 % ↑ +0.1 %
Code coverage Branch coverage 🟨 85.9 % 🟨 85.9 % ↑ +0.1 %
Lighthouse Minimizes main-thread work 🟥 15.2 s 🟥 13.9 s ↓ −8.4 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 1,831 KiB 🟩 Total size was 1,829 KiB ↓ −0.1 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −5.7 %
Lighthouse Uses efficient cache policy on static assets 🟨 30 resources found 🟨 30 resources found ↓ −0.1 %
Lighthouse Max Potential First Input Delay 🟥 2,380 ms 🟥 1,680 ms ↓ −29.6 %
Lighthouse JavaScript execution time 🟥 6.4 s 🟥 5.9 s ↓ −8.8 %
Lighthouse Eliminate render-blocking resources 🟥 Potential savings of 1,180 ms 🟥 Potential savings of 680 ms ↓ −42.7 %
Lighthouse Total Blocking Time 🟥 3,210 ms 🟥 3,270 ms ↑ +1.8 %
Lighthouse Server Backend Latencies 🟩 150 ms 🟩 210 ms ↑ +35.6 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 20 ms ↑ +42.2 %

586 other audits are unchanged.

@matejchalk matejchalk merged commit 85ff390 into main Apr 28, 2025
18 checks passed
@matejchalk matejchalk deleted the ci-print-config-sequentially branch April 28, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants