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

Yarn v2/v3 zero-install file permissions are changed #6081

Closed
agrobbin opened this issue Nov 8, 2022 · 11 comments · Fixed by #11760
Closed

Yarn v2/v3 zero-install file permissions are changed #6081

agrobbin opened this issue Nov 8, 2022 · 11 comments · Fixed by #11760
Labels
L: javascript:yarn npm packages via yarn T: bug 🐞 Something isn't working

Comments

@agrobbin
Copy link

agrobbin commented Nov 8, 2022

When doing zero-installs on Yarn v2/v3, the .pnp.cjs file permission is changed by Dependabot from 755 to 644.

@pavera to ensure this subtle bug is not lost, I thought it'd make sense to create a separate issue for it.

Originally posted by @agrobbin in #5946 (comment)

@pavera
Copy link
Contributor

pavera commented Nov 8, 2022

Are you still seeing this behavior @agrobbin? Before closing the previous issue I had deployed the changes discussed there where we are now using --mode=skip_build instead of yarn config set enableScripts false to attempt to preserve these permissions. If that didn't work we'll have to investigate why and come up with a different solution.

@agrobbin
Copy link
Author

agrobbin commented Nov 8, 2022

@pavera unfortunately I'm still seeing the changes in some Dependabot PRs issued this morning.

@pavera
Copy link
Contributor

pavera commented Nov 8, 2022

Some but not all? That would seem to indicate that our detection of zero installs is non-deterministic somehow. If we detect zero-install (by the presence of a .pnp.cjs file in the repo) we use skip-build otherwise we do fall back to using the enableScripts setting. I'll need to investigate further how this might be failing.

@agrobbin
Copy link
Author

agrobbin commented Nov 8, 2022

Sorry, what I meant to say was "in all Dependabot PRs issued this morning". My use of the word "some" was meant to indicate that I got several Dependabot PRs, all of which had this issue. Sorry for the confusion!

@pavera
Copy link
Contributor

pavera commented Nov 8, 2022

OK, so skip-build doesn't seem to preserve the permissions in that case. I'll have to test more and try to find a solution, thanks for creating this issue so it's not lost.

@agrobbin
Copy link
Author

agrobbin commented Nov 8, 2022

No problem! Please let me know if there is anything I can do to help debut the issue further.

@jeffwidman jeffwidman added T: bug 🐞 Something isn't working L: javascript:npm npm packages via npm labels Nov 8, 2022
@pavera pavera added L: javascript:yarn npm packages via yarn and removed L: javascript:npm npm packages via npm labels Nov 9, 2022
@pavera
Copy link
Contributor

pavera commented Nov 15, 2022

I've found the issue here, we set the mode on all files as part of the PR creation.

Working on a solution now.

@pavera
Copy link
Contributor

pavera commented Dec 1, 2022

I've deployed the fix for this and verified it works in our test repos. Closing this issue, but if this is still occurring please reopen.

@pavera pavera closed this as completed Dec 1, 2022
@agrobbin
Copy link
Author

agrobbin commented Dec 1, 2022

Thanks @pavera! I will confirm the next time Dependabot updates a Yarn dependency.

@agrobbin
Copy link
Author

agrobbin commented Dec 2, 2022

@pavera just to confirm, this seems to have done the trick! Really appreciate all of your follow-up work on Yarn Berry Dependabot support.

@agrobbin
Copy link
Author

@pavera I'm sorry to resurrect this issue, but I have started seeing this issue again on one of my repositories. I haven't been able to deduce a pattern, yet, but if there's anything I can do to help debug it, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: javascript:yarn npm packages via yarn T: bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants