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 missing comments with serialized prefix #11807

Merged

Conversation

tsuzu
Copy link
Contributor

@tsuzu tsuzu commented Feb 5, 2025

What this PR does / why we need it:

  • Add missing comments
  • Rewrite comments to start with serialized names
    • of all Kubernetes API resource

but non-API resources are ignored. This is the list of ignored fields.

  • RuntimeHooks
  • version package
  • clusterctl package
❯ ./hack/tools/staticchecker/staticchecker ./... 2>&1 | grep -v " Items " | grep -v " Spec " | grep -v " Status " | grep -v test | grep -v upstreamv1beta
/cluster-api/exp/runtime/hooks/api/v1alpha1/topologymutation_variable_types.go:30:2: Cluster should have a comment starting with 'cluster ' (missing)
/cluster-api/exp/runtime/hooks/api/v1alpha1/topologymutation_variable_types.go:31:2: ControlPlane should have a comment starting with 'controlPlane ' (missing)
/cluster-api/exp/runtime/hooks/api/v1alpha1/topologymutation_variable_types.go:32:2: MachineDeployment should have a comment starting with 'machineDeployment ' (missing)
/cluster-api/exp/runtime/hooks/api/v1alpha1/topologymutation_variable_types.go:33:2: MachinePool should have a comment starting with 'machinePool ' (missing)
/cluster-api/version/version.go:69:2: Major should have a comment starting with 'major ' (missing)
/cluster-api/version/version.go:70:2: Minor should have a comment starting with 'minor ' (missing)
/cluster-api/version/version.go:71:2: GitVersion should have a comment starting with 'gitVersion ' (missing)
/cluster-api/version/version.go:72:2: GitCommit should have a comment starting with 'gitCommit ' (missing)
/cluster-api/version/version.go:73:2: GitTreeState should have a comment starting with 'gitTreeState ' (missing)
/cluster-api/version/version.go:74:2: BuildDate should have a comment starting with 'buildDate ' (missing)
/cluster-api/version/version.go:75:2: GoVersion should have a comment starting with 'goVersion ' (missing)
/cluster-api/version/version.go:76:2: Compiler should have a comment starting with 'compiler ' (missing)
/cluster-api/version/version.go:77:2: Platform should have a comment starting with 'platform ' (missing)
/cluster-api/cmd/clusterctl/api/v1alpha3/metadata_type.go:32:2: ReleaseSeries should have a comment starting with 'releaseSeries '
/cluster-api/cmd/clusterctl/cmd/version.go:32:2: ClientVersion should have a comment starting with 'clusterctl ' (missing)

I'm not a native English speaker, so I appreciate it if you tell me know gramatical mistakes or awkwardness !

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

The left task is only adding missing spec status items. updated task list #11238 (comment)

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/documentation Issues or PRs related to documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 5, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 5, 2025
@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 5, 2025
@sbueringer
Copy link
Member

/assign @JoelSpeed
for a first round

@sbueringer
Copy link
Member

@tsuzu Any reason why we want to keep this PR in draft, or can we un-draft? :)

Comment on lines 133 to 134
// timeout is the duration after which a node is considered unhealthy
// if the condition has been in the given status.
Copy link
Contributor

Choose a reason for hiding this comment

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

Potentially this reads better?

Suggested change
// timeout is the duration after which a node is considered unhealthy
// if the condition has been in the given status.
// timeout is the duration that a node must be in a given status for,
// after which the node is considered unhealthy.
// For example, with a value of "1h", the node must match the status
// for at least 1 hour before being considered unhealthy.

// +kubebuilder:validation:Type=string
// +kubebuilder:validation:MinLength=1
Status corev1.ConditionStatus `json:"status"`

// timeout is the duration after which a node is considered unhealthy
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps include the suggestion I made on the v1beta1 type

// +kubebuilder:validation:Type=string
// +kubebuilder:validation:MinLength=1
Status corev1.ConditionStatus `json:"status"`

// timeout is the duration after which a node is considered unhealthy
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps include the description suggestion I had on the v1beta1 type

@tsuzu tsuzu marked this pull request as ready for review February 6, 2025 16:52
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 6, 2025
@tsuzu
Copy link
Contributor Author

tsuzu commented Feb 6, 2025

@tsuzu Any reason why we want to keep this PR in draft, or can we un-draft? :)

Ah, sorry! I'd have liked to recheck the description and changes.
I've changed to Ready for review. Thank you for your review!

@tsuzu tsuzu force-pushed the fix-missing-or-unformatted-comments branch from f96935b to 26906b5 Compare February 6, 2025 16:59
@sbueringer
Copy link
Member

sbueringer commented Feb 6, 2025

/ok-to-test

(probably needs make generate manifests)

@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 Feb 6, 2025
@tsuzu tsuzu force-pushed the fix-missing-or-unformatted-comments branch from 26906b5 to b5dbbeb Compare February 6, 2025 18:04
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 6, 2025
@tsuzu
Copy link
Contributor Author

tsuzu commented Feb 6, 2025

(probably needs make generate manifests)

I usually forget it... Thank you!

Apply suggestions from code review

Co-authored-by: Joel Speed <[email protected]>
@tsuzu tsuzu force-pushed the fix-missing-or-unformatted-comments branch from b5dbbeb to be7e672 Compare February 6, 2025 18:16
@sbueringer
Copy link
Member

Thx!

/approve
/lgtm

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

LGTM label has been added.

Git tree hash: ed180bac94037ee52b84fcd75aca97e769f54f65

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 Feb 7, 2025
@k8s-ci-robot k8s-ci-robot merged commit 8863bd1 into kubernetes-sigs:main Feb 7, 2025
18 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Feb 7, 2025
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. area/documentation Issues or PRs related to documentation 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants