Skip to content

Conversation

@rafabene
Copy link
Contributor

@rafabene rafabene commented Feb 6, 2026

Summary

  • Cluster name maxLength changed from 63 to 53 (aligned with CS clusters.go#L86)
  • NodePool name maxLength changed from 63/255 to 15 (aligned with CS validation_helpers.go#L56)
  • Added missing validateName and validateKind to standalone nodepool handler (node_pool.go)
  • Updated OpenAPI spec, handler validation, DB model constraints, and tests consistently

Changes

File Change
openapi/openapi.yaml Cluster maxLength 63→53, NodePool maxLength 63→15 (5 schemas)
pkg/handlers/cluster.go validateName(3, 63) → (3, 53)
pkg/handlers/cluster_nodepools.go validateName(1, 255) → (3, 15)
pkg/handlers/node_pool.go Added validateName(3, 15) and validateKind
pkg/api/cluster_types.go GORM size:63 → size:53
pkg/api/node_pool_types.go GORM size:255 → size:15
pkg/handlers/validation_test.go Updated cluster tests to 53, added 4 nodepool name tests
.gitignore Added .claude-flow/, .mcp.json, .swarm/

Test plan

  • All 379 unit tests passing
  • Lint passes with 0 issues

Jira: https://issues.redhat.com/browse/HYPERFLEET-364

Summary by CodeRabbit

  • Updates

    • Cluster names now accept a maximum of 53 characters (previously 63).
    • NodePool names now accept 3–15 characters (previously up to 63).
  • Chores

    • Added new ignore patterns to development configuration.

@openshift-ci openshift-ci bot requested review from 86254860 and AlexVulaj February 6, 2026 14:33
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

This PR tightens name length validation across the codebase: Cluster.name max length reduced from 63 to 53; NodePool.name constrained to 3–15 characters (previously up to 255 in storage). Changes appear in OpenAPI schema, GORM type tags, request validation handlers, and tests. Additionally, .gitignore was updated with .claude-flow/, .mcp.json, and .swarm/.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • rh-amarin
  • yingzhanredhat
  • jsell-rh
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main objective of the changeset: aligning cluster and nodepool name validation constraints with Clusters Service rules, which is the primary focus across all modified files.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

@rafabene
Copy link
Contributor Author

rafabene commented Feb 6, 2026

Follow-up ticket created to update hyperfleet-spec: https://issues.redhat.com/browse/HYPERFLEET-622

@rh-amarin
Copy link
Contributor

In this particular case for this openapi.yaml change, it may be quite innocuous but we are not changing the openapi version and versions in the api-spec repo and the other repos can very

I'm just commenting this for awareness, this PR still gets my...

@rh-amarin
Copy link
Contributor

/lgtm

…h CS rules

Cluster name max length changed from 63 to 53 and nodepool name max
length changed from 63/255 to 15, matching the Clusters Service
constraints. Added missing name and kind validation to standalone
nodepool handler.
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: 0

Caution

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

⚠️ Outside diff range comments (1)
openapi/openapi.yaml (1)

724-832: ⚠️ Potential issue | 🔴 Critical

Run make generate after OpenAPI source changes to regenerate Go models.

The source file openapi/openapi.yaml has been updated with maxLength constraints, but the generated Go models have not been regenerated. The pkg/api/openapi directory is missing, indicating make generate was not executed. This command must be run to update pkg/api/openapi/openapi.gen.go with the new maxLength values.

🧹 Nitpick comments (1)
pkg/handlers/validation_test.go (1)

153-233: Use a true 15‑character example to exercise the boundary.

"pool-123456789" is 14 chars, so the max‑length edge case isn’t covered.

Proposed tweak
-		"pool-123456789", // 15 chars
+		"pool-1234567890", // 15 chars

@rh-amarin
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 6, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rh-amarin

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-merge-bot openshift-merge-bot bot merged commit a6b0d1f into openshift-hyperfleet:main Feb 6, 2026
8 checks passed
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.

2 participants