Repository navigation
Conversation
Owner
|
Thanks. I'm currently on vacation until next week and will take a look ASAP. |
Owner
|
Sorry for letting this slide. The reason I'm hesitant to merge this is #6 which asks for diffs between revisions of a release. I'm still trying to come up with a nice CLI interface to allow to unambiguously specify a local chart directory, chart with version or release revision for both positional arguments ( |
|
+1 for diff between revisions. |
Closed
Owner
|
I believe this has been fixed by a536dfc and is shipped since version 2.9.0+1 of this plugin. |
yxxhero
added a commit
to eagafonov/helm-diff
that referenced
this pull request
Aug 24, 2026
- Temp files renamed old.yaml/new.yaml so they pair up in tool output. - Each entry is preceded by a '# Resource:'/'# Change:' header comment: ADD/REMOVE/OWNERSHIP semantics are otherwise invisible to the tool. - Entries whose every changed line was removed by --suppress-output-line-regex (MODIFY_SUPPRESSED, or ADD/REMOVE with empty diffs) now write an identical placeholder on both sides instead of vanishing, which previously produced exit code 2 with an empty diff. - An unclosed quote in the command is now an error instead of being silently dropped. - Completed the constants refactor (outputFormatDiff) and made the unknown-format fallback of setupReportFormat explicit. - Tests no longer depend on POSIX tools (re-run the test binary as the external tool, the os/exec TestHelperProcess pattern), so they no longer skip on windows-latest; added coverage for the exit-code-1 contract, failure reporting, unclosed quotes, end-to-end secret redaction and --suppress reaching the tool files, the MODIFY_SUPPRESSED path, and the old.yaml/new.yaml basenames. Addresses review feedback on databus23#1048 (main issues databus23#2/databus23#3 and the minor points). Signed-off-by: yxxhero <[email protected]>
yxxhero
added a commit
that referenced
this pull request
Aug 27, 2026
* feat: add external diff tool support Add --diff-tool flag and HELM_DIFF_TOOL env var to render diffs with an external command. Manifests are written to two temp files whose paths are appended as the last two arguments. Secret redaction and line suppression stay in effect since manifests are reconstructed from the report entries. Exit code 1 (differences found) is ignored; other failures report to stderr without aborting helm-diff. * refactor(diff): extract output format and change type constants Replace repeated "structured"/"MODIFY" and related string literals in diff.go, report.go and structured.go with named constants, resolving the goconst lint failures. No behavior change. * fix(diff): let explicit flags win over HELM_DIFF_TOOL HELM_DIFF_TOOL silently overrode an explicitly passed --output, breaking e.g. CI scripts parsing --output json stdout on machines where the variable is exported in a shell profile. ProcessDiffOptions now ignores the environment variable whenever --output or --diff-tool is explicitly given (explicit flag > environment > default); an explicitly empty --diff-tool becomes an opt-out of the external tool. Addresses review feedback on #1048 (main issue #1). Signed-off-by: yxxhero <[email protected]> * fix(diff): address external diff tool review findings - Temp files renamed old.yaml/new.yaml so they pair up in tool output. - Each entry is preceded by a '# Resource:'/'# Change:' header comment: ADD/REMOVE/OWNERSHIP semantics are otherwise invisible to the tool. - Entries whose every changed line was removed by --suppress-output-line-regex (MODIFY_SUPPRESSED, or ADD/REMOVE with empty diffs) now write an identical placeholder on both sides instead of vanishing, which previously produced exit code 2 with an empty diff. - An unclosed quote in the command is now an error instead of being silently dropped. - Completed the constants refactor (outputFormatDiff) and made the unknown-format fallback of setupReportFormat explicit. - Tests no longer depend on POSIX tools (re-run the test binary as the external tool, the os/exec TestHelperProcess pattern), so they no longer skip on windows-latest; added coverage for the exit-code-1 contract, failure reporting, unclosed quotes, end-to-end secret redaction and --suppress reaching the tool files, the MODIFY_SUPPRESSED path, and the old.yaml/new.yaml basenames. Addresses review feedback on #1048 (main issues #2/#3 and the minor points). Signed-off-by: yxxhero <[email protected]> * docs(diff): document diff tool precedence, blocking requirement and notes - Explicit --output (or an explicitly empty --diff-tool) now wins over HELM_DIFF_TOOL; document the precedence chain. - Document the # Resource:/# Change: header comments. - Document that GUI tools returning immediately race with the temp directory cleanup and must block (e.g. code --wait --diff). - Document that fully suppressed entries leave a placeholder, that an unclosed quote is an error, and that there is no timeout. Addresses review feedback on #1048 (main issue #4 and README notes). Signed-off-by: yxxhero <[email protected]> * polish(diff): follow-up review fixes - Centralize diff tool command resolution in Options.configuredDiffToolCommand(): DiffTool() and the printer both derived the effective command independently (three TrimSpace/env reads across two functions), leaving the setup/print agreement an implicit invariant. Refreshed the stale DiffTool doc comment. - README: list MODIFY_SUPPRESSED among the # Change: header values. - writeDiffToolSides: the empty-diffs comment now also covers ADD/REMOVE/OWNERSHIP entries, which doSuppress does not rewrite. - Tests: drop a meaningless NotPanics(empty func) assertion and a trivially-true Empty assertion; document the pipe-capacity constraint of captureStderr. Signed-off-by: yxxhero <[email protected]> * fix(diff): resolve the diff tool command once, at report time - The printer re-resolved the command via the environment at print time, so a Report printed later (ManifestReport defers rendering) depended on the process environment of that moment, and the setup/print agreement documented on configuredDiffToolCommand was not structural after all. The Report now carries the command resolved once in generateReport; printing never reads the env. New test locks the property in (generates under HELM_DIFF_TOOL, prints with it unset). - README precedence paragraph contradicted itself ('either one overrides --output' vs 'an explicit --output wins'); rewritten as a single --diff-tool > HELM_DIFF_TOOL > --output ordering statement. - Test helper: %q-quoted Windows paths were corrupted by the command tokenizer (%q escapes backslashes, the tokenizer strips quotes without unescaping), which would have failed the now-unskipped Windows CI leg. Use forward slashes (accepted everywhere, need no escaping) and add a round-trip regression test for the path. The tokenizer hazard was verified mechanically before the fix. Signed-off-by: yxxhero <[email protected]> * test(cmd): merge duplicate --diff-tool '' precedence tests The last two subtests of TestProcessDiffOptionsDiffTool exercised the same f.Changed("diff-tool") branch with identical assertions; fold them into one and also assert the built-in renderer is selected. Signed-off-by: yxxhero <[email protected]> --------- Signed-off-by: yxxhero <[email protected]> Co-authored-by: yxxhero <[email protected]>
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.
Closes #1
This is useful if you don't always want to use the latest chart in your diff. Allows user ability to specify chart version to diff against.
Changes