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

Update PROJECT file #5390

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

nawazkh
Copy link
Member

@nawazkh nawazkh commented Jan 27, 2025

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Special notes for your reviewer:

Just a note:

  • ls config/crd/bases/ tells us all the CRDs CAPZ exposes.
  • grep -R '+kubebuilder:object:root' api/v1beta1 exp/api/v1beta1 gives us the GVKs of CAPZ defines.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Jan 27, 2025
@k8s-ci-robot
Copy link
Contributor

@nawazkh: The label(s) kind/fix cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?
/kind fix

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

NONE

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 27, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.44%. Comparing base (eb432ed) to head (77f9e4b).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5390   +/-   ##
=======================================
  Coverage   52.44%   52.44%           
=======================================
  Files         272      272           
  Lines       29349    29349           
=======================================
  Hits        15391    15391           
  Misses      13152    13152           
  Partials      806      806           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 27, 2025
@mboersma
Copy link
Contributor

lgtm, comparing against AWS' version: https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/PROJECT

@nawazkh
Copy link
Member Author

nawazkh commented Jan 27, 2025

found more things to be added
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 27, 2025
@nawazkh nawazkh changed the title fix domain of the project Update PROJECT file Jan 27, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 27, 2025
@nawazkh
Copy link
Member Author

nawazkh commented Jan 27, 2025

/unhold
Ready for review.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 27, 2025
@nawazkh nawazkh added this to the v1.18 milestone Jan 27, 2025
PROJECT Outdated Show resolved Hide resolved
@nawazkh nawazkh requested a review from mboersma January 27, 2025 19:09
Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm

Although I'm going to be honest--I don't know what tooling consumes this file or where this YAML is used. Naively, it looks correct now, but can anyone clue me in?

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

LGTM label has been added.

Git tree hash: abced52128c735e562f483ca4cb3b3ae66b12cd0

@nawazkh
Copy link
Member Author

nawazkh commented Jan 27, 2025

/lgtm

Although I'm going to be honest--I don't know what tooling consumes this file or where this YAML is used. Naively, it looks correct now, but can anyone clue me in?

TL;DR: PROJECT file is mostly use to showcase the list of APIs the project maintains.
It is an auto-generated file created on using kubebuilder <command>.
We should look into restoring this functionality. Might involve refactoring the CAPZ code.


Here's what I found.

  • PROJECT file, also known as PROJECT config file is created when Kubebuilder is used to init project and/or add/edit APIs.
  • Looking at the blame of this file, looks like PROJECT file was put in place long ago.
    And maybe somewhere along the way in the development of CAPZ we decided to opt for more custom approach of scaffolding CAPZ APIs, dropping (?) kubebulider way of scaffolding APIs. If we were to use kubebuilder --create api --group ... we would see an update to the PROJECT file.
  • Reference to PROJECT file in kubebuilder documentation: https://book.kubebuilder.io/reference/project-config#project-config

Experiment: I tried creating my own API for a custom resource using Kubebuilder

  1. Kubebuilder wanted me to move main.go to ./cmd/.
  2. After doing that, kubebuilder did setup the CRD, controller, controller_test, suite_test, api.. etc artifacts. But is also added some new dependencies to the project (updated go.mod).
  3. kubebuilder init did not finish successfully, but did generate a lot of artifacts in the project. If we were to go down this path, we want to refactor the code.

This short experiments hints me that CAPZ might have wanted to have more control over their APIs and might have moved away from kubebuilder. OR maybe, we did not add any APIs using kubebuilder create api in a while ?

@nawazkh
Copy link
Member Author

nawazkh commented Jan 27, 2025

/cc @willie-yao

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

I noticed that the ASO managed cluster types are not included here. Is there a reason for that?

@nawazkh
Copy link
Member Author

nawazkh commented Jan 28, 2025

I noticed that the ASO managed cluster types are not included here. Is there a reason for that?

I learned that PROJECT file is supposed to maintain a list of GVKs that are owned & maintained by the project.
So the ones like ASO* and AzureServicePrincipals are GVKs that CAPZ does not own, instead refers it or uses them as dependent resources.
Therefore we would not want to have ASO* resources in PROJECT file. Ideally, we should be finding ASO GVKs in ASO repo.

@willie-yao
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: willie-yao

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 Jan 28, 2025
@k8s-ci-robot k8s-ci-robot merged commit 2329218 into kubernetes-sigs:main Jan 28, 2025
19 checks passed
@nawazkh nawazkh deleted the fix_Project_file branch February 3, 2025 19:52
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. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants