Skip to content

feat(pool): show regex namespace matches in describe - #35

Merged
spencercjh merged 2 commits into
mainfrom
codex/check-regex-bindings
Nov 27, 2026
Merged

spencercjh merged 2 commits into
mainfrom
codex/check-regex-bindings

Conversation

@spencercjh

@spencercjh spencercjh commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Show up to 20 matching namespace names in sorted order and the exact total for each regex binding in hami-cli pool describe <pool>. Append ... when more than 20 namespaces match.
  • Reuse the same full-name RE2 matching as regex-bindings create --preview and share one namespace list request across all rules in the pool.
  • If namespace listing fails, warn on stderr, show <unavailable> in the preview column, and still print the pool details.

Verification

  • make ci passed.
  • Command tests cover full-name matching, sorted results, exact totals at and above the 20-name limit, no matches, and denied namespace listing.

Summary by CodeRabbit

  • New Features
    • pool describe now shows the namespaces matching each regex binding, sorted by name. The preview distinguishes no matches and unavailable results, and pool details remain visible if namespace listing fails.
  • Documentation
    • Updated the user guide and operations documentation with preview behavior, required namespace-list permission, and how warnings and unavailable results are displayed.

Signed-off-by: spencercjh <jiahao.cai@dynamia.ai>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T13:08:45.651908Z 685c994 New commits
🔒 Security Review ✅ Completed 2026-11-27T13:10:45.562198Z 685c994 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

pool describe now displays sorted namespace matches for each regex binding. If namespace listing fails, the CLI warns and displays <unavailable> while continuing to show pool details.

Changes: Regex binding previews

Layer / File(s) Summary
Namespace matching and preview formatting
regex_bindings.go
Helpers list and sort namespace names, filter names with regex rules, and format preview values for unavailable, invalid, empty, and matching results. The existing preview path uses the helpers.
Pool description output and validation
main.go, regex_bindings_test.go, README.md, docs/user-guide.md, skills/managing-hami-resource-pools/references/operations.md
pool describe fetches namespace names when regex bindings exist and adds a matching-namespaces column. Tests cover matching, empty, invalid, other-pool, and forbidden-list cases. Documentation describes the output and permission requirement.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant newPoolDescribeCommand
  participant KubernetesAPI
  participant printPoolDescription
  User->>newPoolDescribeCommand: Run pool describe
  newPoolDescribeCommand->>KubernetesAPI: List namespaces
  KubernetesAPI-->>newPoolDescribeCommand: Namespace names or list error
  newPoolDescribeCommand->>printPoolDescription: Pass namespace names
  printPoolDescription-->>User: Display pool details and regex previews
Loading

Possibly related PRs

Suggested reviewers: b-white84

Merge Risk: Minimal · up to 41e1b

pool describe now shows which namespaces each regex binding matches. If namespaces cannot be listed, it warns and still shows the pool details. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(pool): show regex namespace matches in describe" matches the main change. The PR adds a MATCHING NAMESPACES column to pool describe that previews which namespaces currently match eac…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "feat(pool): show regex namespace matches in describe" matches the main change. The PR adds a MATCHING NAMESPACES column to pool describe that previews which namespaces currently match each regex binding. The title names the feature, the affected command, and the scope. The supporting changes (warning on list failure, the <unavailable> placeholder, docs, and tests) fall under the same feature.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 568c6f8c-a85f-41e7-9396-274c0c0cf3cc
Commits

Reviewing files that changed from the base of the PR and between 7e887dd and 41e1b56.

Files selected for processing: 6

  • README.md
  • docs/user-guide.md
  • main.go
  • regex_bindings.go
  • regex_bindings_test.go
  • skills/managing-hami-resource-pools/references/operations.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Signed-off-by: spencercjh <jiahao.cai@dynamia.ai>
@spencercjh
spencercjh merged commit f98ce03 into main Nov 27, 2026
7 checks passed
@spencercjh
spencercjh deleted the codex/check-regex-bindings branch November 27, 2026 13:15
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.

1 participant