Skip to content

check-cluster-profiles-config: Diff with pointers#5162

Merged
openshift-merge-robot merged 1 commit into
openshift:mainfrom
danilo-gemoli:fix/check-cluster-profiles-config/profiles-diff
May 6, 2026
Merged

check-cluster-profiles-config: Diff with pointers#5162
openshift-merge-robot merged 1 commit into
openshift:mainfrom
danilo-gemoli:fix/check-cluster-profiles-config/profiles-diff

Conversation

@danilo-gemoli

@danilo-gemoli danilo-gemoli commented May 6, 2026

Copy link
Copy Markdown
Contributor

Otherwise they won't ever be the same.

Summary by CodeRabbit

  • Bug Fixes
    • Improved cluster profile configuration validation to use more accurate comparison method for detecting inconsistencies in normalized profiles.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: d1fc847a-698f-4450-abac-e48b1052dbaa

📥 Commits

Reviewing files that changed from the base of the PR and between b1cad87 and 1c94b7d.

📒 Files selected for processing (1)
  • cmd/check-cluster-profiles-config/main.go

📝 Walkthrough

Walkthrough

The cluster-profile normalization check is modified to compare pointers instead of values when diffing the original profiles against their normalized copy. This is a single-line change affecting how the comparison is performed.

Changes

Pointer Comparison in Profile Normalization Check

Layer / File(s) Summary
Diff Logic
cmd/check-cluster-profiles-config/main.go
Line 105: The diff invocation now compares &profiles (pointer to original) against the normalized copy pointer, rather than comparing values directly. The DeepCopy and normalization steps remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 12 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Coverage For New Features ⚠️ Warning Bug fix lacks regression test. The change (line 105) fixes a diff comparison with pointers, but no regression test was added to validate the fix. Add a regression test in main_test.go that verifies the diff comparison correctly identifies normalized vs unnormalized profiles when comparing pointers.
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the core change: using pointers for diff comparison in the cluster profiles config checker.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Go Error Handling ✅ Passed The PR change (adding & on line 105 for pointer comparison) introduces no error handling code. It complies with Go error patterns: no ignored errors, no panic, and no unsafe pointer dereferences.
Stable And Deterministic Test Names ✅ Passed PR modifies only main.go. Test file uses standard Go testing (not Ginkgo). No Ginkgo tests present. Check does not apply.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test quality is not applicable. PR modifies cmd/check-cluster-profiles-config/main.go and its test file uses standard Go testing.T framework, not Ginkgo.
Microshift Test Compatibility ✅ Passed This PR modifies only cmd/check-cluster-profiles-config/main.go, a utility tool file, with no Ginkgo e2e tests added. The check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies cmd/check-cluster-profiles-config/main.go (a CLI validation utility), not e2e tests. No Ginkgo tests are added, so the SNO Test Compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Check requires topology-aware scheduling in deployment/operator/controller code. PR modifies a configuration validation tool with no scheduling logic or manifests. Not applicable.
Ote Binary Stdout Contract ✅ Passed Binary is not OTE test runner. It is a CLI validation tool. The fmt.Print at line 106 outputs intentional diff output. PR only changes pointer semantics.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies cmd/check-cluster-profiles-config/main.go, a command-line utility tool, not Ginkgo e2e tests. The custom check applies only to e2e tests and is not applicable here.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from bear-redhat and droslean May 6, 2026 14:33
@danilo-gemoli

Copy link
Copy Markdown
Contributor Author

/test e2e

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2026
@psalajova

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2026
@openshift-ci

openshift-ci Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danilo-gemoli, psalajova

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [danilo-gemoli,psalajova]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 7a79153 into openshift:main May 6, 2026
8 of 17 checks passed
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

@danilo-gemoli bot-merging this because we are a bit in hurry

@danilo-gemoli danilo-gemoli deleted the fix/check-cluster-profiles-config/profiles-diff branch May 19, 2026 20:49
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants