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

Update Versioning to Improve Output #5000

Merged

Conversation

cailynse
Copy link
Contributor

@cailynse cailynse commented Jan 25, 2023

Working from: #4630

[directly updated by Katrina Jan 31 because Cailyn is OOO]

Local Build Before

༶ kustomize version                                                                                                                           
{Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:darwin GoArch:arm64}

༶ kustomize version --short                                                                                                                 
{unknown  1970-01-01T00:00:00Z  }

Local Build After

༶ kustomize version                                                                                                                           
(devel)

༶ kustomize version --short                                                                                                                 
Flag --short has been deprecated, and will be removed in the future.
{(devel)  2023-02-01T19:02:33Z   }

༶ kustomize version -o yaml                                                                                                                    
version: (devel)
gitCommit: 681f21f05a0d3483ecf6fdadb83e4dd41f70b5c9
buildDate: "2023-02-01T19:02:33Z"
goOs: darwin
goArch: arm64
goVersion: go1.19.2

༶ kustomize version -o json                                                                                                             
{
  "version": "(devel)",
  "gitCommit": "681f21f05a0d3483ecf6fdadb83e4dd41f70b5c9",
  "buildDate": "2023-02-01T19:02:33Z",
  "goOs": "darwin",
  "goArch": "arm64",
  "goVersion": "go1.19.2"
}

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 25, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 25, 2023
@cailynse cailynse force-pushed the improve-version-output-4617 branch 4 times, most recently from c3e2889 to e36ea7c Compare January 25, 2023 21:21
go.work.sum Outdated Show resolved Hide resolved
@cailynse cailynse force-pushed the improve-version-output-4617 branch 3 times, most recently from 0e2dace to 7941b36 Compare January 26, 2023 15:53
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2023
@cailynse cailynse force-pushed the improve-version-output-4617 branch 3 times, most recently from 8517c12 to afe24e2 Compare January 26, 2023 21:22
@cailynse cailynse marked this pull request as ready for review January 26, 2023 21:23
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2023
@cailynse cailynse force-pushed the improve-version-output-4617 branch 3 times, most recently from 9e29b53 to 48bacc7 Compare January 27, 2023 18:05
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)"
Copy link
Contributor Author

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?

@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

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.

Version: v.Version,
BuildDate: v.BuildDate,
})
return v.Semver()
Copy link
Contributor

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 ?

Copy link
Contributor

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 "+
Copy link
Contributor

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.

@annasong20
Copy link
Contributor

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Feb 1, 2023
@KnVerey
Copy link
Contributor

KnVerey commented Feb 1, 2023

/hold
I want to do a final test using the release tooling right before this merges

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2023
Copy link
Contributor

@annasong20 annasong20 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Feb 1, 2023
@KnVerey
Copy link
Contributor

KnVerey commented Feb 1, 2023

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)

  1. Run releasing/run-goreleaser.sh kustomize/v4.5.7 build --snapshot

  2. Test the resulting binary, i.e. ./kustomize/dist/kustomize_darwin_arm64/kustomize on my machine

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"
}

@KnVerey
Copy link
Contributor

KnVerey commented Feb 1, 2023

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 1, 2023
@natasha41575
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 1, 2023
@KnVerey KnVerey added this to the v5.0.0 milestone Feb 1, 2023
@k8s-ci-robot k8s-ci-robot merged commit 95edcc0 into kubernetes-sigs:master Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants