fix(ci): prevent parallel print-config commands#992
Merged
matejchalk merged 2 commits intomainfrom Apr 28, 2025
Merged
Conversation
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👍 1 group improved, 👎 2 groups regressed, 👍 5 audits improved, 👎 4 audits regressed, 10 audits changed without impacting score🗃️ Groups
18 other groups are unchanged. 🛡️ Audits
586 other audits are unchanged. |
vmasek
approved these changes
Apr 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Received an error report from customer with large Nx monorepo and GitLab CI/CD. Although
nx run-many -t code-pushupcommand succeeded on all their projects, there was an Nx project graph error when trying to read their report files by running manynx run <project>:code-pushup --skipNxCache -- print-config --output=code-pushup.<random>.config.jsonprocesses in parallel (implementation usesPromise.all). It appears that Nx struggles to process all these commands at once.CI logs
Changed implementation so that
print-configis 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-reducewithasyncaccumulator is quite verbose. I decided to call itasyncSequential, but feel free to suggest a better name.