Repository navigation
Conversation
Fizzadar
requested changes
Nov 26, 2026
Fizzadar
left a comment
Member
There was a problem hiding this comment.
One problem with recursive inline, otherwise this looks good!
Comment on lines
+1970
to
+1972
| # Skip a symbolic mode (eg "g+w") that wouldn't change the directory | ||
| if isinstance(mode, str) and apply_symbolic_mode(info["mode"], mode) == info["mode"]: | ||
| mode = None |
Member
There was a problem hiding this comment.
With recursive=True this skips the chmod when the top directory already matches, but children could still be wrong. Should we only skip when recursive is false? Also this block overlaps with #2117, so this needs a rebase now 🙏
Author
There was a problem hiding this comment.
@Fizzadar nice catch, thanks!
It now only skips when recursive is false and there is a test for the recursive case. I also rebased
knjoroge
force-pushed
the
fix/directory-symbolic-mode
branch
from
November 26, 2026 20:48
7ff5975 to
89ce7fc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2084
What
files.directory(mode="u+rwx,g+rwx,o-rwx")ranchmodon every deploy, even when the directory already had that mode.Why
The directory's current mode is a number (
770), but a symbolic mode stays as text, so770 != "u+rwx,g+rwx,o-rwx"was always true.Changes
apply_symbolic_mode()inoperations/util/files.py. It works out the number a symbolic mode would give the current directory, e.g.770+"o+rwx"→777.files.directoryskipschmodwhen that number already matches. Otherwise it still sends the symbolic mode as-is, so nothing else changes.recursive=Trueit always runschmod -Rlike before, because files inside could still need it.chmodlike before: nou/g/o/a(e.g.+x, which depends on the umask),X/s/t, or a directory with setuid/setgid/sticky bits.recursive→ chmod, no match → chmod,+x→ chmod).Rebased on #2117.
I also compared
apply_symbolic_mode()against the realchmod(macOS) on 3000 random modes, and they all matched.3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)AI disclosure: I used Claude Code to write the code and tests, and I reviewed and understand all of it.