-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[REGRESSION] --output-diff doesn't display changes anymore with test=True since v2019.2.0 #51932
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
Comments
@saltstack/team-core Thoughts? |
We have gone back and forth on this one a lot over the years. The core argument has been that the changes dict should only have changes in it if changes actually happened. Thats why it keeps getting pulled out. The main argument is that this is the expected behavior. The counter argument is that this is some very valuable information to have from a test=True run and that it should be made available. The counter/counter to that is that we don't have the ability to get predictive changes out of all states, therefore the output becomes inconsistent. Finally, it can also be argued that if the result is None then we should know for sure that we did not make changes, so any changes in the changes dict can be seen as predictive. |
Agreed, and when we get it back, lets add a fat comment in there to keep it :) |
Thanks for those informations and for your reactivity. Even if test=True isn't perfect and could miss some changes (generally due to triggers like watch / watch_in etc.), it is a huge help for the one who needs to check some particular changes instead of blindly applying states and just hope changes will be good. |
I'm a fan of adding a note in there, maybe something like |
I like it, maybe say: |
I would only add that a) This is a major feature when trying to merge a Salt state into systems that have not previously been managed by Salt and have years of manual changes in them. One never knows what setting you're going to be accidentally removing. b) If |
I can confirm reverting the change @fedepires mentions and restarting my remote minion "fixes" the issue and shows the diffs when running |
@fedepires Nice find :) (and helpful for those who need it. @rhavenn At least from those involved in the minor discussion we had, we didn't have strong feelings about calling it something else. My cursory search didn't find anything to the contrary. I'd say that my personal preference would be to fix this back (with the aforementioned comment), with the idea that Maybe if someone really feels strongly about the semantics/grammar they could submit a PR to introduce a dry-run flag and re-un-restore the behavior for test=True :) |
To add a last thought to the @rhavenn 's comment, currently, if you misspell "test=True", the state will be executed without any error or message telling that we passed an unknown argument, which is very dangerous and confusing. Then, replacing test=True by a special state.test (or maybe state.dryrun) would be a good thing I think, |
Hello, I agree that this is a terrible regression, it makes it impossible to actually see what changes are going to be made in test mode, almost defeating the entire purpose of the test mode (If you can't see potential changes, then the test mode becomes useful only as a syntax test, to check for errors in the states). We use test mode to capture differences in a nightly audit also which has now become useless without the details of the differences. Although the change described by @fedepires and tested by @rhavenn supposedly fixes it, there is another alternative fix, potentially more suitable one, because the fix below restores the behaviour for handling all pchanges data from different states, whereas the fix above, only restores the changes displayed within the 'file' module. That fix also introduces the 'mixing' of 'changes' and 'pchanges', which people are concerned with above. However the fix below only affects the output produced (choosing to display pchanges if it is available). The code in highstate.py, used to print 'pchanges' if it was present and there were no 'changes' but there are 'pchanges'. This handling was removed in commit 98cfa1f "recursion for orchestration" (file salt/output/highstate.py, line 226), and may have simply been an oversight. this fix is as follows (simply restoring the removed logic) from that commit Around line 246 of salt/output/highstate.py, in salt version 2019.2.0, within function _format_host :
|
The @cjsin 's patch works perfectly for me. Thanks! |
Can confirm, this works great. Is there a plan to merge this change into master? This was hands down the most valuable feature of salt (and of configuration management tools in general) so it would be great to have it back without manually patching. |
@dpkirchner From what I can tell this should be landing in 2019.2.1, but @garethgreenaway can correct me if I'm wrong. |
Correct, #51992 is labeled to be merged for the 2019.2.1 release. |
Hi, |
@marceliq can you give your set up and Salt version report, please? |
@sagetherage sorry for late answer, here it is: Salt is installed from pip.
Note to mention, that file.serialize shows diffs, but file.manage dont. |
@marceliq what state are you using and where exactly are you see this happening? I want to gather as much information as I can so we can really narrow down where this is still occurring and get it corrected. Thank you! |
removing this from a release cycle until unblocked |
@sagetherage what is the blocker on this bug? I would love to see it fixed. Anything I can do to help un |
@wwalker @sagetherage I'm going to dig in here to sort out where the issue stands. |
AFAICT, this is resolved in minions ≥ 2019.2.1, as noted in #51932 (comment). It's possible the issue is still being seen based on an assumption that the master version matters here. It does not, the behaviour here is fully driven by the minions. Here's an example with a 3002.2 master with a 2018.3.5 minion (
|
Uh oh!
There was an error while loading. Please reload this page.
Description of Issue/Question
--output-diff doesn't display changes anymore with test=True since v2019.2.0
Setup
Steps to Reproduce Issue
Initial setup
With test=True
Diff isn't displayed anymore.
Without test=True
Diff is displayed.
Versions Report
The text was updated successfully, but these errors were encountered: