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

Helper to upgrade projects #3244

Closed
camilamacedo86 opened this issue Feb 21, 2023 · 30 comments
Closed

Helper to upgrade projects #3244

camilamacedo86 opened this issue Feb 21, 2023 · 30 comments
Labels
gsoc kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented Feb 21, 2023

What do you want to happen?

Description

Things change, and we constantly grow the KubeBuilder, providing new features and bug fixes. Also, sometimes it is required to address incompatible changes via new plugin versions. However, all changes and growth bring some complexities to its users keeping their solutions upgraded and adopting all that is new.

The primary motivation of this project is to provide a helper via a command CLI that will automate a common and manual part of this process and try to make it less painful. Also, this project will add a lot of value for Kubebuilder, and its maintainers since it can encourage their users to move forward more frequently. We might be able to use this feature to create lovely automation using git and provide GitHub actions in the future. Note that we have a design proposal to develop the initial version of this feature, which is expected in this project. However, your ideas and input to solve this challenge will be very welcome!

See the proposal: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/helper_to_upgrade_projects_by_rescaffolding.md

Acceptence Criteria

  • Develop a helper to achieve the goal, making it easier for users to upgrade their projects.
  • Interact with the community: make sure the roadmap is generally expected, and continuously receive feedback to move forward with the project.
  • Make the helpers properly covered with tests and documentation
  • Demonstrate the feature in the community meeting

⚠️ IMPORTANT: I have proposed this feature as a project for the Google Summer Code Program 2023. Therefore, please only assign it to yourself if you are the student who chooses to work out on it. More info: #3283

@camilamacedo86 camilamacedo86 added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 21, 2023
@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Feb 21, 2023

IMPORTANT: I have proposed this feature as a project for the Google Summer Code Program 2023. Therefore, please only assign it to yourself if you are the student who chooses to work out on it.

More info: #3283

@varshaprasad96 varshaprasad96 added triage/accepted Indicates an issue or PR is ready to be actively worked on. gsoc labels Feb 23, 2023
@Sajiyah-Salat
Copy link
Contributor

Hello @camilamacedo86 I can't explain how much I am happy that kubebuilder is now selected for gsoc. I know kubebuilder from quite a time and I know you as a mentor, you are just awesome for helping others. I will surely apply to gsoc for kubebuilder and hope I get this project. Thank you.

@octonawish-akcodes
Copy link

octonawish-akcodes commented Feb 25, 2023

I am interested in this project issue, any references and slack link?
cc @camilamacedo86

@yyy1000
Copy link
Member

yyy1000 commented Feb 25, 2023

Hi, I'm so excited about it! As a new open-source contributor but a long-term open-source user, I have used Kubernetes and Kubebuilder for a period of time. And I want this GSOC as an entrance to get me involved in this project and make consistent contributions!

@xiao-jay
Copy link
Contributor

xiao-jay commented Mar 4, 2023

hello everyone, I dont't know the difference about go/v3 and go/v4, Can someone familiar with this area explain?
Now i have found the docs go/v3 vs go/v4-alpha,share to others.

@xiao-jay
Copy link
Contributor

xiao-jay commented Mar 5, 2023

kubebuilder re-scaffold Implementation plan

hello @camilamacedo86 , I read your describe and have some implementation plan,if you have any question ,please tell me .

1、Backup project to ./.backup/project-name and Analyze PROJECT file

example code

projectPath := getProjectPath(cwd, projectConfig)
store := yaml.New(machinery.Filesystem{FS: afero.NewOsFs()})
if err = store.LoadFrom(projectPath); err != nil {
			log.Fatal(err)
}

// checkout layout and others
...

2、Through PROJECT file init project and create api and controllers and webhook

3、Use upgrade plugin to do specific code operations(Take upgrading go/v3 to v4 as an example)

cp ./.backup/project-name/api ./project-name/api
cp ./.backup/project-name/controllers ./project-name/internal/controller
cp ./.backup/project-name/go.mod cp ./project-name/go.mod
...
make generate && make manifest
// is hard to analyze code ,so copy file is easily.

4、e2e test

​ run kubebuilder alpha generate --plugins=go/v4 to testdata/project-v3, generate project-v4,better same as testdata/project-v4,finally run make test to test run normal.

5、Problem

Hard to keep the command maintained

​ Design two stages to solve the problem, the first stage is general, and the second stage uses the updated plugin to do specific code operations.

first: General processing,backup and clean all file,throuth PROJECT file generate newest scaffold code.

second: use upgrade plugin,such as write a upgrade plugin to support upgrade go/v3 to go/v4.

6、Finally

​ Difficult to fully automate, Generate the latest scaffold according to the project file, and copy the key code, which can help users upgrade the project more easily, That's the meaning of this command.

​ I have use kubebuilder one year, for kubebuilder I have many interesting features. Such as i want to delete useless api or webhook, I need to manually delete many files,Is there need a command to delete? So,I hope to make a useful command, this contribution is just the beginning, I will also contribute to kubebuilder in the future.

@Sajiyah-Salat
Copy link
Contributor

Hello @xiao-jay It's great to know your interest in kubebuilder. Also your implementation is good as well. Your contributions are welcome. Thank you.

@camilamacedo86
Copy link
Member Author

Hi @Sajiyah-Salat and @xiao-jay,

Thank you for looking at this one. However, see: #3244 (comment)

Your help is very welcome but this one is a project applied to be part of this program and should be done by a student. Therefore, please do NOT work on this one.

@xiao-jay
Copy link
Contributor

xiao-jay commented Mar 8, 2023

@camilamacedo86 Hi, I am the student,also want this GSOC,Do you have a designated person for this project?If not, i will keep contributing until i win the project.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Mar 8, 2023

Hi @xiao-jay we have not yet.
See the timelines: https://developers.google.com/open-source/gsoc/timeline

You need apply yourself into the program first.
You are very welcome to contribute with any other issue !

@xiao-jay
Copy link
Contributor

xiao-jay commented Mar 8, 2023

Hi @xiao-jay we have not yet. See the timelines: https://developers.google.com/open-source/gsoc/timeline

You need apply yourself into the program first. You are very welcome to contribute with any other issue !

Can I ask a question what is the meaning of 'You need apply yourself into the program first.'? The mean is contribute to this issue (#3244 Helper to upgrade projects)?. Sure, i will raise a pull request at the next time.

@Sajiyah-Salat
Copy link
Contributor

Hello @xiao-jay to contribute in gsoc project you should submit a proposal and after reviewing maintainers allow us to work on project in the give time. See the kubebuilder proposal and learn more about gsoc timeline.

@xiao-jay
Copy link
Contributor

xiao-jay commented Mar 9, 2023

@Sajiyah-Salat Thank you for your explanation,I should submit a prospsal first.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Mar 11, 2023

Hi @xiao-jay @Sajiyah-Salat, @octonawish-akcodes, @yyy1000:

We created the discussion topic #3283. If you have any other questions, feel free to add them there. Then, if others have the same questions, we can centralize the info there.

🥇 Thank you a lot for your interest in contributing to and being part of the project !!!

c/c @varshaprasad96 @Kavinjsir

@Kavinjsir
Copy link
Contributor

Thx @camilamacedo86 ! I join the discussion and share some of my experience at: #3283 (reply in thread)
Wish this helps!

@Sajiyah-Salat
Copy link
Contributor

As a contributor I have added my part there. It's great to have you ping me there. Thank you.

@sayantani11
Copy link
Contributor

Hey @camilamacedo86 i have worked with kubebuilder previously for other projects, as i have some basic idea about it, am planning to contribute to it. I hope i am not late to it. Thank you!

@camilamacedo86
Copy link
Member Author

Hi @sayantani11,

That is cool, but this specific project we put in the GSC0 2023 #3244 (comment) however, you are welcome to help in any other task issue that please you. Your contributions are very welcome !!!

@sayantani11
Copy link
Contributor

Hi @sayantani11,

That is cool, but this specific project we put in the GSC0 2023 #3244 (comment) however, you are welcome to help in any other task issue that please you. Your contributions are very welcome !!!

Yes, I am still a student and planning to apply for GSOC 2023.

@Sajiyah-Salat
Copy link
Contributor

Hi @sayantani11,
That is cool, but this specific project we put in the GSC0 2023 #3244 (comment) however, you are welcome to help in any other task issue that please you. Your contributions are very welcome !!!

Yes, I am still a student and planning to apply for GSOC 2023.

still you can't work on it before gsoc final applicants. start with good first issue. Let me know if I can help. Thank you!

@sayantani11
Copy link
Contributor

Hi @sayantani11,
That is cool, but this specific project we put in the GSC0 2023 #3244 (comment) however, you are welcome to help in any other task issue that please you. Your contributions are very welcome !!!

Yes, I am still a student and planning to apply for GSOC 2023.

still you can't work on it before gsoc final applicants. start with good first issue. Let me know if I can help. Thank you!

Can I submit a proposal for working in it?

@Sajiyah-Salat
Copy link
Contributor

proposal portal is not open yet.

@octonawish-akcodes
Copy link

I cant find gf issues, @camilamacedo86 what to do I want to work with this project this summer of code.

@Sajiyah-Salat
Copy link
Contributor

go through contributing.md, start understanding good first issue and solve it. make your own operator with the help of docs. if you find and bug or feature update open a issue, try to work on it. Thank you.

@ashutosh887
Copy link
Contributor

@camilamacedo86 @varshaprasad96 @Kavinjsir
I've been eagerly waiting to contribute to this under GSOC
I've always been willing to contribute to such an amazing project and work under amazing mentors like you all

Thanks 😄

@Sajiyah-Salat
Copy link
Contributor

It's great to know that you are excited for kubebuilder project. keep contributing.

@Sajiyah-Salat
Copy link
Contributor

hello @camilamacedo86, Today is the day of announcment of selected participant. We are waiting for results. I am excited to know the name.

@ashutosh887
Copy link
Contributor

Yes @camilamacedo86
Equally excited to hear from the Team 🤩

@camilamacedo86
Copy link
Member Author

It is done:

🔈 Latest Release News: Project Upgrade Assistant Now Available!

Hi Everyone,

This year, we submitted a project for the Google Summer Program 2023. Although our project was not accepted into the program, the student, Junhao Liu, agreed to carry out the project following the same timelines and guidelines. We are proud to present the results of Junhao’s dedication. His contributions can be found in the latest release of Kubebuilder, v3.12.0. Below are the details:

🚀 Your Upgrade Assistant: The New ‘Alpha Generate’ Command in Kubebuilder

Please note that all input utilized via the Kubebuilder tool is tracked in the PROJECT file (example). This file is responsible for storing essential information, representing various facets of the Project such as its layout, plugins, APIs, and more. (More info)

With the release of new plugin versions/layouts or even a new Kubebuilder CLI version with scaffold changes, an easy way to upgrade your project is by re-scaffolding. This process allows users to employ tools like IDEs to compare changes, enabling them to overlay their code implementation on the new scaffold or integrate these changes into their existing project.

Therefore, as part of this initiative, a new alpha command named "generate" has been introduced. Its primary function is to re-scaffold the project based on the information provided in the PROJECT file. Example:
kubebuilder alpha generate
--input-dir=/path/to/existing/project \
--output-dir=/path/to/new/project

📌 If you want to know more about:

Recorded Demonstration: https://www.youtube.com/watch?v=7997RIbx8kw
Proposal: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/helper_to_upgrade_projects_by_rescaffolding.md
Documentation: https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/src/reference/rescaffold.md

🤝 How to contribute with:

Please feel free to report any bugs or offer suggestions by raising an issue in the Kubebuilder repository.
Additionally, we welcome contributions to enhance the solution. If you see areas for improvement or ways to make it even more beneficial for the community, your input would be greatly appreciated.

🎉 We’d like to extend our heartfelt congratulations to the student responsible for this achievement, @yyy1000.
Special thanks to @varshaprasad96 and @Kavinjsir for their invaluable mentorship and guidance throughout the project.

@Sajiyah-Salat
Copy link
Contributor

Congratulation on your achievment. I have gone through video and you did an amazing work of building this tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc kind/feature Categorizes issue or PR as related to a new feature. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

9 participants