feat: rbgctl supports rbg revision operations#54
Merged
cheyang merged 1 commit intosgl-project:mainfrom Oct 27, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
|
LGTM |
Syspretor
reviewed
Oct 15, 2025
cheyang
reviewed
Oct 15, 2025
dd8f92f to
fde043c
Compare
Signed-off-by: 柏存 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive CLI tooling for managing RoleBasedGroup (RBG) resources and their revisions. The tool can function both as a standalone executable (kubectl-rbg) and as a kubectl plugin, providing features for viewing RBG status, managing revision history, viewing diffs between revisions, and performing rollbacks.
Key Changes:
- Introduced a modular CLI structure with commands for status viewing, rollout history, diff comparison, and rollback operations
- Added utility functions for Kubernetes client initialization and namespace resolution
- Restructured the codebase from a single-file status command to a comprehensive multi-command CLI tool
Reviewed Changes
Copilot reviewed 19 out of 695 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Added dependencies for CLI runtime, YAML processing, and Kubernetes client utilities |
| doc/features/kubectl-rbg.md | New documentation describing installation, usage, and examples for all CLI commands |
| cmd/cli/main.go | Simplified to delegate to root command structure |
| cmd/cli/cmd/root.go | New root command setup with signal handling and subcommand registration |
| cmd/cli/cmd/status/* | Refactored status command into modular package with tests |
| cmd/cli/cmd/rollout/* | New rollout command suite (history, diff, undo) with comprehensive tests |
| cmd/cli/util/* | New utility package for client creation and namespace resolution |
| Makefile | Updated CLI binary name from kubectl-rbg-status to kubectl-rbg |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ⅰ. Motivation
rbgctl supports rbg revision operations
Ⅱ. Modifications
kubectl-rbgctl is a local executable command-line tool for managing RBG (RoleBasedGroup) and related resources such as ControllerRevision. Currently, it provides features such as viewing the RBG status, viewing RBG historical revisions, and rolling back the RBG. kubectl-rbgctl can be used both as a standalone tool or as a kubectl plugin.
Ⅲ. Does this pull request fix one issue?
fixes #45
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.