Conversation
|
Why is shippable using the wrong code branch!? |
|
Tests need to be updated to set recurse=true when they want to delete non-empty directory |
This comment has been minimized.
This comment has been minimized.
dagwieers
left a comment
There was a problem hiding this comment.
LGTM, but this changes behaviour.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I get there are behavior changes but the current default behavior is unsafe. I'm open to suggestions on how to better do this without a complete rewrite of the core modules. |
|
CI test failure - https://app.shippable.com/github/ansible/ansible/runs/109917/63/tests This is occurring for all the nodes running the file integration tests. |
|
@ewarnke I agree, but the warning was intended for others reviewing this PR, not for you :-) |
There was a problem hiding this comment.
LGTM, however this PR changes the behaviour for existing users, on the other hand it fixes a security-related issue that could cause unintended data-loss. So IMO the impact of the latter trumps the former.
We may want to issue a warning and a deprecation period, rather than an immediate break in behaviour ?
|
Yeah, I've been thinking about abandoning these changes and working on a new pull. What's the thinking on new states, new argument, or new module?
I'm not tied to any one solution and the more I worked on this patch I'm just not happy with the way it's turning out. I'm fairly positive it would introduce major breakage as-is. I'm leaning towards a new argument right now since it seems like a good balance between fixing the bug and breaking existing behaviors while giving a path for people to select how directories are removed. |
|
@jborean93 Yeah, I've seen that and even tried chasing a few of the test down to add the flag. The problem is that the current behavior is unsafe and trying to find a good solution that merges cleanly and fixes the unsafe behavior without breaking piles of existing tasks is non-trivial. The fix is easy but people generally don't like breaking changes. - FYI, this is @ewarnke I just forgot to login under my work account. |
s-hertel
left a comment
There was a problem hiding this comment.
Getting this into the 2.12 cycle earlier rather than later is probably a good idea.
| @@ -0,0 +1,7 @@ | |||
| --- | |||
| bugfixes: | |||
There was a problem hiding this comment.
This should probably be a breaking_changes: fragment since it's a very disruptive bugfix.
| file: | ||
| path: '{{ output_dir }}' | ||
| state: absent | ||
| recurse: no |
There was a problem hiding this comment.
A test deleting an empty directory with recurse: no would be nice.
| - Recursively set the specified file attributes on directory contents. | ||
| - This applies only to C(state=directory). | ||
| - Recursively act on directory contents. | ||
| - This applies only to C(state=directory) or C(state=absent). |
There was a problem hiding this comment.
We might want to note the version this started applying to C(state=absent), since it looks like the option has been around since 1.1.
There was a problem hiding this comment.
This merge hasn't been updated in a year. It's virtually impossible to fix the unsafe behavior due to the fact that so many tests depend on it.
There was a problem hiding this comment.
Yeah, a lot of things depend on it. The core team discussed an open issue for it on Friday #22248 (comment) without being aware that this PR existed, and consensus was that we'd like to try to move forward with fixing it, as early as possible for the next release cycle so we can get feedback.
There was a problem hiding this comment.
ci_complete can be added to the latest commit to ensure all tests run.
SUMMARY
Make file state=absent respect recuse=false for previos state=directory
Fixes #52653
Fixes #22248
ISSUE TYPE
Sorry about the multiple pulls, not a frequent contributor.