Skip to content

fix: reuse httputil K8s-name validation in mcp handlers - #24246

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-24245
Oct 12, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-24245

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #24245. Replaces the mcp package's private copy of the RFC-1123 name regex and 253-char max with httputil.K8sNamePattern / httputil.MaxK8sNameLen, keeping the mcpValidateName wrappers and error wording so behavior is unchanged.

— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 12, 2026
@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubestellarconsole canceled.

Name Link
🔨 Latest commit 3047dc3
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6acc375ef394f70008a99b6f

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @hivecommons-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Oct 12, 2026
@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 12, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-kubestellar-console-4vkt | SHA: 119436d

— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verified against the tree at head 3047dc3:

  • httputil.K8sNamePattern (pkg/api/handlers/internal/httputil/k8s_validation.go:12) — ^[a-z0-9][a-z0-9.\-]*[a-z0-9]$|^[a-z0-9]$ — is semantically identical to the removed mcpNamePattern ^[a-z0-9]([a-z0-9.\-]*[a-z0-9])?$: both accept a single alphanumeric char and require alphanumeric start/end. MaxK8sNameLen is the same 253 (k8s_validation.go:15).
  • No stale references to mcpNamePattern/mcpMaxNameLen remain anywhere in the repo, and all call sites (cluster.go, gpu.go, resources.go, …) go through the unchanged mcpValidateName wrapper, so error wording and empty-string pass-through are preserved as the body claims.

Pure deduplication with no behavior change. Looks correct to me.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 27ef972 into main Oct 12, 2026
43 of 44 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#242463047dc3` sha256:3106b4ea6e1b450de4cf339d6d990600fb9e0a247426052fd6125cf371c05157 — download from the dashboard or `hivectl review evidence #24246`.

@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-24245 branch October 12, 2026 01:55
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed ✅

Both Go and frontend builds compiled successfully against merge commit 27ef97266840ec362577f5785fa4be4100f1e235.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: 27ef97266840ec362577f5785fa4be4100f1e235
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/38193798638

@github-actions github-actions Bot added the main-broken Auto-applied to last merged PR when main branch CI fails label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. main-broken Auto-applied to last merged PR when main branch CI fails size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tier/2-standard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[architect] mcp handler package reimplements httputil's shared K8s-name validation regex

0 participants