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

Run YarnUpdate only once for a version requirement #4409

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

AlekhyaYalla
Copy link
Contributor

@AlekhyaYalla AlekhyaYalla commented Nov 15, 2021

Issue: #4288

Currently, For a mono repo, when UpdateDependencyFiles is called for generating the lock file content, dependencies param is passed to it. Dependencies param contains the dep that needs to be updated in all required workspaces in the repo.

As far as observed, the multiple package.json (multiple requirements) for a dependency are getting passed for a mono repo., where it does have only a single yarn.lock file.
In this case, it's not necessary to run yarn update for each and every package.json or requirement if all are referring to same version.
For a single version, if run once, yarn.lock would be generated, and running the same version yarn update would result in repetition of the task.
In case if each package.json is referring to different versions of that dependency, this code would handle that by running yarn update accordingly.

@jurre
Copy link
Member

jurre commented Nov 15, 2021

Thanks @AlekhyaYalla, could you add some context on what this change does and how it works exactly?

Is there any additional test coverage that you think we could introduce around this?

@AlekhyaYalla
Copy link
Contributor Author

Thanks @AlekhyaYalla, could you add some context on what this change does and how it works exactly?

@jurre Updated the description of the PR. My bad I missed it earlier. I hope the description is setting some context about the fix

Is there any additional test coverage that you think we could introduce around this?

Yes, I will add additional unit test cases for this change.

@AlekhyaYalla
Copy link
Contributor Author

@jurre Could you please review this change and suggest if any changes are required on this?

Co-authored-by: Jurre <[email protected]>
@jurre jurre merged commit f74894a into dependabot:main Nov 22, 2021
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.

2 participants