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

build: Fix version generation. #34612

Merged

Conversation

jellonek
Copy link
Contributor

@jellonek jellonek commented Oct 12, 2016

This PR provides update to version string generation procedure to handle additional case - working on branch delivered from release tag, instead of working on -(alpha|beta).no suffixed tag.

Reason of it is that actually if someone would start working on branch forked from release tag (v1.4.1 for example), will add some commits and then would try to build k8s/run conformance tests - will end up with broken version string in form similar to v1.4.1.X+YYYY where X is a distance/number of commits from base tag and YYYY will be first 14 characters from commit hash.
Such version - containing four dotted parts is rejected during conformance tests with error similar to:

/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/kubectl.go:843
Oct 11 12:38:33.726: Failed to get server version: Unable to parse server version "v1.4.1.5+somecommithash": Invalid character(s) found in patch number "1.5"
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:413

This PR provides a cure for this situation creating version string in form v1.4.1-X+YYYY which then should be readable for version validation checks.

Release note:

Fix version string generation for local version different from release and not based on `-alpha.no` or `-beta.no` suffixed tag.

This change is Reviewable

@jellonek jellonek force-pushed the jell/fix_version_generation branch from 6a0f744 to a186276 Compare October 12, 2016 14:43
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Oct 12, 2016
Copy link
Member

@zmerlynn zmerlynn left a comment

Choose a reason for hiding this comment

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

Fix nit, then LGTM

# We have distance to subversion (v1.1.0-subversion-1-gCommitHash)
KUBE_GIT_VERSION=$(echo "${KUBE_GIT_VERSION}" | sed "s/-\([0-9]\{1,\}\)-g\([0-9a-f]\{14\}\)$/.\1\+\2/")
elif [[ "${DASHES_IN_VERSION}" == "--" ]] ; then
# We have distance to base tag (v1.1.0-1-gCommitHash)
Copy link
Member

Choose a reason for hiding this comment

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

Fix indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@zmerlynn zmerlynn added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Oct 12, 2016
@jellonek jellonek force-pushed the jell/fix_version_generation branch from a186276 to 66a8555 Compare October 17, 2016 07:14
@jellonek
Copy link
Contributor Author

Bumping up.

@zmerlynn zmerlynn added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 18, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 2e5303d into kubernetes:master Oct 19, 2016
@jellonek jellonek deleted the jell/fix_version_generation branch October 19, 2016 08:17
@pigmej
Copy link
Contributor

pigmej commented Oct 28, 2016

I created cherry pick on release-1.4 (#35775). Can we have cherrypick-approved label on this PR? I'd like to have it in 1.4 because it affects it too.

cc @zmerlynn

@jessfraz jessfraz added this to the v1.4 milestone Oct 28, 2016
@jessfraz jessfraz added cherrypick-candidate cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 28, 2016
jessfraz added a commit that referenced this pull request Oct 28, 2016
…-upstream-release-1.4

Automated cherry pick of #34612
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…-of-#34612-upstream-release-1.4

Automated cherry pick of kubernetes#34612
@k8s-ci-robot
Copy link
Contributor

@jellonek: Adding do-not-merge/release-note-label-needed because the release note process has not been followed.

One of the following labels is required "release-note", "release-note-action-required", or "release-note-none".
Please see: https://git.k8s.io/community/contributors/devel/pull-requests.md#write-release-notes-if-needed.

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.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Apr 5, 2018
@k8s-ci-robot k8s-ci-robot removed the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants