Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add concurrency flag #998

Merged

Conversation

nemanjatesic
Copy link
Contributor

@nemanjatesic nemanjatesic commented Oct 14, 2024

This pull request introduces a new concurrency flag to the Beachball package, updates dependencies, and refactors the publish command tests to support concurrency. Additionally, it includes new tests for the getPackageGraph function.

New Feature:

  • Added concurrency flag to the Beachball package, by default it is set to 1 to keep backwards compatibility with previous behavior while we test new behavior.

Dependency Updates:

  • Added p-graph dependency for running publishing command and hooks in parallel but in order of dependency graph.

New Tests:

  • Added comprehensive tests for getPackageGraph in getPackageGraph.test.ts to validate package sorting and handling of dependencies.
  • Added E2E tests for publish command to validate all existing scenarios for both concurrency being 1 and greater.

Refactoring:

  • Modified callHook function to take in concurrency as a parameter and made it so that if concurrency is 1 we will use the old behavior (doing a for loop for each package) and if concurrency is greater then 1, will be using getPackageGraph function to create a p-graph and run the hook in parallel.
  • Modified toposortPackages function to extract the logic of creating the dependencyGraph so that it can be reused between toposortPackages and getPackageGraph functions.
  • Modified publishToRegistry function to use getPackageGraph function to create a p-graph and run the publish command in parallel when concurrency is greater than 1 and default to old behavior when concurrency is 1

@kenotron kenotron merged commit d97e089 into microsoft:master Nov 5, 2024
4 checks passed
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.

3 participants