fix: Solve bug when changing permissions with no modification right#4107
fix: Solve bug when changing permissions with no modification right#4107pkrog wants to merge 7 commits intomamba-org:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4107 +/- ##
==========================================
+ Coverage 51.21% 51.23% +0.02%
==========================================
Files 239 239
Lines 28669 28677 +8
Branches 3008 3012 +4
==========================================
+ Hits 14684 14694 +10
+ Misses 13982 13980 -2
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Note that I am not responsible for the two lines in question. They were here before, thus already not tested. |
Klaim
left a comment
There was a problem hiding this comment.
LGTM in essence but I would need a bit more documentation of the function.
As for the CI error on Windows, I'm not totally sure but I suspect the specific check is about a kind of permission not supported by that OS? Not sure.
ad237ab to
612e056
Compare
7e649b1 to
ca648c8
Compare
Description
When trying to set execution mode for a file or setting permissions to cache directory, an error may occur if we have no modification right on the parent folder.
This error occurs regardless of the current permissions on the targeted file or folder.
Thus, even if we already have the required permissions on the targeted file or folder, the error occurs.
This pull request introduces a function
has_permissions()that tests if we already have the wanted permissions on a file or folder.This new function is used at the two places described above, in order to avoid a useless setting of permissions that would lead to an error.
Type of Change
Checklist
pre-commit run --alllocally in the source folder and confirmed that there are no linter errors.