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

Deprecate v1 projects #1137

Merged
merged 1 commit into from
Nov 8, 2019
Merged

Conversation

hypnoglow
Copy link
Contributor

This PR deprecates v1 projects. Fixes #1136

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 28, 2019
@k8s-ci-robot
Copy link
Contributor

Welcome @hypnoglow!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubebuilder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @hypnoglow. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 28, 2019
cmd/main.go Outdated
@@ -188,3 +191,20 @@ func getProjectVersion() (bool, string) {
}
return true, projectInfo.Version
}

func printV1DeprecationWarning() {
fmt.Printf(`=============== DEPRECATION WARNING ===============
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this looks too aggressive, let me know how to rephrase/reformat it.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can try making it more concise. How about:

warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. Refer to https://book.kubebuilder.io/migration/guide.html for more details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Done

cmd/main.go Outdated

func printV1DeprecationWarning() {
fmt.Printf(`=============== DEPRECATION WARNING ===============
v1 projects are deprecated. The support for v1 projects will be dropped at 1 February 2020.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dropped an approximate date, please correct me if it is wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about a broad date such as "first 2020 quarter"? @droot

Copy link
Contributor

Choose a reason for hiding this comment

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

Giving a specific date makes the message more clear and that's the intent behind this.

Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. A few minor suggestions.

cmd/main.go Outdated
@@ -188,3 +191,20 @@ func getProjectVersion() (bool, string) {
}
return true, projectInfo.Version
}

func printV1DeprecationWarning() {
fmt.Printf(`=============== DEPRECATION WARNING ===============
Copy link
Contributor

Choose a reason for hiding this comment

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

We can try making it more concise. How about:

warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. Refer to https://book.kubebuilder.io/migration/guide.html for more details.

cmd/main.go Outdated

func printV1DeprecationWarning() {
fmt.Printf(`=============== DEPRECATION WARNING ===============
v1 projects are deprecated. The support for v1 projects will be dropped at 1 February 2020.
Copy link
Contributor

Choose a reason for hiding this comment

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

Giving a specific date makes the message more clear and that's the intent behind this.

@@ -112,7 +113,9 @@ func main() {
)

foundProject, version := getProjectVersion()
if foundProject && version == "1" {
if foundProject && version == project.Version1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cobra command library does provide mechanism to mark commands as deprecated but I think the implemented approach will work better for our case.

@droot
Copy link
Contributor

droot commented Oct 30, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 30, 2019
cmd/main.go Outdated
@@ -188,3 +191,7 @@ func getProjectVersion() (bool, string) {
}
return true, projectInfo.Version
}

func printV1DeprecationWarning() {
fmt.Printf("warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. Refer to https://book.kubebuilder.io/migration/guide.html for more details.\n")
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about:

Suggested change
fmt.Printf("warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. Refer to https://book.kubebuilder.io/migration/guide.html for more details.\n")
fmt.Printf("warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. See the https://book.kubebuilder.io/migration/guide.html for know how to migrate the project to from v1 to v2.\n")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@camilamacedo86 Is the "See ... for know how to ..." correct English? Sorry for this question, I'm not a native speaker, thus I never heard this idiom :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@camilamacedo86 ping, I would be thankful if you clarify this moment for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

... for know how to ... and project to from are definetely typos. I would go for ... Refer to https://.. for instructions on how to migrate to v2.\n. Saying from v1 doesn't give that much info as you already said that v1 is the one being deprecated.

Just my 2 cents.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Adirio agreed, thanks for help.

Copy link
Member

@camilamacedo86 camilamacedo86 Nov 7, 2019

Choose a reason for hiding this comment

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

I was not clear in my suggestion. Sorry. It is updated bellow.

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Besides the nit . It shows /lgtm for me.

@@ -112,7 +113,9 @@ func main() {
)

foundProject, version := getProjectVersion()
if foundProject && version == "1" {
if foundProject && version == project.Version1 {

This comment was marked as resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you suggest to do this change from another PR (#1143) into this?

Copy link
Member

Choose a reason for hiding this comment

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

Hi @Adirio,

Because this PR is doing/replacing if foundProject && version == "1" { for if foundProject && version == project.Version1 {.

So, as part of its review, I am suggesting if foundProject && version == "1" { for if hasProjectFile && projectVersion == project.Version1 { instead of.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that @camilamacedo86 suggested naming is more suitable. But I also agree that we can lay it on #1143, as the narrow scope of my change was only to replace the string "1" with the constant project.Version1, and not to change other things.

If you still think we should introduce this change here, let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hypnoglow The change she is suggesting is not just a more suitable name, it has to do with the package with the same alias (version). The context is missing as this is a change I suggested in #1143 and she suggested a name change. Suggesting to change this here makes no sense as this PR is about a completely different topic.

Copy link
Member

Choose a reason for hiding this comment

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

It is not a big deal so I am OK with.

@camilamacedo86
Copy link
Member

/assign @camilamacedo86

cmd/main.go Outdated
@@ -188,3 +191,7 @@ func getProjectVersion() (bool, string) {
}
return true, projectInfo.Version
}

func printV1DeprecationWarning() {
fmt.Printf("warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. Refer to https://book.kubebuilder.io/migration/guide.html for instructions on how to migrate to v2.\n")
Copy link
Member

@camilamacedo86 camilamacedo86 Nov 7, 2019

Choose a reason for hiding this comment

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

My suggestion is to keep the text more friendly as it is done in its docs + few nits.

// add const on top
const (
	NoticeColor  = "\033[1;36m%s\033[0m"
)
Suggested change
fmt.Printf("warning: [deprecation] v1 projects are deprecated and will not be supported beyond Feb 1, 2020. Refer to https://book.kubebuilder.io/migration/guide.html for instructions on how to migrate to v2.\n")
fmt.Printf(NoticeColor,"[Deprecation Notice] : v1 projects are deprecated and will not be supported beyond Feb 1, 2020.\n See how to upgrade your project to v2: https://book.kubebuilder.io/migration/guide.html\n")

Following its result.

Screenshot 2019-11-07 at 01 02 21

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

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

I tested it working locally. It is working for the init command and others as requested in the issue. 🥇 Well done. Just apply the suggested nit and I think it will be ok to be merged.

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm /approved 🥇 for me.
@droot @mengqiy wdyt? Let's merge this one

@camilamacedo86
Copy link
Member

/assign @diroot

@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: GitHub didn't allow me to assign the following users: diroot.

Note that only kubernetes-sigs 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:

/assign @diroot

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.

Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks for working on this.
Let's get this in!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hypnoglow, mengqiy

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 Nov 8, 2019
@k8s-ci-robot k8s-ci-robot merged commit 1e27332 into kubernetes-sigs:master Nov 8, 2019
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate v1 projects
6 participants