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 kubebuilderVersion Field in PROJECT File for Tracking Kubebuilder CLI Version #4398

Open
camilamacedo86 opened this issue Nov 27, 2024 · 21 comments · May be fixed by #4621
Open

Add kubebuilderVersion Field in PROJECT File for Tracking Kubebuilder CLI Version #4398

camilamacedo86 opened this issue Nov 27, 2024 · 21 comments · May be fixed by #4621
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented Nov 27, 2024

What do you want to happen?

Description:
To enhance project traceability and facilitate future upgrades, it's proposed that Kubebuilder's PROJECT file includes a new field, kubebuilderVersion, to record the specific CLI version used during project scaffolding. This addition will:

  • Help identify the tooling version employed, aiding in troubleshooting and ensuring compatibility with updates.
  • Provide developers with clearer insights into their project's setup for efficient maintenance and evolution.
  • Support solutions like PR #4302 and align with broader goals for traceability and user support.

Tasks:

  1. Add a new field in the PROJECT file: kubebuilderVersion.
  2. Ensure the field tracks the Kubebuilder tool version used during scaffolding.
  3. Update the documentation in the Project Configuration Reference to include the new kubebuilderVersion field.

Reference Files:

This change aims to improve traceability and simplify workflows for users and maintainers.

Extra Labels

No response

@camilamacedo86 camilamacedo86 added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 27, 2024
@camilamacedo86 camilamacedo86 changed the title Add release Field in PROJECT File for Tracking Kubebuilder CLI Version Add kubebuilder-version Field in PROJECT File for Tracking Kubebuilder CLI Version Nov 27, 2024
@camilamacedo86
Copy link
Member Author

We are open to better name suggestions as well !!

@camilamacedo86 camilamacedo86 changed the title Add kubebuilder-version Field in PROJECT File for Tracking Kubebuilder CLI Version Add kubebuilderVersion Field in PROJECT File for Tracking Kubebuilder CLI Version Nov 27, 2024
@camilamacedo86 camilamacedo86 added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Nov 27, 2024
@rovertrack
Copy link

can i try to solve this

@mateusoliveira43
Copy link
Contributor

@rovertrack just comment here /assign and the issue will be assigned to you (so that 2 people do not work on the same task)

if you need any help, just ping here or in the PR

@rovertrack
Copy link

/assign

@rovertrack
Copy link

where the kubebuilderVersion has to be in the projectfile

@mateusoliveira43
Copy link
Contributor

currently, a sample PROJECT file looks like this

# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: openshift.io
layout:
- go.kubebuilder.io/v4
projectName: oadp-nac
repo: github.com/migtools/oadp-non-admin
resources:
- api:
    crdVersion: v1
    namespaced: true
  controller: true
  domain: openshift.io
  group: oadp
  kind: NonAdminBackup
  path: github.com/migtools/oadp-non-admin/api/v1alpha1
  version: v1alpha1
version: "3"

I think it makes sense to be a high level information, like version

It would look like this then

# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: openshift.io
layout:
- go.kubebuilder.io/v4
projectName: oadp-nac
repo: github.com/migtools/oadp-non-admin
resources:
- api:
    crdVersion: v1
    namespaced: true
  controller: true
  domain: openshift.io
  group: oadp
  kind: NonAdminBackup
  path: github.com/migtools/oadp-non-admin/api/v1alpha1
  version: v1alpha1
version: "3"
kubebuilderVersion: "3.14.2"

@rovertrack
Copy link

👍

@sureshkrishnan-v
Copy link

/assign

@jameskim0987
Copy link
Contributor

jameskim0987 commented Dec 11, 2024

@camilamacedo86 @mateusoliveira43 Hi, I was just browsing through issues with good first issue and came across this issue and (#4297) with the hopes of contributing 😄 but I see that we already have 2 assignees.

May I suggest we have the k8s-ci-robot limit to 1 asignee max per issue? and reject future /assign commands if there is an assignee already? This way, we know who is working on it and prevent other folks from just snatch it..

@camilamacedo86
Copy link
Member Author

Hi @jameskim0987,

It’s possible they are working together—more than one person can collaborate on a task.
That it is why I think is not a good idea.

That said, it’s also common for someone to assign themselves to an issue but later be unable to follow through due to unforeseen circumstances.

To address this, I usually monitor tasks that have been assigned but remain inactive for some time. Afterward, I reach out to the assignees to check in.

I also encourage contributors to be proactive by:

  • Reaching out to the assignee directly.
  • Sending a quick ping in Slack to check if they’re stuck or need assistance.
  • Offering to help if the other person cannot move forward.
  • This way, we can keep things moving and avoid blockers.

@jameskim0987
Copy link
Contributor

@camilamacedo86 Got it. Thank you for providing clarity on this matter.

@camilamacedo86 camilamacedo86 added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Dec 14, 2024
@camilamacedo86
Copy link
Member Author

@sureshkrishnan-v @rovertrack

Are you both working on this one?
Did you need any help?
If you are not working, please unsigned so that others can help.

@sbin64
Copy link

sbin64 commented Jan 30, 2025

/assign

@sbin64
Copy link

sbin64 commented Feb 6, 2025

/unassign

@akagami-harsh
Copy link
Contributor

/assign

@sbin64
Copy link

sbin64 commented Mar 2, 2025

@camilamacedo86 I suspect this change would go with adding kubebuilderVersion: "4.x.x" in every PROJECT config file and updating the respective docs.

Along with that you need to test it out locally as mentioned here
https://github.com/kubernetes-sigs/kubebuilder/pull/4302/files#diff-839fbabd902ec0394e11ba9817c2ae1fb54998acd4d9dd46cebb62217ea96a7cR193

@camilamacedo86
Copy link
Member Author

@camilamacedo86 I suspect this change would go with adding kubebuilderVersion: "4.x.x" in every PROJECT config file and updating the respective docs.

Yes, that is the final result that we want.
When we call kubebuilder init and we generate the scaffold we would have the version used (kubebuilder version) of the CLI in the PROJECT file.

Along with that you need to test it out locally as mentioned here
https://github.com/kubernetes-sigs/kubebuilder/pull/4302/files#diff-839fbabd902ec0394e11ba9817c2ae1fb54998acd4d9dd46cebb62217ea96a7cR193

This change/RFE will be helpful for the WIP proposal because we will need to know what version was used to do the original scaffold, but this task itself has no dependency within it.

@vitorfloriano
Copy link
Contributor

@akagami-harsh Are you working on this one? Need any help?

@vitorfloriano
Copy link
Contributor

/assign

@vitorfloriano
Copy link
Contributor

@camilamacedo86 I'm curious about how this new field will be handled in existing projects. Will it only be added during initial scaffolding, or should we also check for and update it when making changes to an existing project? I guess it wouldn't be safe to assume that the version used to update the project is the same that was used for scaffolding, right? 🤔

But I still think it could be useful to track the CLI version even during updates because it can help with troubleshooting and compatibility issues. If someone updates their project with a newer version of Kubebuilder, knowing that version along with the original version could be helpful. But I guess that's an issue for another time. 😉

@mateusoliveira43
Copy link
Contributor

@vitorfloriano I was thinking about this

Should we add check, during execution of any command that would touch PROJECT file, check if version in the file is the same as the one of the CLI?

Example

I created project with kubebuilder version 3.14.0 (which does not contain field) and now I adding a controller with version 4.6.0.

We could error operation saying user must use same version used to scaffold the project to scaffold new code, pointing to documentation on how to update code.

We could also add in error message if the user wants to override this check, just manually add/update kubebuilder version in PROJECT file.

This can be done in a separate issue as well, if agreed. cc @camilamacedo86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants