Skip to content

fix: fix CI checks — CRD regeneration, license config, and lint#588

Merged
loveRhythm1990 merged 6 commits into
mainfrom
fix-webhook-tests
Apr 27, 2026
Merged

fix: fix CI checks — CRD regeneration, license config, and lint#588
loveRhythm1990 merged 6 commits into
mainfrom
fix-webhook-tests

Conversation

@xzxiong

@xzxiong xzxiong commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the test_workflows / checks CI failure on main caused by stale CRDs, license header validation, and a lint warning.

Changes

  1. Fix +required / +optional markers — align kubebuilder markers with actual field semantics:

    • MatrixOneClusterSpec.ImageRepository: +required+optional — optional override for the default image repository
    • InitialConfig.LogShards: +required+optional — webhook defaults to 1
    • InitialConfig.DNShards: +required+optional — webhook defaults to 1
    • InitialConfig.LogShardReplicas: +required+optional — webhook defaults to 3 (or 1)
  2. Fix webhook tests (cnset_webhook_test.go, dnset_webhook_test.go, proxy_webhook_test.go): Provide HAKeeperEndpoint: "test" when creating ExternalLogSet objects

  3. Regenerate CRDs: All CRD manifests regenerated with controller-gen v0.16.0

  4. Fix license check (.licenserc.yml): Add copyright-year and pattern to accept year-range headers (Copyright 2025-2026)

  5. Fix lint warning (pkg/controllers/cnclaim/controller_test.go): Rename unused params to _

Fields that remain +required and why

Field Reason
ExternalLogSet.HAKeeperEndpoint An ExternalLogSet without an endpoint is meaningless — it's the only field in the struct
Volume.Size A volume must have a size; there is no sensible default
S3Provider.Path S3 storage path is required to locate data
NFSProvider.Path NFS mount path is required
CertificateRef.Name Certificate secret reference must have a name
CertificateRef.Files Certificate must specify which files to use
LogSetSpec.Volume LogSet requires persistent storage
LogSetSpec.SharedStorage LogSet requires shared storage configuration
BucketClaimSpec.S3 BucketClaim must specify a storage provider
MatrixOneClusterSpec.Version Cluster must have a version to select container images
CNGroup.Name CN groups must be named for identification

Root Cause

controller-gen v0.16.0 properly enforces +required markers in CRD OpenAPI schemas. The committed CRDs were generated with an older version that silently ignored the mismatch between +required and omitempty. Several fields were incorrectly marked +required when they are actually optional with webhook defaults.

Test plan

  • CI checks job passes
  • CI e2e job passes

🤖 Generated with Claude Code

ImageRepository was incorrectly marked +required but is an optional override field.
Webhook tests created ExternalLogSet without the required HAKeeperEndpoint field.
CRDs were stale and inconsistent with the Go type markers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

license-eye has checked 305 files.

Valid Invalid Ignored Fixed
0 141 164 0
Click to see the invalid file list
  • api/core/v1alpha1/br_types.go
  • api/core/v1alpha1/bucketclaim_helpers.go
  • api/core/v1alpha1/bucketclaim_types.go
  • api/core/v1alpha1/cnclaim_helper.go
  • api/core/v1alpha1/cnclaim_types.go
  • api/core/v1alpha1/cnpool_helper.go
  • api/core/v1alpha1/cnpool_types.go
  • api/core/v1alpha1/cnset_types.go
  • api/core/v1alpha1/common_helpers.go
  • api/core/v1alpha1/common_helpers_test.go
  • api/core/v1alpha1/common_types.go
  • api/core/v1alpha1/dnset_types.go
  • api/core/v1alpha1/groupversion_info.go
  • api/core/v1alpha1/logset_helpers.go
  • api/core/v1alpha1/logset_types.go
  • api/core/v1alpha1/logset_types_test.go
  • api/core/v1alpha1/matrixonecluster_helpers.go
  • api/core/v1alpha1/matrixonecluster_types.go
  • api/core/v1alpha1/operator_version.go
  • api/core/v1alpha1/proxy_types.go
  • api/core/v1alpha1/semver.go
  • api/core/v1alpha1/semver_test.go
  • api/core/v1alpha1/store_helper.go
  • api/core/v1alpha1/toml_config.go
  • api/core/v1alpha1/toml_config_test.go
  • api/core/v1alpha1/webui_types.go
  • api/core/v1alpha1/zz_generated.deepcopy.go
  • api/features/features.go
  • cmd/hacli/main.go
  • cmd/operator/main.go
  • cmd/rpccli/main.go
  • pkg/cmd/client.go
  • pkg/cmd/types.go
  • pkg/controllers/br/backup_controller.go
  • pkg/controllers/br/command.go
  • pkg/controllers/br/common.go
  • pkg/controllers/br/gc_controller.go
  • pkg/controllers/br/restore_controller.go
  • pkg/controllers/bucketclaim/controller.go
  • pkg/controllers/bucketclaim/controller_test.go
  • pkg/controllers/bucketclaim/jobtpl.go
  • pkg/controllers/bucketclaim/options.go
  • pkg/controllers/cnclaim/controller.go
  • pkg/controllers/cnclaim/controller_test.go
  • pkg/controllers/cnclaim/migrate.go
  • pkg/controllers/cnclaimset/controller.go
  • pkg/controllers/cnclaimset/controller_test.go
  • pkg/controllers/cnpool/controller.go
  • pkg/controllers/cnpool/controller_test.go
  • pkg/controllers/cnset/controller.go
  • pkg/controllers/cnset/controller_test.go
  • pkg/controllers/cnset/resource.go
  • pkg/controllers/cnset/resource_test.go
  • pkg/controllers/cnset/utils.go
  • pkg/controllers/cnstore/controller.go
  • pkg/controllers/cnstore/metric.go
  • pkg/controllers/cnstore/pooling.go
  • pkg/controllers/common/cnstore.go
  • pkg/controllers/common/cnstore_test.go
  • pkg/controllers/common/configmap.go
  • pkg/controllers/common/configmap_test.go
  • pkg/controllers/common/consts.go
  • pkg/controllers/common/failover.go
  • pkg/controllers/common/fileservice.go
  • pkg/controllers/common/fileservice_test.go
  • pkg/controllers/common/history.go
  • pkg/controllers/common/history_test.go
  • pkg/controllers/common/operatorcfg.go
  • pkg/controllers/common/pod.go
  • pkg/controllers/common/pod_test.go
  • pkg/controllers/common/podset.go
  • pkg/controllers/common/podset_test.go
  • pkg/controllers/common/selector.go
  • pkg/controllers/common/template.go
  • pkg/controllers/common/types.go
  • pkg/controllers/common/volume.go
  • pkg/controllers/dnset/controller.go
  • pkg/controllers/dnset/controller_test.go
  • pkg/controllers/dnset/resource.go
  • pkg/controllers/dnset/resource_test.go
  • pkg/controllers/dnset/utils.go
  • pkg/controllers/logset/bootstrap.go
  • pkg/controllers/logset/bucketclaim.go
  • pkg/controllers/logset/configmap.go
  • pkg/controllers/logset/configmap_test.go
  • pkg/controllers/logset/controller.go
  • pkg/controllers/logset/controller_test.go
  • pkg/controllers/logset/discovery.go
  • pkg/controllers/logset/sts.go
  • pkg/controllers/logset/sts_test.go
  • pkg/controllers/mocluster/controller.go
  • pkg/controllers/mocluster/controller_test.go
  • pkg/controllers/proxyset/controller.go
  • pkg/controllers/proxyset/resource.go
  • pkg/controllers/webhook/controller.go
  • pkg/controllers/webui/controller.go
  • pkg/controllers/webui/controller_test.go
  • pkg/controllers/webui/resource.go
  • pkg/controllers/webui/utils.go
  • pkg/hook/cnclaim.go
  • pkg/hook/cnclaimset.go
  • pkg/metric/rpc.go
  • pkg/metric/types.go
  • pkg/mocli/cn_cache.go
  • pkg/mocli/lockservice_client.go
  • pkg/mocli/manager.go
  • pkg/mosql/client.go
  • pkg/mosql/fake.go
  • pkg/querycli/query.go
  • pkg/utils/utils.go
  • pkg/webhook/cnset_webhook.go
  • pkg/webhook/cnset_webhook_test.go
  • pkg/webhook/common.go
  • pkg/webhook/convertor/convertor.go
  • pkg/webhook/convertor/convertor_test.go
  • pkg/webhook/corevalidation/exported.go
  • pkg/webhook/dnset_webhook.go
  • pkg/webhook/dnset_webhook_test.go
  • pkg/webhook/logset_webhook.go
  • pkg/webhook/logset_webhook_test.go
  • pkg/webhook/matrixonecluster_webhook.go
  • pkg/webhook/matrixonecluster_webhook_test.go
  • pkg/webhook/proxy_webhook.go
  • pkg/webhook/proxy_webhook_test.go
  • pkg/webhook/utils.go
  • pkg/webhook/webhook.go
  • pkg/webhook/webhook_suite_test.go
  • pkg/webhook/webui_webhook.go
  • test/e2e/bucket_test.go
  • test/e2e/claim_test.go
  • test/e2e/cnset_test.go
  • test/e2e/dnset_test.go
  • test/e2e/e2eminio/minios3.go
  • test/e2e/logset_test.go
  • test/e2e/matrixonecluster_test.go
  • test/e2e/proxy_test.go
  • test/e2e/sql/sql.go
  • test/e2e/suite_test.go
  • test/e2e/util/patch.go
  • test/e2e/util/portforward.go
  • test/e2e/util/template.go
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

license-eye has checked 305 files.

Valid Invalid Ignored Fixed
0 141 164 0
Click to see the invalid file list
  • api/core/v1alpha1/br_types.go
  • api/core/v1alpha1/bucketclaim_helpers.go
  • api/core/v1alpha1/bucketclaim_types.go
  • api/core/v1alpha1/cnclaim_helper.go
  • api/core/v1alpha1/cnclaim_types.go
  • api/core/v1alpha1/cnpool_helper.go
  • api/core/v1alpha1/cnpool_types.go
  • api/core/v1alpha1/cnset_types.go
  • api/core/v1alpha1/common_helpers.go
  • api/core/v1alpha1/common_helpers_test.go
  • api/core/v1alpha1/common_types.go
  • api/core/v1alpha1/dnset_types.go
  • api/core/v1alpha1/groupversion_info.go
  • api/core/v1alpha1/logset_helpers.go
  • api/core/v1alpha1/logset_types.go
  • api/core/v1alpha1/logset_types_test.go
  • api/core/v1alpha1/matrixonecluster_helpers.go
  • api/core/v1alpha1/matrixonecluster_types.go
  • api/core/v1alpha1/operator_version.go
  • api/core/v1alpha1/proxy_types.go
  • api/core/v1alpha1/semver.go
  • api/core/v1alpha1/semver_test.go
  • api/core/v1alpha1/store_helper.go
  • api/core/v1alpha1/toml_config.go
  • api/core/v1alpha1/toml_config_test.go
  • api/core/v1alpha1/webui_types.go
  • api/core/v1alpha1/zz_generated.deepcopy.go
  • api/features/features.go
  • cmd/hacli/main.go
  • cmd/operator/main.go
  • cmd/rpccli/main.go
  • pkg/cmd/client.go
  • pkg/cmd/types.go
  • pkg/controllers/br/backup_controller.go
  • pkg/controllers/br/command.go
  • pkg/controllers/br/common.go
  • pkg/controllers/br/gc_controller.go
  • pkg/controllers/br/restore_controller.go
  • pkg/controllers/bucketclaim/controller.go
  • pkg/controllers/bucketclaim/controller_test.go
  • pkg/controllers/bucketclaim/jobtpl.go
  • pkg/controllers/bucketclaim/options.go
  • pkg/controllers/cnclaim/controller.go
  • pkg/controllers/cnclaim/controller_test.go
  • pkg/controllers/cnclaim/migrate.go
  • pkg/controllers/cnclaimset/controller.go
  • pkg/controllers/cnclaimset/controller_test.go
  • pkg/controllers/cnpool/controller.go
  • pkg/controllers/cnpool/controller_test.go
  • pkg/controllers/cnset/controller.go
  • pkg/controllers/cnset/controller_test.go
  • pkg/controllers/cnset/resource.go
  • pkg/controllers/cnset/resource_test.go
  • pkg/controllers/cnset/utils.go
  • pkg/controllers/cnstore/controller.go
  • pkg/controllers/cnstore/metric.go
  • pkg/controllers/cnstore/pooling.go
  • pkg/controllers/common/cnstore.go
  • pkg/controllers/common/cnstore_test.go
  • pkg/controllers/common/configmap.go
  • pkg/controllers/common/configmap_test.go
  • pkg/controllers/common/consts.go
  • pkg/controllers/common/failover.go
  • pkg/controllers/common/fileservice.go
  • pkg/controllers/common/fileservice_test.go
  • pkg/controllers/common/history.go
  • pkg/controllers/common/history_test.go
  • pkg/controllers/common/operatorcfg.go
  • pkg/controllers/common/pod.go
  • pkg/controllers/common/pod_test.go
  • pkg/controllers/common/podset.go
  • pkg/controllers/common/podset_test.go
  • pkg/controllers/common/selector.go
  • pkg/controllers/common/template.go
  • pkg/controllers/common/types.go
  • pkg/controllers/common/volume.go
  • pkg/controllers/dnset/controller.go
  • pkg/controllers/dnset/controller_test.go
  • pkg/controllers/dnset/resource.go
  • pkg/controllers/dnset/resource_test.go
  • pkg/controllers/dnset/utils.go
  • pkg/controllers/logset/bootstrap.go
  • pkg/controllers/logset/bucketclaim.go
  • pkg/controllers/logset/configmap.go
  • pkg/controllers/logset/configmap_test.go
  • pkg/controllers/logset/controller.go
  • pkg/controllers/logset/controller_test.go
  • pkg/controllers/logset/discovery.go
  • pkg/controllers/logset/sts.go
  • pkg/controllers/logset/sts_test.go
  • pkg/controllers/mocluster/controller.go
  • pkg/controllers/mocluster/controller_test.go
  • pkg/controllers/proxyset/controller.go
  • pkg/controllers/proxyset/resource.go
  • pkg/controllers/webhook/controller.go
  • pkg/controllers/webui/controller.go
  • pkg/controllers/webui/controller_test.go
  • pkg/controllers/webui/resource.go
  • pkg/controllers/webui/utils.go
  • pkg/hook/cnclaim.go
  • pkg/hook/cnclaimset.go
  • pkg/metric/rpc.go
  • pkg/metric/types.go
  • pkg/mocli/cn_cache.go
  • pkg/mocli/lockservice_client.go
  • pkg/mocli/manager.go
  • pkg/mosql/client.go
  • pkg/mosql/fake.go
  • pkg/querycli/query.go
  • pkg/utils/utils.go
  • pkg/webhook/cnset_webhook.go
  • pkg/webhook/cnset_webhook_test.go
  • pkg/webhook/common.go
  • pkg/webhook/convertor/convertor.go
  • pkg/webhook/convertor/convertor_test.go
  • pkg/webhook/corevalidation/exported.go
  • pkg/webhook/dnset_webhook.go
  • pkg/webhook/dnset_webhook_test.go
  • pkg/webhook/logset_webhook.go
  • pkg/webhook/logset_webhook_test.go
  • pkg/webhook/matrixonecluster_webhook.go
  • pkg/webhook/matrixonecluster_webhook_test.go
  • pkg/webhook/proxy_webhook.go
  • pkg/webhook/proxy_webhook_test.go
  • pkg/webhook/utils.go
  • pkg/webhook/webhook.go
  • pkg/webhook/webhook_suite_test.go
  • pkg/webhook/webui_webhook.go
  • test/e2e/bucket_test.go
  • test/e2e/claim_test.go
  • test/e2e/cnset_test.go
  • test/e2e/dnset_test.go
  • test/e2e/e2eminio/minios3.go
  • test/e2e/logset_test.go
  • test/e2e/matrixonecluster_test.go
  • test/e2e/proxy_test.go
  • test/e2e/sql/sql.go
  • test/e2e/suite_test.go
  • test/e2e/util/patch.go
  • test/e2e/util/portforward.go
  • test/e2e/util/template.go
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

@@ -1,4 +1,4 @@
// Copyright 2025 Matrix Origin
// Copyright 2025-2026 Matrix Origin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2025-2026 Matrix Origin
// Copyright 2026 Matrix Origin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2025-2026 Matrix Origin

@@ -1,4 +1,4 @@
// Copyright 2025 Matrix Origin
// Copyright 2025-2026 Matrix Origin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2025-2026 Matrix Origin
// Copyright 2026 Matrix Origin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2025-2026 Matrix Origin

@@ -1,4 +1,4 @@
// Copyright 2025 Matrix Origin
// Copyright 2025-2026 Matrix Origin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2025-2026 Matrix Origin
// Copyright 2026 Matrix Origin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2025-2026 Matrix Origin

@@ -1,4 +1,4 @@
// Copyright 2025 Matrix Origin
// Copyright 2025-2026 Matrix Origin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2025-2026 Matrix Origin
// Copyright 2026 Matrix Origin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2025-2026 Matrix Origin

xzxiong and others added 3 commits April 26, 2026 17:48
The license checker rejects headers like "Copyright 2025-2026" without a
pattern that accepts year ranges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes golangci-lint revive/unused-parameter warning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xzxiong xzxiong changed the title fix: fix webhook tests and regenerate CRDs for controller-gen v0.16.0 fix: fix CI checks — CRD regeneration, license config, and lint Apr 26, 2026
LogShards, DNShards, and LogShardReplicas all have webhook defaults and
are pointer types with omitempty — they are optional fields that get
defaulted, not required inputs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@loveRhythm1990 loveRhythm1990 merged commit b8b1684 into main Apr 27, 2026
4 checks passed
@loveRhythm1990 loveRhythm1990 deleted the fix-webhook-tests branch April 27, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants