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

🌱 (ci): Add linter for the samples scaffolded under docs #4464

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jongwooo
Copy link
Member

@jongwooo jongwooo commented Jan 1, 2025

Fixes #4445

This pull request changes the action to add a linter for the samples scaffolded under docs, reorders imports for better readability, and adds nolint comments to suppress specific linter warnings.

/cc @camilamacedo86

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jongwooo
Once this PR has been reviewed and has the lgtm label, please assign kavinjsir for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 1, 2025
@jongwooo
Copy link
Member Author

jongwooo commented Jan 1, 2025

/retitle 🌱 (ci): Add linter for the samples scaffolded under docs

@k8s-ci-robot k8s-ci-robot changed the title ci: Add linter for the samples scaffolded under docs 🌱 (ci): Add linter for the samples scaffolded under docs Jan 1, 2025
This commit change the action to add linter for the samples scaffolded under docs

Signed-off-by: Jongwoo Han <[email protected]>
@jongwooo jongwooo force-pushed the ci/add-linter-for-the-samples-scaffolded-under-docs branch from 6784efa to 782e274 Compare January 1, 2025 14:34
@k8s-ci-robot
Copy link
Contributor

@jongwooo: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubebuilder-e2e-k8s-1-32-0 782e274 link true /test pull-kubebuilder-e2e-k8s-1-32-0

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@@ -129,7 +129,7 @@ var _ = Describe("CronJob controller", func() {
By("By checking the CronJob has zero active Jobs")
Consistently(func(g Gomega) {
g.Expect(k8sClient.Get(ctx, cronjobLookupKey, createdCronjob)).To(Succeed())
g.Expect(createdCronjob.Status.Active).To(HaveLen(0))
g.Expect(createdCronjob.Status.Active).To(HaveLen(0)) // nolint:ginkgolinter
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @jongwooo

to apply changes to these files, you need to change code in hack/docs/internal folder, and then run make generate.

For example, for this line, you need to change it here

g.Expect(createdCronjob.Status.Active).To(HaveLen(0))

@@ -96,6 +97,7 @@ var (
//
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile
// nolint:gocyclo
Copy link
Member

Choose a reason for hiding this comment

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

HI @jongwooo

That is nice, but see that ALL samples under the docs are generated with the tools and we have a code implementation to add the code on top. They are generated automatically when we run make generate-docs.

See: https://github.com/kubernetes-sigs/kubebuilder/tree/master/hack/docs

So, the changes on the docs need to be addressed there.

Copy link
Member

Choose a reason for hiding this comment

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

If we change anything that change the default scaffold then we run make generate which will re-generate the samples under testdata and the docs as well

@jongwooo jongwooo marked this pull request as draft January 4, 2025 16:18
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add linter for the samples scaffolded under docs
4 participants