-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Update Versioning to Improve Output #5000
Update Versioning to Improve Output #5000
Conversation
Skipping CI for Draft Pull Request. |
c3e2889
to
e36ea7c
Compare
0e2dace
to
7941b36
Compare
7941b36
to
d8bdfd5
Compare
8517c12
to
afe24e2
Compare
9e29b53
to
48bacc7
Compare
api/Makefile
Outdated
@@ -4,10 +4,10 @@ | |||
include ../Makefile-modules.mk | |||
|
|||
test: | |||
go test -v -timeout 45m -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222" | |||
go test -v -timeout 45m -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=(test)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I also set the other ldflag fields with test values here?
48bacc7
to
5230f8f
Compare
This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
1e1187f
to
2950321
Compare
api/provenance/provenance.go
Outdated
Version: v.Version, | ||
BuildDate: v.BuildDate, | ||
}) | ||
return v.Semver() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically, this is already breaking. Alternatively, we could either leave it as is (and update the deprecation notice on the main format), or go ahead and remove it in v5 without deprecation. Wdyt @natasha41575 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave this to @natasha41575
if o.Short { | ||
fmt.Fprintln(o.Writer, provenance.GetProvenance().Short()) | ||
} else { | ||
fmt.Fprintln(os.Stderr, "WARNING: This version information is deprecated and "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could be less conservative and replace it now with the major version bump.
/label tide/merge-method-squash |
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
681f21f
to
8a84ec7
Compare
Tested this against the releaser build process as follows. 1. Pin the kustomize module to the local copies of the dependent modules
diff --git a/kustomize/go.mod b/kustomize/go.mod
index e77d0d1db..84bb99c2c 100644
--- a/kustomize/go.mod
+++ b/kustomize/go.mod
@@ -14,6 +14,10 @@ require (
sigs.k8s.io/yaml v1.3.0
)
+replace sigs.k8s.io/kustomize/api => ../api
+replace sigs.k8s.io/kustomize/cmd/config => ../cmd/config
+replace sigs.k8s.io/kustomize/kyaml => ../kyaml
+ 2. Disable the changelog script
diff --git a/releasing/compile-changelog.sh b/releasing/compile-changelog.sh
index ce7293c0c..bc0c4931c 100755
--- a/releasing/compile-changelog.sh
+++ b/releasing/compile-changelog.sh
@@ -31,6 +31,8 @@ module=$1
fullTag=$2
changeLogFile="${3:-}"
+exit 0
+
# Find previous tag that matches the tags module
allTags=$(git tag -l "$module*" --sort=-version:refname --no-contains="$fullTag")
prevTag=$(echo "$allTags" | head -n 1)
Results༶ ./kustomize/dist/kustomize_darwin_arm64/kustomize version
v4.5.7-SNAPSHOT-8a84ec72b
༶ ./kustomize/dist/kustomize_darwin_arm64/kustomize version --short
Flag --short has been deprecated, and will be removed in the future.
{kustomize/v4.5.7-SNAPSHOT-8a84ec72b 2023-02-01T19:21:32Z }
༶ ./kustomize/dist/kustomize_darwin_arm64/kustomize version -o yaml
version: kustomize/v4.5.7-SNAPSHOT-8a84ec72b
gitCommit: 8a84ec72b75d92bc157b3fa79a612b72d38f72b8
buildDate: "2023-02-01T19:21:32Z"
goOs: darwin
goArch: arm64
goVersion: go1.19.2
༶ ./kustomize/dist/kustomize_darwin_arm64/kustomize version -o json
{
"version": "kustomize/v4.5.7-SNAPSHOT-8a84ec72b",
"gitCommit": "8a84ec72b75d92bc157b3fa79a612b72d38f72b8",
"buildDate": "2023-02-01T19:21:32Z",
"goOs": "darwin",
"goArch": "arm64",
"goVersion": "go1.19.2"
} |
/unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: annasong20, cailynse, natasha41575 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Working from: #4630
[directly updated by Katrina Jan 31 because Cailyn is OOO]
Take advantage of go1.18's BuildInfo as the source of the git commit version. Testing indicates this is reliably available.
Continue to use ldflags for the build date and version data. Make sure the build date ldflag is set in our makefile.
Add json and yaml output formats.
Replace the Go struct dump with a simple semver string as the main version output. kubectl is doing the same: Start deprecating long/golang version information kubernetes/kubernetes#108987
Deprecate the short output flag.
Add go version from build info
Local Build Before
Local Build After