Show meaningful paths in kpt pkg diff output - #4646
Merged
Merged
Conversation
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves kpt pkg diff usability by rewriting diff tool output so it shows actionable local filesystem paths and semantic upstream labels instead of ephemeral staging temp directory paths (per #591).
Changes:
- Capture diff tool output and post-process it to replace staging paths with the real local package path and semantic upstream directory names.
- Thread the original local package path (
LocalPath) into the default differ to support rewriting. - Add a unit test to validate that diff output includes meaningful paths/labels.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/lib/pkg/diff/diff.go | Captures diff tool output and rewrites staging paths to meaningful local/remote/target paths before printing. |
| pkg/lib/pkg/diff/diff_test.go | Adds a test intended to validate the updated diff output path behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aravindtga
marked this pull request as ready for review
July 17, 2026 15:55
aravindtga
requested review from
efiacor,
kispaljr,
liamfallon and
mozesl-nokia
as code owners
July 17, 2026 15:55
mozesl-nokia
previously approved these changes
Jul 20, 2026
liamfallon
previously approved these changes
Jul 20, 2026
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
aravindtga
force-pushed
the
pkg-diff-meaningful-paths
branch
from
July 20, 2026 08:58
e4b7ed2 to
6262e63
Compare
liamfallon
approved these changes
Jul 20, 2026
kushnaidu
approved these changes
Jul 20, 2026
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.
Description
kpt pkg diffoutput now shows the real local package path and semantic upstream labels instead of raw temp directory paths that no longer exist after the command completes./tmp/kpt-941888986/local-v0.9/deploy.yaml) are meaningless and not actionable. The directories are deleted before the user sees the output.local-<ref>) becomes the real filesystem path, and remote staging paths (remote-<ref>,target-<ref>) are stripped to just their semantic directory name.diff -r /tmp/kpt-941888986/local-v0.9/deploy.yaml /tmp/kpt-941888986/remote-v0.9/deploy.yamldiff -r /home/user/my-package/deploy.yaml remote-v0.9/deploy.yamlRelated Issue(s)
kpt pkg diffdoesn't show host paths #591Type of Change
Checklist
AI Disclosure
If so, please describe how:
- Kiro to analyse the issue, help in the fix, write the unit test and PR message.