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

Add released openyurt versions to projectInfo when building binaries #1016

Merged
merged 2 commits into from
Sep 26, 2022

Conversation

Congrool
Copy link
Member

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

As #1007 , when we release new version of openyurt, we have to manually revise versions in code, which is often forgot. This pr will automatically detect released versions of openyurt and link to projectInfo when building binaries, which can simplify what we need to do when releasing new version.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@Congrool: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

As #1007 , when we release new version of openyurt, we have to manually revise versions in code, which is often forgot. This pr will automatically detect released versions of openyurt and link to projectInfo when building binaries, which can simplify what we need to do when releasing new version.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

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.

@openyurt-bot openyurt-bot added the kind/enhancement kind/enhancement label Sep 23, 2022
@openyurt-bot openyurt-bot added the size/M size/M: 30-99 label Sep 23, 2022
@Congrool
Copy link
Member Author

We can build yurtctl and run yurtctl --version to check this pr.

$ _output/local/bin/linux/amd64/yurtctl --version
yurtctl version: projectinfo.Info{GitVersion:"v1.0.0", GitCommit:"e4eb566", BuildDate:"2022-09-22T08:50:38Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64", AllVersions:[]string{"v0.1.0-beta.1", "v0.2.0", "v0.3.0", "v0.4.0", "v0.4.1", "v0.5.0", "v0.6.0", "v0.6.1", "v0.7.0", "v0.7.1", "v1.0.0", "v1.0.0-rc1"}}

@rambohe-ch
Copy link
Member

We can build yurtctl and run yurtctl --version to check this pr.

$ _output/local/bin/linux/amd64/yurtctl --version
yurtctl version: projectinfo.Info{GitVersion:"v1.0.0", GitCommit:"e4eb566", BuildDate:"2022-09-22T08:50:38Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64", AllVersions:[]string{"v0.1.0-beta.1", "v0.2.0", "v0.3.0", "v0.4.0", "v0.4.1", "v0.5.0", "v0.6.0", "v0.6.1", "v0.7.0", "v0.7.1", "v1.0.0", "v1.0.0-rc1"}}

@Congrool It's a good idea to detect and verify version of OpenYurt automatically. and one of my concerns is that AllVersions string will become longer and longer, so how about left the latest 5 versions?

@Congrool
Copy link
Member Author

@rambohe-ch Good idea, I'll do that. I think the number of valid openyurt versions should depend on how many versions we will keep maintain and do back-port.

@codecov
Copy link

codecov bot commented Sep 23, 2022

Codecov Report

Merging #1016 (6a7098a) into master (e4eb566) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1016      +/-   ##
==========================================
- Coverage   47.42%   47.40%   -0.02%     
==========================================
  Files          85       85              
  Lines       11791    11791              
==========================================
- Hits         5592     5590       -2     
- Misses       5738     5739       +1     
- Partials      461      462       +1     
Flag Coverage Δ
unittests 47.40% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/yurtctl/cmd/yurttest/kindinit/init.go 50.71% <100.00%> (ø)
pkg/util/iptables/iptables.go 87.12% <0.00%> (-0.55%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rambohe-ch
Copy link
Member

@rambohe-ch Good idea, I'll do that. I think the number of valid openyurt versions should depend on how many versions we will keep maintain and do back-port.

@Congrool I think maybe 3 or 4 versions is enough.

@openyurt-bot openyurt-bot added size/L size/L: 100-499 and removed size/M size/M: 30-99 labels Sep 23, 2022
@Congrool
Copy link
Member Author

Done. And currently I set the num as 3, which means, for example, v1.0.*, v0.7.* and v0.6.*. The linked versions looks like:

$ _output/local/bin/linux/amd64/yurtctl --version
yurtctl version: projectinfo.Info{GitVersion:"v1.0.0", GitCommit:"9d4c80e", BuildDate:"2022-09-23T11:28:30Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64", AllVersions:[]string{"v1.0.0-rc1", "v1.0.0", "v0.7.0", "v0.7.1", "v0.6.0", "v0.6.1"}}

PTAL @rambohe-ch

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Congrool, rambohe-ch

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

@openyurt-bot openyurt-bot added the approved approved label Sep 26, 2022
@rambohe-ch
Copy link
Member

/lgtm
/approve

@rambohe-ch
Copy link
Member

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Sep 26, 2022
@openyurt-bot openyurt-bot merged commit 7351cff into openyurtio:master Sep 26, 2022
lorrielau pushed a commit to lorrielau/openyurt that referenced this pull request Sep 30, 2022
…penyurtio#1016)

* add all versions to projectInfo

* remove validOpenYurtVersions from yurtctl test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved kind/enhancement kind/enhancement lgtm lgtm size/L size/L: 100-499
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants