Skip to content

ACM-32735: Add better API docs to CRDs#10124

Open
carbonin wants to merge 1 commit intoopenshift:masterfrom
carbonin:improve-crd-doc-strings
Open

ACM-32735: Add better API docs to CRDs#10124
carbonin wants to merge 1 commit intoopenshift:masterfrom
carbonin:improve-crd-doc-strings

Conversation

@carbonin
Copy link
Copy Markdown
Member

@carbonin carbonin commented Apr 10, 2026

Update CRDs with more useful API documentation. This focuses on the fields called out in ACM-32735 specifically.

List all the issues related to this PR

Resolves https://redhat.atlassian.net/browse/ACM-32735

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see [CONTRIBUTING] guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Update CRDs with more useful API documentation. This focuses on the
fields called out in ACM-32735 specifically.

Resolves https://redhat.atlassian.net/browse/ACM-32735
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 10, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 10, 2026

@carbonin: This pull request references ACM-32735 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Update CRDs with more useful API documentation. This focuses on the fields called out in ACM-32735 specifically.

List all the issues related to this PR

Resolves https://redhat.atlassian.net/browse/ACM-32735

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see [CONTRIBUTING] guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 10, 2026
@openshift-ci openshift-ci bot requested review from danmanor and linoyaslan April 10, 2026 19:49
@openshift-ci openshift-ci bot added the api-review Categorizes an issue or PR as actively needing an API review. label Apr 10, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carbonin

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 Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Walkthrough

Documentation and schema description updates across Go source files and CRD manifests clarify field semantics, expand definitions for Agent, InfraEnv, and AgentClusterInstall types, and mark VIP fields as deprecated in favor of plural variants for dual-stack configurations.

Changes

Cohort / File(s) Summary
Go API Documentation
api/hiveextension/v1beta1/agentclusterinstall_types.go, api/v1beta1/agent_types.go, api/v1beta1/infraenv_types.go
Updated GoDoc comments to clarify Agent/InfraEnv/AgentClusterInstall field semantics, expand role/hostname/MachineConfigPool/Approved descriptions, mark APIVIP/IngressVIP as deprecated for dual-stack, and document Arbiter TNA topology usage.
CRD Base Manifests
config/crd/bases/agent-install.openshift.io_agents.yaml, config/crd/bases/agent-install.openshift.io_infraenvs.yaml, config/crd/bases/extensions.hive.openshift.io_agentclusterinstalls.yaml
Expanded OpenAPI schema descriptions for spec/status fields including cpuArchitecture valid values, mirrorRegistryRef TOML keys, arbiter TNA guidance, and deprecated VIP field notices.
CRD Resource Definitions
config/crd/resources.yaml
Comprehensive schema documentation updates across Agent, AgentStatus, AgentClusterInstallSpec, and InfraEnv resources, including field behavior clarifications and deprecation text.
OLM Catalog Manifests
config/manifests/bases/assisted-service-operator.clusterserviceversion.yaml, deploy/olm-catalog/manifests/agent-install.openshift.io_agents.yaml, deploy/olm-catalog/manifests/agent-install.openshift.io_infraenvs.yaml, deploy/olm-catalog/manifests/extensions.hive.openshift.io_agentclusterinstalls.yaml, deploy/olm-catalog/manifests/assisted-service-operator.clusterserviceversion.yaml
Updated CRD owned API descriptions and schema field documentation in OLM catalog to match base manifest and source documentation improvements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

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

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

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/crd/bases/extensions.hive.openshift.io_agentclusterinstalls.yaml`:
- Around line 58-62: The description for APIVIP and analogous singular VIP
fields is misleading: update the YAML description text so it documents that when
both singular (APIVIP/IngressVIP) and plural (apiVIPs/ingressVIPs) fields are
provided they must match (backwards-compatibility validation will reject
mismatches) rather than being silently ignored; reference the backend validation
behavior implemented in HandleApiVipBackwardsCompatibility and
HandleIngressVipBackwardsCompatibility and state that the singular fields are
deprecated but still validated for equality with the corresponding entry in the
plural lists when both are set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f450df5-f227-4a4a-baa5-9123901c39b5

📥 Commits

Reviewing files that changed from the base of the PR and between 866e3ab and 6afa67c.

⛔ Files ignored due to path filters (3)
  • vendor/github.com/openshift/assisted-service/api/hiveextension/v1beta1/agentclusterinstall_types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/assisted-service/api/v1beta1/agent_types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift/assisted-service/api/v1beta1/infraenv_types.go is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (12)
  • api/hiveextension/v1beta1/agentclusterinstall_types.go
  • api/v1beta1/agent_types.go
  • api/v1beta1/infraenv_types.go
  • config/crd/bases/agent-install.openshift.io_agents.yaml
  • config/crd/bases/agent-install.openshift.io_infraenvs.yaml
  • config/crd/bases/extensions.hive.openshift.io_agentclusterinstalls.yaml
  • config/crd/resources.yaml
  • config/manifests/bases/assisted-service-operator.clusterserviceversion.yaml
  • deploy/olm-catalog/manifests/agent-install.openshift.io_agents.yaml
  • deploy/olm-catalog/manifests/agent-install.openshift.io_infraenvs.yaml
  • deploy/olm-catalog/manifests/assisted-service-operator.clusterserviceversion.yaml
  • deploy/olm-catalog/manifests/extensions.hive.openshift.io_agentclusterinstalls.yaml

Comment on lines +58 to +62
description: |-
APIVIP is the virtual IP address used to reach the OpenShift cluster's API server.
Deprecated: use apiVIPs instead to support dual-stack configurations. This field is ignored
when apiVIPs is set. For single-stack clusters, either field can be used; for dual-stack
clusters, use apiVIPs.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Clarify VIP backward-compatibility behavior (current text is misleading)

The docs currently say singular VIP fields are “ignored” when plural fields are set. In practice, the backend validates both and rejects mismatches (internal/cluster/validations/validations.go, HandleApiVipBackwardsCompatibility and HandleIngressVipBackwardsCompatibility). Please document the required-match behavior when both are provided.

Proposed wording update
- Deprecated: use apiVIPs instead to support dual-stack configurations. This field is ignored
- when apiVIPs is set. For single-stack clusters, either field can be used; for dual-stack
+ Deprecated: use apiVIPs instead to support dual-stack configurations. If both fields are set,
+ apiVIP must match the first element of apiVIPs; otherwise the request is rejected. For single-stack
+ clusters, either field can be used; for dual-stack
  clusters, use apiVIPs.
- Deprecated: use ingressVIPs instead to support dual-stack configurations. This field is ignored
- when ingressVIPs is set. For single-stack clusters, either field can be used; for dual-stack
+ Deprecated: use ingressVIPs instead to support dual-stack configurations. If both fields are set,
+ ingressVIP must match the first element of ingressVIPs; otherwise the request is rejected. For single-stack
+ clusters, either field can be used; for dual-stack
  clusters, use ingressVIPs.

As per coding guidelines, Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Also applies to: 346-350, 635-639

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/crd/bases/extensions.hive.openshift.io_agentclusterinstalls.yaml`
around lines 58 - 62, The description for APIVIP and analogous singular VIP
fields is misleading: update the YAML description text so it documents that when
both singular (APIVIP/IngressVIP) and plural (apiVIPs/ingressVIPs) fields are
provided they must match (backwards-compatibility validation will reject
mismatches) rather than being silently ignored; reference the backend validation
behavior implemented in HandleApiVipBackwardsCompatibility and
HandleIngressVipBackwardsCompatibility and state that the singular fields are
deprecated but still validated for equality with the corresponding entry in the
plural lists when both are set.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.27%. Comparing base (9347728) to head (6afa67c).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10124      +/-   ##
==========================================
- Coverage   44.28%   44.27%   -0.01%     
==========================================
  Files         415      415              
  Lines       72709    72709              
==========================================
- Hits        32199    32194       -5     
- Misses      37599    37602       +3     
- Partials     2911     2913       +2     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 10, 2026

@carbonin: all tests passed!

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

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants