Skip to content
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

(PUP-9001) Show diff for new files #8890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lollipopman
Copy link
Contributor

Prior to this commit when :show_diff is set, file diffs are only shown
when modifying an existing file. However, it is often very helpful to
see the diff for a new file as well, either in testing or production
logs.

After this commit diffs are shown for new files as well. Diffs are
performed against NUL(windows) or (/dev/null)(all others) to ensure
compatibility with custom diff commands.

Prior to this commit when :show_diff is set, file diffs are only shown
when modifying an existing file. However, it is often very helpful to
see the diff for a new file as well, either in testing or production
logs.

After this commit diffs are shown for new files as well. Diffs are
performed against NUL(windows) or (/dev/null)(all others) to ensure
compatibility with custom diff commands.
@lollipopman lollipopman requested a review from a team as a code owner March 8, 2022 22:14
@lollipopman lollipopman requested a review from a team March 8, 2022 22:14
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@lollipopman
Copy link
Contributor Author

@joshcooper any chance you could review?

@lollipopman
Copy link
Contributor Author

@joshcooper friendly bump for a review

@binford2k
Copy link
Contributor

I am hesitant about this. Enabling show_diffs with this patch would result in a massive massive massive first run report. And the chances that sensitive information shows up in logs becomes exponentially higher. To be sure, one could alleviate both of those by disabling show_diffs for that run, but it would still be unexpected, will likely break some acceptance testing, and could even overload report storage destinations.

That said, I do see value if that's intentionally what you want. I wonder about changing it to a ternary instead. false, true, and verbose where the added level would give you file creation diffs, but without changing existing behaviors.

@lollipopman
Copy link
Contributor Author

I am hesitant about this. Enabling show_diffs with this patch would result in a massive massive massive first run report. And the chances that sensitive information shows up in logs becomes exponentially higher. To be sure, one could alleviate both of those by disabling show_diffs for that run, but it would still be unexpected, will likely break some acceptance testing, and could even overload report storage destinations.

Definitely important concerns, thanks for raising them. I traditionally have not used a puppet server, so large reports are not something I have had to deal with.

That said, I do see value if that's intentionally what you want. I wonder about changing it to a ternary instead. false, true, and verbose where the added level would give you file creation diffs, but without changing existing behaviors.

If a ternary is necessary to prevent surprising behavior, I can certainly update the pull request, how about these values:

show_diff:

  1. false: No diff (default)
  2. true: Diff on changes
  3. always: Diff on changes and new files

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@kenyon
Copy link
Contributor

kenyon commented Sep 17, 2023

This is definitely something I have wanted.

@joshcooper joshcooper added the enhancement New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants