Skip to content

feat: rbgctl supports rbg revision operations#54

Merged
cheyang merged 1 commit intosgl-project:mainfrom
bcfre:dev-1014
Oct 27, 2025
Merged

feat: rbgctl supports rbg revision operations#54
cheyang merged 1 commit intosgl-project:mainfrom
bcfre:dev-1014

Conversation

@bcfre
Copy link
Copy Markdown
Collaborator

@bcfre bcfre commented Oct 15, 2025

Ⅰ. 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

  • Format your code make fmt.
  • Add unit tests or integration tests.
  • Update the documentation related to the change.

@Syspretor Syspretor self-requested a review October 15, 2025 02:36
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@whybeyoung
Copy link
Copy Markdown
Collaborator

LGTM

Comment thread cmd/cli/cmd/rollback.go Outdated
Comment thread Makefile Outdated
@bcfre bcfre changed the title feat: rbgctl supports rbg revision operations [WIP] feat: rbgctl supports rbg revision operations Oct 16, 2025
@bcfre bcfre force-pushed the dev-1014 branch 2 times, most recently from dd8f92f to fde043c Compare October 22, 2025 06:24
@bcfre bcfre changed the title [WIP] feat: rbgctl supports rbg revision operations feat: rbgctl supports rbg revision operations Oct 22, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread cmd/cli/cmd/rollout/rollout_diff.go
Copy link
Copy Markdown
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@cheyang cheyang merged commit abe8e15 into sgl-project:main Oct 27, 2025
3 checks passed
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.

Development Roadmap (v0.5.0)

6 participants