Skip to content

refactor: drop MetricsConfig from ToolchainStatus type#500

Merged
xcoulon merged 3 commits intocodeready-toolchain:masterfrom
xcoulon:toolchain_status_metrics_api_drop
Mar 5, 2026
Merged

refactor: drop MetricsConfig from ToolchainStatus type#500
xcoulon merged 3 commits intocodeready-toolchain:masterfrom
xcoulon:toolchain_status_metrics_api_drop

Conversation

@xcoulon
Copy link
Contributor

@xcoulon xcoulon commented Mar 4, 2026

metrics are not stored in the ToolchainStatus anymore
also, no need to keep the MetricsConfig in the ToolchainConfig anymore,
since host-operator metrics are always recounted from the resources during startup.
(ForceSynchronization was always true)

Signed-off-by: Xavier Coulon xcoulon@redhat.com

Summary by CodeRabbit

  • Chores

    • Removed metrics tracking/configuration and related status entries from the API.
    • Removed per-member space count and the "MURs" status column previously shown in listings.
    • Cleaned up generated helpers and public API schema to reflect these removals.
  • Documentation

    • Trimmed API reference to remove metrics-related sections and added a note that the masterUserRecord field is immutable.

metrics are not stored in the `ToolchainStatus` anymore
also, no need to keep the `MetricsConfig` in the `ToolchainConfig` anymore,
since host-operator metrics are always recounted from the resources during startup.
(`ForceSynchronization` was always `true`)

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25867968-606a-43dc-8ab7-21c2f83cca74

📥 Commits

Reviewing files that changed from the base of the PR and between f4024c6 and a6c5b4a.

📒 Files selected for processing (4)
  • api/v1alpha1/docs/apiref.adoc
  • api/v1alpha1/toolchainconfig_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • api/v1alpha1/zz_generated.openapi.go
💤 Files with no reviewable changes (3)
  • api/v1alpha1/toolchainconfig_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • api/v1alpha1/docs/apiref.adoc

Walkthrough

Removed metrics-related API types, fields, constants, and associated generated code across the api/v1alpha1 package, and deleted the Member.SpaceCount field; corresponding OpenAPI schema entries and documentation blocks were also removed.

Changes

Cohort / File(s) Summary
API type changes
api/v1alpha1/toolchainconfig_types.go, api/v1alpha1/toolchainstatus_types.go
Removed MetricsConfig type and HostConfig.Metrics field; removed Metric alias, ToolchainStatusStatus.Metrics field, Member.SpaceCount field, and two Prometheus metric key constants; removed kubebuilder printcolumn for MURs.
Generated deepcopy
api/v1alpha1/zz_generated.deepcopy.go
Deleted DeepCopy/DeepCopyInto methods for Metric and MetricsConfig; removed metrics-related deep-copy logic from HostConfig.DeepCopyInto and ToolchainStatusStatus.DeepCopyInto.
Generated OpenAPI
api/v1alpha1/zz_generated.openapi.go
Removed OpenAPI definition function and registry entry for MetricsConfig; removed metrics property from ToolchainStatusStatus schema and spaceCount from Member schema; updated dependency lists to drop MetricsConfig.
Documentation
api/v1alpha1/docs/apiref.adoc
Removed metrics-related documentation sections and references (Metric, MetricsConfig, metrics fields); added a note marking binding.masterUserRecord as immutable via validating webhook.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required sections from the template (Checks checklist with yes/no answers and PR links for dependent projects). Add the Checks section with answers to all checklist items and provide PR links for host-operator and member-operator if changes were made in those projects.
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.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing MetricsConfig from ToolchainStatus and related types.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

Looks like a forgotten legacy zombie, but this line can be removed too:

// +kubebuilder:printcolumn:name="MURs",type="integer",JSONPath=`.status.hostOperator.masterUserRecordCount`

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@xcoulon
Copy link
Contributor Author

xcoulon commented Mar 5, 2026

Looks like a forgotten legacy zombie, but this line can be removed too:

// +kubebuilder:printcolumn:name="MURs",type="integer",JSONPath=`.status.hostOperator.masterUserRecordCount`

good catch! removed in f4024c6

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

@xcoulon xcoulon merged commit 4ff0e6b into codeready-toolchain:master Mar 5, 2026
6 of 7 checks passed
@xcoulon xcoulon deleted the toolchain_status_metrics_api_drop branch March 5, 2026 14:40
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.

4 participants