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

feat(yarn): ignore yarn-path if binary does not exist #12322

Merged
merged 6 commits into from Oct 28, 2021
Merged

feat(yarn): ignore yarn-path if binary does not exist #12322

merged 6 commits into from Oct 28, 2021

Conversation

dschaller
Copy link
Contributor

Changes:

This PR changes the behavior of the checkYarnrc function to validate that the binary pointed to by yarn-path exists before returning the path. If it does not exist the yarn-path is set to null.

Context:

If a repository does not include a yarn binary in its source code but does set a yarn-path (which can be used after running initialization scripts) the current behavior of this function will return the path which will not exist when renovate runs updates. This changes ensures that the path is valid, by ensuring the binary exists, before running updates.

See #12321 for more information

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Oct 26, 2021

CLA assistant check
All committers have signed the CLA.

@rarkins
Copy link
Collaborator

rarkins commented Oct 26, 2021

Have you tested this? I'm not sure this achieves what you expect. I think the new .yarnrc needs to be written to disk and not sure that's happening automatically.

@dschaller
Copy link
Contributor Author

@rarkins pushed an update that's been tested here

@dschaller
Copy link
Contributor Author

@rarkins thanks for the review! Pushed an update when you have a minute :)

@rarkins rarkins enabled auto-merge (squash) October 28, 2021 07:10
@rarkins rarkins merged commit 16aff74 into renovatebot:main Oct 28, 2021
@dschaller dschaller deleted the ignoreNonexistantYarnBinary branch October 28, 2021 07:20
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 28.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@busches
Copy link
Contributor

busches commented Oct 28, 2021

Shouldn't this error or at least warn the user a setting they set is being ignored?

@rarkins
Copy link
Collaborator

rarkins commented Oct 28, 2021

@busches sure, I'd accept a PR which includes a log warning if so

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants