Skip to content

Align kpt version output format with porchctl#4545

Open
aravindtga wants to merge 1 commit into
kptdev:mainfrom
Nordix:fix-kpt-version-display-format
Open

Align kpt version output format with porchctl#4545
aravindtga wants to merge 1 commit into
kptdev:mainfrom
Nordix:fix-kpt-version-display-format

Conversation

@aravindtga
Copy link
Copy Markdown
Contributor

Updates kpt version to display version information in the same two-line format as porchctl version, using debug.ReadBuildInfo() for git commit details.

It follows the same format/code as porchctl .

Before:

  $ kpt version
  1.0.0-beta.64

After:

  $ kpt version
  Version: 1.0.0-beta.64
  Git commit: 3d736563e328f8a4ea28f15f9b8d7ae517eb8c19

For local builds:

  $ kpt version
  Version: development-2026-05-28T16:00:51
  Git commit: 49df708df... (dirty)

AI usage disclosure

  • AI assistance (Kiro CLI) was used to draft this PR description.

Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit d0dee31
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6a185fe6e894400008b94c54
😎 Deploy Preview https://deploy-preview-4545--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@aravindtga aravindtga marked this pull request as ready for review May 28, 2026 15:42
@aravindtga aravindtga requested a review from liamfallon as a code owner May 28, 2026 15:42
Copilot AI review requested due to automatic review settings May 28, 2026 15:42
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label May 28, 2026
@aravindtga aravindtga self-assigned this May 28, 2026
@dosubot dosubot Bot added the enhancement New feature or request label May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the kpt version command to display both a version string and the Git commit hash (with dirty state) obtained from Go's embedded build info, and changes the Makefile to inject a date-based development version instead of a Git short hash.

Changes:

  • Replaces single-line version output with multi-line output including version and VCS commit hash/dirty flag via runtime/debug.ReadBuildInfo.
  • Changes Makefile version ldflag value from git rev-parse --short HEAD to a date-stamped development string.
  • Updates copyright year range.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
run/run.go Extends version command to print version plus VCS commit hash and dirty status from build info.
Makefile Replaces GIT_COMMIT with date-based KPT_VERSION used in ldflags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
Comment thread run/run.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants