Skip to content

Add 'show_changes' to "file.append" and "file.prepend" state functions#760

Open
meaksh wants to merge 4 commits into
openSUSE/release/3006.0from
openSUSE/fix/3006.0-add-show_changes-for-file-states
Open

Add 'show_changes' to "file.append" and "file.prepend" state functions#760
meaksh wants to merge 4 commits into
openSUSE/release/3006.0from
openSUSE/fix/3006.0-add-show_changes-for-file-states

Conversation

@meaksh
Copy link
Copy Markdown
Member

@meaksh meaksh commented Apr 29, 2026

What does this PR do?

This PR adds the show_changes argument to file.append and file.prepend state functions in order to allow hiding the diff of the content as part of the output. Same behavior that file.managed state and others.

Upstream PR: saltstack/salt#69009

Previous Behavior

The output from file.append and file.prepend executions always contains a "diff" when files are text files.

New Behavior

By default, the "diff" is included, but this can be skipped when show_changes is set to False.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Copy link
Copy Markdown
Contributor

@m-czernek m-czernek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! Failing test in the GH is unrelated (related to #758) so you can ignore that.

Ideally we'd wait before upstream puts at least +1 on the upstream PR, but leaving it up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants