Skip to content

WIP: pkg/internal/constants: Deprecate Upgradeable* subcondition constants#1391

Open
wking wants to merge 1 commit into
openshift:mainfrom
wking:upgradeable-as-update-risk
Open

WIP: pkg/internal/constants: Deprecate Upgradeable* subcondition constants#1391
wking wants to merge 1 commit into
openshift:mainfrom
wking:upgradeable-as-update-risk

Conversation

@wking
Copy link
Copy Markdown
Member

@wking wking commented May 19, 2026

We only use these in RemoveOperatorStatusCondition calls since ea13ba6 (#1368). Mark them as deprecated with expected removals in the 5.1 dev cycle, to reduce the odds that other folks start consuming them now. That's unlikely, because they're in pkg/internal, but it's easy to add the standard deprecation Godocs.

Summary by CodeRabbit

  • Documentation
    • Updated deprecation notes for several cluster condition constants to state that in 5.0 those subconditions are no longer populated and the consolidated Upgradeable condition is used instead.
    • Added guidance that the deprecated constants are planned for removal in 5.1 and clarified that there are no runtime behavior changes in 5.0.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

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: 813cfe2d-2291-4471-af15-cd6c14b3df2b

📥 Commits

Reviewing files that changed from the base of the PR and between 9b7b338 and 7f4dcb7.

📒 Files selected for processing (2)
  • pkg/cvo/status.go
  • pkg/internal/constants.go
✅ Files skipped from review due to trivial changes (2)
  • pkg/cvo/status.go
  • pkg/internal/constants.go

Walkthrough

Adds Deprecated doc comments to five deprecated Upgradeable* constants in pkg/internal/constants.go and adds //nolint:staticcheck // Ignore SA1019 until 5.1 annotations to the resourcemerge.RemoveOperatorStatusCondition calls in pkg/cvo/status.go. No functional behavior changed.

Changes

Deprecation documentation and minor annotation change

Layer / File(s) Summary
Deprecation docs for Upgradeable constants
pkg/internal/constants.go
Deprecated comment blocks added to UpgradeableAdminAckRequired, UpgradeableDeletesInProgress, UpgradeableClusterOperators, UpgradeableClusterVersionOverrides, and UpgradeableUpgradeInProgress documenting that these subconditions are no longer populated and are slated for removal.
Add nolint annotations to status removals
pkg/cvo/status.go
Added //nolint:staticcheck // Ignore SA1019 until 5.1 to resourcemerge.RemoveOperatorStatusCondition calls that remove obsolete upgrade-related subconditions; behavior unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding deprecation markers to Upgradeable* subcondition constants in pkg/internal/constants, which aligns with the PR's primary objective.
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.
Stable And Deterministic Test Names ✅ Passed The PR only modifies pkg/internal/constants.go (deprecation docs) and pkg/cvo/status.go (linter comments). No test files were modified, and no Ginkgo test names were added, changed, or created.
Test Structure And Quality ✅ Passed PR modifies only non-test files (constants and status). The custom check evaluates Ginkgo test code quality, which is not applicable to this PR.
Microshift Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. It only updates documentation comments in pkg/internal/constants.go and adds nolint directives in pkg/cvo/status.go. The custom check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds deprecation comments to constants in production code files only, not new Ginkgo e2e tests. SNO test compatibility check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR only adds deprecation documentation and linter directives. No deployment manifests, scheduling constraints, affinity rules, or topology logic are introduced.
Ote Binary Stdout Contract ✅ Passed PR contains only documentation and lint directive changes with no new stdout writes, logging calls, or executable code that could corrupt OTE binary stdout contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds no new Ginkgo e2e tests; only adds deprecation comments and lint directives. Custom check is not applicable.

✏️ 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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wking

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:

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 Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2026
@wking wking force-pushed the upgradeable-as-update-risk branch 2 times, most recently from 9b7b338 to 7f4dcb7 Compare May 20, 2026 01:28
We only use these in RemoveOperatorStatusCondition calls since
ea13ba6 (pkg: Use risk.Source framework to feed Upgradeable,
2026-04-05, openshift#1368).  Mark them as deprecated with expected removals in
the 5.1 dev cycle, to reduce the odds that other folks start consuming
them now.  That's unlikely, because they're in pkg/internal, but it's
easy to add the standard deprecation Godocs [1].

The nolint directives avoid [2]:

  pkg/cvo/status.go:641:68: SA1019: internal.UpgradeableAdminAckRequired is deprecated: In 5.0, we stopped populating Upgradeable* subconditions, and now populate Upgradeable directly. The constants remain so we can remove them from 5.0 ClusterVersion status, but we will remove the constants themselves in 5.1. (staticcheck)
  	resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, internal.UpgradeableAdminAckRequired)
	                                                                  ^
and similar.

[1]: https://go.dev/wiki/Deprecated
[2]: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_cluster-version-operator/1391/pull-ci-openshift-cluster-version-operator-main-lint/2056884282562973696#1:build-log.txt%3A28
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

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

Test name Commit Details Required Rerun command
ci/prow/lint 7f4dcb7 link true /test lint
ci/prow/e2e-agnostic-operator 7f4dcb7 link true /test e2e-agnostic-operator
ci/prow/unit 7f4dcb7 link true /test unit
ci/prow/e2e-hypershift-conformance 7f4dcb7 link true /test e2e-hypershift-conformance

Full PR test history. Your PR dashboard.

Details

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.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant