Skip to content

Conversation

@haoqing0110
Copy link
Member

@haoqing0110 haoqing0110 commented Sep 25, 2025

Summary

Related issue(s)

Fixes open-cluster-management-io/ocm#1205

Summary by CodeRabbit

  • Documentation

    • Marked InstallNamespace as deprecated and updated descriptions to recommend using AddonDeploymentConfig.
  • Chores

    • Updated linting tool to golangci-lint v2.4.0 for development consistency.
  • Tests

    • Added lint suppression directives to silence static analysis warnings without changing behavior.

@openshift-ci openshift-ci bot requested review from deads2k and mdelder September 25, 2025 08:46
@coderabbitai
Copy link

coderabbitai bot commented Sep 25, 2025

Walkthrough

Adds deprecation notices for ManagedClusterAddOn spec.installNamespace in both CRD and Go types, updates golangci-lint installation to v2.4.0 in Makefile, and silences staticcheck in specific test assertions. No functional logic changes.

Changes

Cohort / File(s) Summary of change
InstallNamespace deprecation annotations
addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml, addon/v1alpha1/types_managedclusteraddon.go
Marked spec.installNamespace as deprecated with guidance to use AddonDeploymentConfig in CRD description and Go struct comment.
Lint tool upgrade
Makefile
Updated golangci-lint install path/version from v1.64.6 to v2.4.0 (v2 path); lint invocation unchanged.
Staticcheck suppression in tests
test/integration/api/managedclusteraddon_test.go
Added //nolint:staticcheck to three InstallNamespace assertions; no behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • None found.

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The changes add a deprecation notice for spec.installNamespace and update tests and lint tooling, but they do not address the broader upgrade to v1beta1 or removal of all deprecated fields, labels, and finalizers outlined in issue #826, so the PR does not fulfill the linked issue objectives. Please extend the PR to cover all tasks from issue #826 or adjust the linked issue reference to reflect that this PR only adds deprecation notices for spec.installNamespace in v1alpha1, ensuring the scope aligns with the code changes.
Out of Scope Changes Check ⚠️ Warning The update to the Makefile’s golangci-lint installation path and version is unrelated to deprecating the InstallNamespace field and the objectives in the linked issue, introducing an out-of-scope change into this PR. Please remove the lint tool version bump from this PR and submit it in a separate housekeeping commit or PR, keeping this change focused solely on deprecating the InstallNamespace field.
Description Check ⚠️ Warning The description follows the template structure but leaves the Summary section empty and does not describe the changes made in this PR, making it unclear what exactly has been implemented beyond the linked issue reference. Please provide a concise summary of the changes in the Summary section, detailing the deprecation of the InstallNamespace field, the CRD and Go type updates, and any other modifications like the lint tool version and test adjustments.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately describes the primary change, namely deprecating the InstallNamespace field in the v1alpha1 addon API, using the appropriate 🌱 prefix.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e58eb82 and 178f104.

📒 Files selected for processing (4)
  • Makefile (1 hunks)
  • addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml (1 hunks)
  • addon/v1alpha1/types_managedclusteraddon.go (1 hunks)
  • test/integration/api/managedclusteraddon_test.go (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • test/integration/api/managedclusteraddon_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • addon/v1alpha1/types_managedclusteraddon.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: verify
🔇 Additional comments (2)
addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml (1)

89-91: Deprecation notice reads well.

Thanks for spelling out the migration to AddonDeploymentConfig; nothing further needed here.

Makefile (1)

44-46: Upgrade to golangci-lint v2 looks good.

The module path matches the new major-version layout, and the rest of the target remains intact.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@haoqing0110
Copy link
Member Author

/hold

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
addon/v1alpha1/types_managedclusteraddon.go (1)

145-156: Fix the Go deprecation comment format on registrations.

go doc and go vet only recognize deprecations when the comment starts with Deprecated:. As written, this won’t be treated as a real deprecation marker. Please include the colon and a short explanation.

Apply this diff:

-	// Deprecated
+	// Deprecated: registrations will be removed in a future release.
🧹 Nitpick comments (1)
addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml (1)

289-299: Make the CRD deprecation text explicit.

To keep docs consistent with the Go types and clarity for users, mirror the phrasing Deprecated: … here too.

Apply this diff:

-                description: |-
-                  Deprecated
+                description: |-
+                  Deprecated: registrations will be removed in a future release.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b7c6be and e58eb82.

📒 Files selected for processing (4)
  • addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml (1 hunks)
  • addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml (2 hunks)
  • addon/v1alpha1/types_clustermanagementaddon.go (1 hunks)
  • addon/v1alpha1/types_managedclusteraddon.go (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: verify
🔇 Additional comments (1)
addon/v1alpha1/types_managedclusteraddon.go (1)

37-44: Deprecation note for installNamespace looks good.

The Go-style deprecation comment is correctly formatted and keeps behavior unchanged.

@haoqing0110 haoqing0110 force-pushed the br_deprecate-addon-fields branch from e58eb82 to 178f104 Compare September 26, 2025 08:17
@haoqing0110 haoqing0110 changed the title 🌱 Deprecate addon fields in v1alpha1 🌱 Deprecate addon InstallNamespace in v1alpha1 Sep 26, 2025
@haoqing0110
Copy link
Member Author

/unhold

@haoqing0110
Copy link
Member Author

/assign @qiujian16 @zhujian7

Copy link
Member

@qiujian16 qiujian16 left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

@zhujian7
Copy link
Member

/lgtm

@qiujian16
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haoqing0110, qiujian16

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

@openshift-ci openshift-ci bot added the approved label Oct 9, 2025
@haoqing0110
Copy link
Member Author

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit 48b7234 into open-cluster-management-io:main Oct 9, 2025
13 checks passed
@haoqing0110 haoqing0110 deleted the br_deprecate-addon-fields branch October 9, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate addon InstallNamespace in v1alpha1

3 participants